https://bugs.kde.org/show_bug.cgi?id=421068
Bug ID: 421068 Summary: Kwin sends out undated WM_TAKE_FOCUS messages that goad firefox into stealing focus Product: kwin Version: 5.14.5 Platform: Debian stable OS: Linux Status: REPORTED Severity: grave Priority: NOR Component: core Assignee: kwin-bugs-n...@kde.org Reporter: k...@kde.lka.org.lu Target Milestone: --- SUMMARY Kwin sends out undated WM_TAKE_FOCUS client messages. Gtk based applications such as Firefox react to these by handing focus to one of their subwindows using XSetInputFocus(), and pass on the null time field that they received in the client message to XSetInputFocus(). If for whatever reason the application (firefox) is slow to process the event, it might issue that XSetInputFocus() message at a time when it has already lost focus to the next application. This results in Firefox stealing back the focus from the next application. Normally, such an occurrence would not happen, as the server could tell by the time field that the message is stale. STEPS TO REPRODUCE 1. Open Firefox 2. Open Web Console Window (by using Inspect element) 3. Open another window (for example, a konsole), and place it such that it covers the top of the firefox web console 4. Open another window (another konsole) and place it such that it covers the bottom of the firexfox web console, leaving a narrow gap between both where web console is visible behind them. 5. Move mouse back and forth between the top and the bottom konsole, crossing the web console each time. 6. Whenever you are in a konsole with the mouse, observe the cursor shape. 7. Pretty quickly you see that your konsole does not have focus (hollow cursor) even the mouse is in the window. 8. Press cursor keys: you see that it's the Firefox web console who has focus! OBSERVED RESULT Firefox web console has focus EXPECTED RESULT Konsole should have focus SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian 10, 5.14.5.1-1 (available in About System) KDE Plasma Version: 5.14.5.1-1 KDE Frameworks Version: Qt Version: 4.8.7+dfsg-18 ADDITIONAL INFORMATION Bug initially reported to gtk under https://gitlab.gnome.org/GNOME/gtk/-/issues/2699 xtruss line showing the bad message WM_TAKE_FOCUS message: --- SendEvent-generated ClientMessage(window=w#04000003, type=a#306, format=32, data=00000133:00000000:00000000:00000000:00000000) -- You are receiving this mail because: You are watching all bug changes.