Create a separated bug from [bugs:#2135], the error:
Gdk-Message: 22:51:24.266: Window 0x28661e0 is a temporary window without parent, application will not be able to position it on screen.
screenshot (ibus-Fedora31.webm) is available at https://sourceforge.net/p/scintilla/bugs/2135/#f1a2
Wayland is the default display server in Fedora 25+, possible Ubuntu 20.04+.
The login screen on Fedora/Ubuntu has options for Wayland and X11.
https://fedoraproject.org/wiki/Changes/WaylandByDefault
https://discourse.ubuntu.com/t/wayland-for-19-10/10983
Confirmed that on Fedora 30 with "Japanese (Kana Kanji)" and SciTE set to ime.interaction=0 this problem occurs with Wayland but does not occur with X.
Its possible that this problem is limited to some IMEs as the window is likely being created and its attributes set by that code. Scintilla does set itself as the client window with
The error "Gdk-Message: 19:55:46.617: Window 0x2094240 is a temporary window without parent, application will not be able to position it on screen." is caused by
gtk_widget_show(PWidget(wPreedit));in PreeditChangedWindowedThis().after the error PreeditChanged() is called again with empty string.
After replacing
wPreedit = gtk_window_new(GTK_WINDOW_POPUP);withwPreedit = gtk_window_new(GTK_WINDOW_TOPLEVEL);, the GDK error is gone, but still can't type character: with Chinese Pinyin, type a, in PreeditChangedWindowedThis(), pes.str is 阿; then PreeditChanged() called again, pes.str is empty.Edit: it's then followed by PreeditEnd() (after adding preedit_end signal).
Last edit: Zufu Liu 2019-12-27
A potential direction is gtk_window_set_transient_for which was used for autocompletion and calltips with [8cb0c9].
Related
Commit: [8cb0c9]
Add gtk_window_set_transient_for() in RealizeThis() works.
There is related issue on GTK https://gitlab.gnome.org/GNOME/gtk/issues/1934
Updated patch (redundant casts in CreateCallTipWindow is removed). it still has bugs:
IME candidate window for Chinese Pinyin sometimes is not shown; for Japanese Kana Kanji, it sometimes at wrong position/direction.
Last edit: Zufu Liu 2019-12-28
The bug can be reproduced as following:
Change IME in native mode (i.e. not English keyboard/mode or direct input mode), then start SciTE; candidate window only shows (at expected position) when typing second word, after first word is committed (e.g. by press Enter).
It works fine when keyboard/IME is English mode or direct input mode before start SciTE.
An interesting find: candidate window is shown at right position after FocusOutThis() been called. e.g. start SciTE, click somewhere outside editor window, then click in editor window and start typing. but direct call FocusOutThis() doesn't make it work.
Calling FocusOutThis won't do the focus-in processing. Maybe just toggle the IME focus:
Comment out SetCandidateWindowPos() in FocusInThis() would make it works better, except for Chinese Pinyin and Japanese Mozc:
the IME candidate window is under caret line but in wrong direction on typing first letter as in screenshot (on Ubuntu using Mozc type to), the popover points down on typing 't', then filliped on typing 'o'.
This behavior for first letter is very similar to IME on macOS and Windows, looks something is missing or wrong.
This bug not occurred in the bait demo on [feature-requests:#1331], the IME candidate window is at expected position and direction on typing first letter.
Related
Feature Requests: #1331
This bug seems only occurred in the VMs, it not occurred in dual boot Ubuntu 18.04.
However there is a warning on Ubuntu 18.04 (both VM and dual boot, GTK 3.22.30) for gtk_window_set_transient_for() in RealizeThis():
move gtk_window_set_transient_for() to the end of MapThis() still has this warning. This warning doesn't affect using IMEs.
Updated patch:
Committed change that just sets the preedit window as transient for main as [b99cb7]. This is sufficient to avoid the warning and show the IME window.
The per-platform position tweaks were not committed at this time.
Related
Commit: [b99cb7]