summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-10 09:12:59 +0800
committerPo Lu <luangruo@yahoo.com>2022-03-10 09:13:08 +0800
commit70d63ead212b7ca1e561b869d44fddb14d0445af (patch)
tree629ae71e2641c4c166b26df0f4be48c272f10616 /src/gtkutil.c
parent2353893bd04bfee7c7659a758cf7c5072121a90c (diff)
downloademacs-70d63ead212b7ca1e561b869d44fddb14d0445af.tar.gz
emacs-70d63ead212b7ca1e561b869d44fddb14d0445af.tar.bz2
emacs-70d63ead212b7ca1e561b869d44fddb14d0445af.zip
Fix menu bar event detection on XI2 builds using Core Input
* src/gtkutil.c (xg_get_gdk_scale): Always return 1 on GTK+ 2. (xg_event_is_for_menubar): Fix some ifdefs. * src/xterm.c (handle_one_xevent): Update a comment.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index bf95c966421..2a647810886 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -266,6 +266,7 @@ xg_display_open (char *display_name, GdkDisplay **dpy)
static int
xg_get_gdk_scale (void)
{
+#ifdef HAVE_GTK3
const char *sscale = getenv ("GDK_SCALE");
if (sscale)
@@ -274,6 +275,7 @@ xg_get_gdk_scale (void)
if (0 < scale)
return min (scale, INT_MAX);
}
+#endif
return 1;
}
@@ -4223,13 +4225,13 @@ xg_event_is_for_menubar (struct frame *f, const XEvent *event)
}
else
{
-#else
+#endif
rec.x = event->xbutton.x / scale;
rec.y = event->xbutton.y / scale;
-#endif
#ifdef HAVE_XINPUT2
}
#endif
+
rec.width = 1;
rec.height = 1;