Commit 38ba099
committed
ui/gtk3: Implement virtual Wayland input-method with XIM
There were three issues.
The first issue was D-Bus signals weren't sent to the IBus panel for
the key release events of the shortcut key of the IME Switcher popup
and updating preedit and lookup table when XIM or GTK2 applications
are used, which don't support Wayland. Seems the problem is caused by
adding IBusWaylandSource in ibus/client/wayland to use the duplicated
event handling against glib2 and it's fixed to delete it.
The second issue was how to implement Wayland with XIM and GTK2.
I tried to handle the Wayland input-method activation/deactivation
with creating another Wayland compositor and text-input protocols.
But seems it needs to implement a custom wl_surface with the drawing
input contexts and it's complicated for me at the moment while
GNOME/mutter handles it with WL_SURFACE_ID environment but I cannot
find ways for other Wayland desktop environments.
Now XMODIFIERS=@im=ibus is used for X11 applications and
GTK_IM_MODULE=ibus is for GTK2 applications and handles the key events
in the IBus CandidatePanel UI and implements
ibus_panel_service_forward_process_key_event().
The third issue was when non-supported Wayland applications likes
XIM and GTK2 are used, the IBus CandidatePanel popup takes the focus
as the normal application window in Wayland since the Wayland panel
protocol requires the Wayland input-method activation. And if the
popup is shown, it takes the focus and the active applications loose
the input focus and the preedit text is cleared and it causes to close
the CandidatePanel popup. I.e. the focus continues to be swapped
between the application and the popup.
Now ibus-daemon handles not to send focus-out events for the
non-supported Wayland applications and IBus panel checks ibus-focus-out
signal from ibus/client/wayland module if the current application supports
the Wayland protocol and IBus engines handle a virtual input context to
continue to update the preedit.
BUG=#2562
BUG=#26171 parent 4251257 commit 38ba099
3 files changed
+226
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
129 | 143 | | |
130 | 144 | | |
131 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
53 | | - | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
61 | 73 | | |
62 | 74 | | |
63 | 75 | | |
| |||
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
87 | 122 | | |
88 | 123 | | |
89 | 124 | | |
| |||
161 | 196 | | |
162 | 197 | | |
163 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
164 | 217 | | |
165 | 218 | | |
166 | 219 | | |
| |||
180 | 233 | | |
181 | 234 | | |
182 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
183 | 253 | | |
184 | 254 | | |
185 | 255 | | |
| |||
194 | 264 | | |
195 | 265 | | |
196 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
197 | 283 | | |
198 | 284 | | |
199 | 285 | | |
| |||
221 | 307 | | |
222 | 308 | | |
223 | 309 | | |
224 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
225 | 313 | | |
226 | 314 | | |
227 | 315 | | |
| |||
244 | 332 | | |
245 | 333 | | |
246 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
247 | 347 | | |
248 | 348 | | |
249 | 349 | | |
| |||
449 | 549 | | |
450 | 550 | | |
451 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
452 | 556 | | |
453 | 557 | | |
454 | 558 | | |
| |||
0 commit comments