emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8419011ceb: Translate buttons when sending XI2 motion events to x


From: Po Lu
Subject: master 8419011ceb: Translate buttons when sending XI2 motion events to xwidgets
Date: Wed, 29 Dec 2021 00:32:37 -0500 (EST)

branch: master
commit 8419011cebc25efda0e130e9734bf4f5106e651e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Translate buttons when sending XI2 motion events to xwidgets
    
    * src/xterm.c (handle_one_xevent): Translate all three buttons
    when passing XI2 motion events to xwidgets.
---
 src/xterm.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 3200e44a87..a986681ab7 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10210,13 +10210,25 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #ifdef HAVE_XWIDGETS
              if (xv)
                {
+                 uint state = xev->mods.effective;
+
+                 if (xev->buttons.mask_len)
+                   {
+                     if (XIMaskIsSet (xev->buttons.mask, 1))
+                       state |= Button1Mask;
+                     if (XIMaskIsSet (xev->buttons.mask, 2))
+                       state |= Button2Mask;
+                     if (XIMaskIsSet (xev->buttons.mask, 3))
+                       state |= Button3Mask;
+                   }
+
                  if (found_valuator)
                    xwidget_scroll (xv, xev->event_x, xev->event_y,
-                                   xv_total_x, xv_total_y, xev->mods.effective,
+                                   xv_total_x, xv_total_y, state,
                                    xev->time, any_stop_p);
                  else
                    xwidget_motion_notify (xv, xev->event_x, xev->event_y,
-                                          xev->mods.effective, xev->time);
+                                          state, xev->time);
 
                  goto XI_OTHER;
                }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]