nativeshell / examples

Other
64 stars 7 forks source link

On KDE X11, main window sometimes loses focus when switching or closing menu items #11

Open nyanpasu64 opened 3 years ago

nyanpasu64 commented 3 years ago

I'm running this repo, latest main d385acefcc2405ddb863f79e3ccdb4479891008c, with updated dependencies plus nativeshell updated to https://github.com/nativeshell/nativeshell/commit/790b609bd79d229848bce423b708dba389e0a639.

Are you overwhelmed with bug reports or not?

Instructions:

This issue is easier to spot if you switch KDE's color scheme from "Breeze Light/Dark" to "Breeze", so focused title bars are dark and unfocused title bars are light.

Results:

Usually the window will maintain focus when you wiggle your mouse, and when you click on the window. Close the window and try again.

On some program runs, the title bar will flash the "inactive" color when you wiggle your mouse. (On the Breeze color theme, it turns from dark to light). If you click outside of the menu bar, on the rest of the app window body, will close the menu but leave the app defocused until you click a second time!

If your second click is on selectable text (in this case, "lib/pages/menu.dart") or even if your second click is not on selectable text, it fails to refocus the app and you need a third click to do so.

Desktop environments:

Could reproduce:

Could not reproduce:

Videos:

Bug on KWin X11:

https://user-images.githubusercontent.com/913957/123012627-72787d00-d377-11eb-89ae-da3a92071fb0.mp4

Flutter version:

Flutter 2.3.0-17.0.pre.434 • channel master • https://github.com/flutter/flutter.git Framework • revision b79dd40bad (50 minutes ago) • 2021-06-22 18:51:04 -0400 Engine • revision 2536a34859 Tools • Dart 2.14.0 (build 2.14.0-233.0.dev)

System info:

Operating System: Arch Linux KDE Plasma Version: 5.22.1 KDE Frameworks Version: 5.83.0 Qt Version: 5.15.2 Kernel Version: 5.12.11-zen1-1-zen (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

knopp commented 3 years ago

I tried this with KDE/Plasma 5.22.2/X11 with high contrast theme but so far I'm unable to rperoduce this. Which Gtk version do you have installed?

nyanpasu64 commented 3 years ago

Arch package version 1:3.24.29-2, aka GTK+ 3.24.29. The bug occurs with both the Arch package, and my self-built packages with debug symbols.

I haven't tried the bug in other user accounts though.

knopp commented 3 years ago

No luck reproducing this. As far as I can tell Gtk sets proper window type atom (i.e. _NET_WM_WINDOW_TYPE_DROPDOWN_MENU) and it's Kwin responsibility not to unfocus parent window for child that is a menu. So it seems like this might be a kwin bug, but possibly fixed in 5.22.2 since I can't reproduce it.

nyanpasu64 commented 3 years ago

Reproduced on KWin 5.22.2. Shrug, that's weird. It's not the biggest bug though.