sway icon indicating copy to clipboard operation
sway copied to clipboard

GTK-3 menus opens the leftmost menu item no matter which item is clicked if touchinput device is present

Open maribu opened this issue 3 years ago • 16 comments

Please fill out the following:

  • Sway Version: 1.8, Alpine Linux package 1.8-r1

  • wlroots Version: 0.16.1, Alpine Linux package 0.16.1-r1

  • Mesa: 22.3.3, Alpine Linux package 22.3.3-r0

  • GTK3: 3.24.36, Alpine Linux package gtk+3.0-3.25.36-r0

  • Debug Log:

  • Configuration File:

    • The issue is reproducible on Alpine with the default configuration file for sway, GTK3, and fontconfig. I couldn't think of any other config that may have an impact on this.
  • Stack Trace:

    • Does not apply: Bug is not a crash
  • Description:

    • Run the GTK3 demo application (or any other GTK+-3 app with a menu) and click on a menu item
    • The leftmost menu will open, no matter which menu was clicked
    • Note: With GDK_BACKEND=x11 the menu item that was actually clicked will open

screen recording

maribu avatar Jan 17 '23 08:01 maribu

Note: I think this issue does not affect my machine with an Intel GPU, but it does affect two different machines with AMD GPUs.

maribu avatar Jan 17 '23 08:01 maribu

Note: I think this issue does not affect my machine with an Intel GPU, but it does affect two different machines with AMD GPUs.

This kind of behavior should not be GPU dependent. Differences in the install or the output configuration are more likely to be the cause.

kennylevinsen avatar Jan 17 '23 08:01 kennylevinsen

This also happens to me. It occurs with Thunar File Manager.

bigrand avatar Jan 18 '23 23:01 bigrand

Does it also occur with GTK4?

bl4ckb0ne avatar Jan 20 '23 15:01 bl4ckb0ne

The first time I open a menu with GTK4 I see visual "glitches" for half a second and this warning is printed on the terminal:

(gtk4-demo-application:17313): Gdk-WARNING **: 17:45:36.181: Compositor doesn't support moving popups, relying on remapping

Afterwards the GTK4 no longer tries using moving popups and the menu opens right away. Both the first time a menu is opened (with visual glitches) and subsequently the correct menu opens. So the issue seems to not affect GTK4.

There is one other curious behavior that may be related: For a split of second or so the first item in the menu is highlighted (as if my cursor would be hovering over it). Afterwards the highlight moves back to the menu. So there may also be something causing GTK4 to misinterpret the cursor position of a split of a second right after the click.

maribu avatar Jan 20 '23 16:01 maribu

I have seen this behavior exclusively in virt-manager when running in sway. Does not happen with gnome.

Checking virt-manager, seems to be a gtk3 app.

ruabmbua avatar Feb 21 '23 19:02 ruabmbua

This bug also appears when using firefox thru wayland via sway's wlroots implementation, and seems its a wlroots bug but has never been watched out yet.

c0001 avatar Jun 08 '23 13:06 c0001

This bug also happened to me. It appears in gtk3 applications such as Thunar and Xournalpp. It didn't occure in Nautilus, which is I believe gtk4 app. I use a 2 in 1 convertable lenovo yoga, and when I use the stylus instead of the mouse pointer the menus open normally. I noticed the bug only on this device on every distribution I tried (Arch and Fedora). It occured both sway and hyprland, so its probalby a wlroots bug.

wwaleszcz avatar Jun 23 '23 16:06 wwaleszcz

I'm experiencing this issue also (and have done for a long time). Arch Linux, sway 1.8.1, wlroots 0.16.2, Gtk 3.24.38, Intel GPU. I'm seeing it with Gtk3 apps like Mousepad and LibreOffice, but not Gtk4 apps like Transmission-gtk.

Interestingly, I also don't see the issue with Firefox or Thunderbird, even though they are Gtk3 apps (and I'm not running them through XWayland).

c4rlo avatar Jul 22 '23 10:07 c4rlo

I tried running sway on multiple devices and this problem happened only on devices with touchscreens.

wwaleszcz avatar Oct 28 '23 06:10 wwaleszcz

Ah, I originally throught the GPU in use had something to do with it. My two affected machines have both an AMD GPU and, crucially, also a touchscreen. The unaffected machine has an Intel GPU, and crucially, no touchscreen.

I think the touchscreen presence indeed is triggering the issue.

maribu avatar Oct 28 '23 11:10 maribu

No touchscreen on my desktop, but I have a wacom drawing pen tablet thing plugged in all the time. This would not be the first issue caused by it on sway ^^.

ruabmbua avatar Oct 31 '23 13:10 ruabmbua

I experience the issue as well and I also have a Wacom tablet. When unplugging the tablet, the issue disappears. After plugging it again, the issue is back.

wentasah avatar Jan 04 '24 15:01 wentasah

Forgot to mention, unplugging the tablet fixes the problem for me as well.

ruabmbua avatar Jan 04 '24 22:01 ruabmbua

Still present in Sway 1.9.0.

wentasah avatar Feb 26 '24 22:02 wentasah

Seems to only occur when a touchscreen-like device is connected. I had this issue for months, sporadically, but I always have my graphic tablet connected to my PC; right after plugging it off, the problem was resolved. Should perhaps rename the issue. Related issue on GTK3 upstream? https://gitlab.gnome.org/GNOME/gtk/-/issues/3116

6b6279 avatar Jul 24 '24 15:07 6b6279

Has some solved this bug? Still have the same error with gtk3 or gtk2 apps in sway and niri? Yoga 2-in-1 with touchscreen

Nasendackel avatar Feb 07 '25 21:02 Nasendackel

Probably a GTK-3 issue. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8240 -- I don't use sway but I tested on kwin and it fixes things

fanzhuyifan avatar Feb 26 '25 07:02 fanzhuyifan