From: Po Lu Date: Wed, 29 Dec 2021 05:30:46 +0000 (+0800) Subject: Translate buttons when sending XI2 motion events to xwidgets X-Git-Tag: emacs-29.0.90~3380 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8419011cebc25efda0e130e9734bf4f5106e651e;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index 3200e44a872..a986681ab77 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; }