nativeshell / examples

Other
64 stars 7 forks source link

On Wayland, after opening menu and clicking another window, hovering menubar reopens menu #13

Closed nyanpasu64 closed 3 years ago

nyanpasu64 commented 3 years ago

On KDE Wayland (not KDE/GNOME Xorg), mousing over the menubar can sometimes cause it to reopen without a click:

The menu opens by itself, despite you having closed the menu earlier, and not clicking to reopen it.

nyanpasu64 commented 3 years ago

On the old binary with the bug still present, I could not reproduce the bug on other Wayland compositors like Weston (weston-eglstream). And on KWin Wayland, I could not reproduce this behavior in other toolkits like Qt or GTK3 apps. (GTK4 apps display as a black screen.)

(GNOME Wayland was an absolute clusterfuck nightmare. I managed to login without a system lockup this time around, but font antialiasing was turned off in most GTK3 apps, NativeShell's title bar was invisible and flickered whenever I moved my mouse over it, menu text was missing, NativeShell pumped out GTK3 rendering errors, menus disappeared and wouldn't appear when clicked, and the entire window turned white when I resized it. I don't know if it's due to GNOME or Wayland.)

I don't know if this is a kwin_wayland bug or a nativeshell bug, and whether I should report this upstream to KDE.

EDIT: The bug does seem fixed.

knopp commented 3 years ago

I could reproduce this reliably with kwin/wayland (not on x11).

nyanpasu64 commented 3 years ago

Do you think that the menu issue is KWin Wayland failing to deliver the events that the Wayland protocol mandates? Flutter misinterpreting KWin Wayland's events? nativeshell misinterpreting a set of events sent from Flutter?

knopp commented 3 years ago

TBH I don't know if this is issue with Kwin or Gtk. The selection-done event on GtkMenuShell is not delivered when it should be, but I haven't had time to look into why it didn't. I just added a workaround to detect the situation and fix it.

nyanpasu64 commented 3 years ago

Filed upstream at https://bugs.kde.org/show_bug.cgi?id=439093.

Notable points:

I get somewhat different behavior on GNOME Mutter Wayland (ignoring the catastrophic graphical corruption, step 3 does not open the menu you hover, but clicking also doesn't work!)

In any case, NativeShell has worked around this problem in https://github.com/nativeshell/nativeshell/pull/24, which fixes the incorrect behaviors on both KWin and GNOME Mutter.

I don't know if your change is the right fix, or if it works around an error in Flutter's event handling, or if both Mutter and KWin are broken in their own way.

Maybe we should wait until the Mutter graphical corruption is resolved before digging further.