[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e606434be6: Scale coordinates when checking if a touch event fall
From: |
Po Lu |
Subject: |
master e606434be6: Scale coordinates when checking if a touch event falls inside menu bar |
Date: |
Mon, 24 Jan 2022 02:37:34 -0500 (EST) |
branch: master
commit e606434be65f55af371eb612b0bfe5f30d1cc859
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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 e5bcff1067..6ca270ec06 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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master e606434be6: Scale coordinates when checking if a touch event falls inside menu bar,
Po Lu <=