]> git.eshelyaron.com Git - emacs.git/commitdiff
Scale coordinates when checking if a touch event falls inside menu bar
authorPo Lu <luangruo@yahoo.com>
Mon, 24 Jan 2022 07:35:48 +0000 (15:35 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 24 Jan 2022 07:37:24 +0000 (15:37 +0800)
* src/xterm.c (handle_one_xevent): Apply scale to touch event
coordinates before intersecting them with the menu bar.

src/xterm.c

index e5bcff10676df171b09be41d005bf1527af1ff73..6ca270ec06f92030183872c41a68803abe026f51 100644 (file)
@@ -11412,8 +11412,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                            && xg_event_is_for_menubar (f, event));
              if (f && FRAME_X_OUTPUT (f)->toolbar_widget)
                {
-                 test_rect.x = xev->event_x;
-                 test_rect.y = xev->event_y;
+                 int scale = xg_get_scale (f);
+
+                 test_rect.x = xev->event_x / scale;
+                 test_rect.y = xev->event_y / scale;
                  test_rect.width = 1;
                  test_rect.height = 1;