Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nyanpasu64 opened this issue Jun 22, 2021 · 4 comments

Comments

@nyanpasu64
Copy link

nyanpasu64 commented Jun 22, 2021

I'm running this repo, latest main d385ace, with updated dependencies plus nativeshell updated to nativeshell/nativeshell@790b609.

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.

  • cargo build --release
  • watch -n0.1 ./target/release/nativeshell_examples
    • This bug only appears randomly, so watch makes testing easier by automatically respawning the app after I close it. (I'm sure you can use a bash loop too, but I don't remember the syntax, and I use fish which has a different syntax.)
    • I didn't test cargo run --release or debug.
  • Click on the "Menu & MenuBar" tab.
  • Expand the purple menu.
  • (Optionally) move your mouse rapidly left and right across the menu entries, optionally moving it onto the white space around the menu bar.
  • Close the menu by clicking on the window.

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:

  • KDE Xorg (has KWin title bars)

Could not reproduce:

  • GNOME Xorg (has GTK3 client-side decoration title bars) (10-20 failed tries)
  • Weston Wayland (has GTK3 client-side decoration title bars) (15-ish tries). It was difficult to test because my cursor kept lagging, and the nativeshell window popped up on a different location on each run.
  • KDE Wayland (title bars look like KWin, probably drawn by KWin) (20-ish failed tries)
    • Menus had invisible text, and closing the window produced GTK3 drawing errors.
  • GNOME Wayland (has GTK3 client-side decoration title bars) (20-ish failed tries)
    • I could not start GNOME Wayland through SDDM or XDG_SESSION_TYPE=wayland dbus-run-session gnome-session; it locked up. I ended up running mutter --wayland & gnome-terminal (not gnome-session since it would error out) and going from there.

Videos:

Bug on KWin X11:

nativeshell.menu.defocusing.kwin.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
Copy link
Contributor

knopp commented Jun 23, 2021

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
Copy link
Author

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
Copy link
Contributor

knopp commented Jun 23, 2021

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants