[gnome-panel] menu: only consume mouse button 3 press events
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] menu: only consume mouse button 3 press events
- Date: Wed, 15 Jun 2022 11:07:00 +0000 (UTC)
commit c6e3c1db8d0428b0a0c6b5be41c42c7d64d74bac
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Wed Jun 15 12:39:55 2022 +0200
menu: only consume mouse button 3 press events
According to Alberts, the purpose of hooking the mouse button press
event is "...to not show applet menu if you right click on some menu item."
Nevertheless for hierarchical menus it's important that button 1 presses
propagate down the window hierarchy. Otherwise it's impossible to open
the submenus without a mouse -- the tap on a touch screen seems to
cause the button press event to be emitted.
Let's propagate the events from buttons other than button 3.
https://gitlab.gnome.org/GNOME/gnome-panel/-/merge_requests/51
modules/menu/gp-menu-bar-applet.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/modules/menu/gp-menu-bar-applet.c b/modules/menu/gp-menu-bar-applet.c
index e3a1c74f7..378bc7ea2 100644
--- a/modules/menu/gp-menu-bar-applet.c
+++ b/modules/menu/gp-menu-bar-applet.c
@@ -76,7 +76,10 @@ button_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
- return TRUE;
+ if (event->button == 3)
+ return TRUE;
+
+ return FALSE;
}
static gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]