From: Po Lu Date: Mon, 24 Jan 2022 07:35:48 +0000 (+0800) Subject: Scale coordinates when checking if a touch event falls inside menu bar X-Git-Tag: emacs-29.0.90~2821 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e606434be65f55af371eb612b0bfe5f30d1cc859;p=emacs.git Scale coordinates when checking if a touch event falls inside menu bar * src/xterm.c (handle_one_xevent): Apply scale to touch event coordinates before intersecting them with the menu bar. --- diff --git a/src/xterm.c b/src/xterm.c index e5bcff10676..6ca270ec06f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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;