You are not logged in.

#1 2023-11-03 16:21:52

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Issue with clicking on context menus in gtk3 apps

Hello,

I've been experiencing an issue with apps using gtk3 where the number of clicks required for context menus and their items varies between 1, 2, 3, or 4 clicks instead of just one. This problem doesn't occur with QT apps or gtk2 apps(I only tested gimp), and I've even tested it with a different mouse.

I'm currently using hyprland on arch with an AMD graphic card, and the issue persists even when I switch to sway.
Additionally, I attempted to reset the gtk settings and using the X11 gtk backend, but the problem persists.
If someone would have an idea on how to fix this, I would be happy, thanks.

Here's a video with sound showing the bug, the top right is pcmanfm-qt and other apps are gtk3 (Problem also happen with firefox since it uses gtk) :
https://drive.google.com/file/d/1xkg302 … tJySj/view

Last edited by kyuzial (2023-11-04 16:42:57)

Offline

#2 2023-11-03 16:25:27

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: Issue with clicking on context menus in gtk3 apps

Does it help to "export GDK_CORE_DEVICE_EVENTS=1"?

Offline

#3 2023-11-03 16:35:55

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Re: Issue with clicking on context menus in gtk3 apps

seth wrote:

Does it help to "export GDK_CORE_DEVICE_EVENTS=1"?

Thanks for you reply, I tried setting it in a terminal and launching apps but no it doesn't change anything. (Do I need to set the variable for the whole environment or is the way I used okay ? )

Offline

#4 2023-11-03 16:38:22

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: Issue with clicking on context menus in gtk3 apps

You need to export it to the disfunctional client, ie.

GDK_CORE_DEVICE_EVENTS=1 gtk3-demo

would fix gtk3-demo - if this was related.

Offline

#5 2023-11-03 16:45:17

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Re: Issue with clicking on context menus in gtk3 apps

I tried exporting the variable to mousepad and thunar and I have the same behavior.

Offline

#6 2023-11-03 20:11:01

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: Issue with clicking on context menus in gtk3 apps

Sanity check: does it also happen in an openbox (X11) session?

Offline

#7 2023-11-04 13:03:10

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Re: Issue with clicking on context menus in gtk3 apps

seth wrote:

Sanity check: does it also happen in an openbox (X11) session?

The behavior seems to be better. When I click slowly (waiting half a second after the menu is shown), there's no issue. However, when I click quickly, it's the same as when using Wayland.
Using X11 it's mostly improved, at least it's not entirely random but I don't really want to use X11.
I also tried on my laptop (intel graphics) having almost the same hyprland setup and I have the same issue.

Offline

#8 2023-11-04 14:10:35

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: Issue with clicking on context menus in gtk3 apps

Using X11 it's mostly improved, at least it's not entirely random but I don't really want to use X11.

The point of that excercise was/is to narrow down on the inhibitor.

If you don't click multiple times in hyprland but just wait (maybe longer than on openbox, 25+ seconds), does that have the same effect?

However, I just checked the video - is this only about the main menu entries toggling the popup?
Cause that's (openbox behavior, like 500ms delay or so) is perfectly normal (for gtk3) - there's some cooldown phase and I don't remember it every being any different.

Offline

#9 2023-11-04 15:52:30

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Re: Issue with clicking on context menus in gtk3 apps

If you don't click multiple times in hyprland but just wait (maybe longer than on openbox, 25+ seconds), does that have the same effect?

When waiting longer, I still have the bug.

However, I just checked the video - is this only about the main menu entries toggling the popup?

It relates to both the main menu entries toggling the popup and the behavior within popups, I can experience the same behavior when clicking on entries.
This issue also occurs with the context menu when right-clicking, making it particularly annoying. When I click on an entry, nothing happens, requiring me to right-click again and select the entry to perform the action.
It seems to be a bug of gtk on wayland, since it doesn't happen on xwayland or xorg.
(I can make a video to show that if my explanation is not clear enough)

Offline

#10 2023-11-04 16:10:52

seth
Member
Registered: 2012-09-03
Posts: 59,084

Re: Issue with clicking on context menus in gtk3 apps

https://bbs.archlinux.org/viewtopic.php?id=279586 - "fixed", but your situation isn't /that/ bad.
Does it work "properly" w/ weston?

Offline

#11 2023-11-04 16:25:40

kyuzial
Member
Registered: 2023-11-03
Posts: 6

Re: Issue with clicking on context menus in gtk3 apps

My issue is quite bad, having to open the right click menu multiple time because I can't click on an item is really annoying, on firefox when clicking on an entry, the popup doesn't disappear but I have to click multiple times(happen for select all option with text for example)
I tried using weston and kde and it seems to fix the issue, I guess it's a bug with wlroots since I have this issue on both sway and hyprland. Thanks for you help.

Offline

#12 2024-10-13 03:28:58

drankinatty
Member
From: Nacogdoches, Texas
Registered: 2009-04-24
Posts: 73
Website

Re: Issue with clicking on context menus in gtk3 apps

This is a late bump of this thread, but this is definitely a Gtk/GDK issue. I see the same on openSUSE. I don't use a desktop much on Arch, just servers. I can confirm that with apps like gnome-sudoku, clicking on the app the first time does nothing. Clicking a second time is required to get the app to recognize input. Then it behaves fine. This is on an X11 setup.

I do have to GDK_CORE_DEVICE_EVENTS=1 for Firefox and Thunderbird to allow middle-mouse scroll to work with the mouse set to "focus-follows-mouse". Otherwise the middle-mouse-scroll has no effect when Firefox or Thunderbird are not brought to the front as the top-level windows. Exporting  GDK_CORE_DEVICE_EVENTS=1 solves the middle-mouse-scroll when other windows overlap Firefox or Thunderbird, but makes no difference with the gnome-sudoku not recognizing the mouse-click issue.

There are about a dozen bugs over the last 8 years or so this could be a regression of with GDK not being able to identify the correct window the mouse-event belongs to, and in that case simply discards the input. I have no firm answer yet on which bug or which regression this could be, but have a couple of bugs open on the Firefox/Thunderbird issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1907708 and https://bugzilla.mozilla.org/show_bug.cgi?id=1359226 and https://bugzilla.opensuse.org/show_bug.cgi?id=1230424

I hope a solution is found, this is a frustrating issue in Gtk apps for users not running gnome.


David C. Rankin, J.D.,P.E.

Offline

Board footer

Powered by FluxBB