Switching input method blurs the input
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
People
(Reporter: xidorn, Unassigned)
References
Details
(Keywords: regression)
Attachments
(1 file)
397 bytes,
text/html
|
Details |
Steps to reproduce:
- open the attached testcase
- focus the input box in the page
- switch the input method via the shortcut (Super + space as default for me)
- observe the log under the input box which records focus and blur events
Expected result:
there is no extra blur / focus events when switching input method
Actual result:
there are two blur-focus event pairs appear there
I tried to change to a different shortcut, specifically Ctrl + space, and the issue is still there. Also if I choose the input method from the input method menu on the system tray, the same thing would happen as well.
I tested Chromium, and there is no such issue there.
This is observable, especially that on certain websites, once you blur an input, it wouldn't gain focus back automatically, which is annoying.
I'm not sure whether it should be an issue in DOM or in the widget.
Reporter | ||
Comment 1•5 years ago
|
||
Oh, and I'm using Ubuntu 19.04 with GNOME and iBus.
Comment 2•5 years ago
|
||
Doesn't repro for me on Ubuntu 18.04.
Comment 3•5 years ago
|
||
Doesn't repro for me on Ubuntu 19.10 (tried keyboard layouts only).
Comment 4•5 years ago
|
||
(In reply to Xidorn Quan [:xidorn] UTC+11 from comment #1)
Oh, and I'm using Ubuntu 19.04 with GNOME and iBus.
Isn't 19.04 out of support?
Comment 5•5 years ago
|
||
OK. I can repro on Ubuntu 19.10 if at least one of the participants in the switch is indeed an IBus IME and not a plain keyboard layout.
masayuki, do you know why this happens? (This is a regression relative to Ubuntu 18.04.)
Reporter | ||
Comment 6•5 years ago
|
||
Yeah, it's 19.10, sorry...
Comment 7•5 years ago
|
||
According to the log of nsGtkIMModuleWidgets:5
, IMContextWrapper::OnBlurWindow()
and IMContextWrapper::OnFocusWindow()
are called.
https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/widget/gtk/nsWindow.cpp#1649,1726
https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/widget/gtk/nsWindow.cpp#3160,3188
This means GTK widget dispatches active
and deactive
events.
karlt, enndeakin: Do you know something about window level focus issue on Linux?
Comment 8•5 years ago
|
||
If the shortcut is a global shortcut handled by the window manager, then a temporary loss of focus is expected so that the window manager can receive the keyboard events for the shortcut.
https://searchfox.org/mozilla-central/search?q=GDK_WINDOW_STATE_FOCUSED is not affected by this. Perhaps Chromium is avoiding the problem by using this.
If the shortcut is handled by the input method itself, then the situation is different, but I'm not familiar with how input methods affect focus.
Comment 9•5 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #8)
If the shortcut is a global shortcut handled by the window manager, then a temporary loss of focus is expected so that the window manager can receive the keyboard events for the shortcut.
I tested the super-space shortcut, which at least looks like it's a Gnome Shell -level thing. Why does the temporary loss of focus not occur on Ubuntu 18.04 when switching between IMEs or on Ubuntu 19.10 when switching between keyboard layouts? Gnome Shell handles super-space in those cases, too.
Comment 10•5 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #9)
(In reply to Karl Tomlinson (:karlt) from comment #8)
If the shortcut is a global shortcut handled by the window manager, then a temporary loss of focus is expected so that the window manager can receive the keyboard events for the shortcut.
I tested the super-space shortcut, which at least looks like it's a Gnome Shell -level thing. Why does the temporary loss of focus not occur on Ubuntu 18.04 when switching between IMEs or on Ubuntu 19.10 when switching between keyboard layouts? Gnome Shell handles super-space in those cases, too.
I interpreted my results incorrectly. The cases where I didn't see the problem (18.04 with IME and 19.10 with keyboard layouts only) were in Wayland sessions. The case where I saw the problem was in an X session.
This is a Wayland vs. X thing. The problem does not occur on 19.10 between IMEs in a Wayland session.
Comment 12•5 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Reporter | ||
Updated•5 years ago
|
Updated•3 years ago
|
Description
•