From e606434be65f55af371eb612b0bfe5f30d1cc859 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 24 Jan 2022 15:35:48 +0800 Subject: [PATCH] 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. --- src/xterm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.39.2