]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow C-mouse-2 to split windows on XInput 2 builds
authorPo Lu <luangruo@yahoo.com>
Fri, 11 Mar 2022 05:59:42 +0000 (13:59 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 11 Mar 2022 05:59:42 +0000 (13:59 +0800)
* src/xterm.c (handle_one_xevent): Use x_scroll_bar_handle_click
if ControlMask is set.

src/xterm.c

index 5b1e10237993504f8dd7fbb57caed9ec7b14d682..2adf70b829df7ffbd6c1493e794bdce7877f9dc1 100644 (file)
@@ -12660,17 +12660,25 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                    xembed_send_message (f, xev->time,
                                         XEMBED_REQUEST_FOCUS, 0, 0, 0);
                }
-#ifndef USE_TOOLKIT_SCROLL_BARS
              else
                {
                  struct scroll_bar *bar
                    = x_window_to_scroll_bar (dpyinfo->display,
                                              xev->event, 2);
 
+#ifndef USE_TOOLKIT_SCROLL_BARS
                  if (bar)
                    x_scroll_bar_handle_click (bar, (XEvent *) &bv, &inev.ie);
-               }
+#else
+                 /* Make the "Ctrl-Mouse-2 splits window" work for toolkit
+                    scroll bars.  */
+                 if (bar && xev->mods.effective & ControlMask)
+                   {
+                     x_scroll_bar_handle_click (bar, (XEvent *) &bv, &inev.ie);
+                     *finish = X_EVENT_DROP;
+                   }
 #endif
+               }
 
              if (xev->evtype == XI_ButtonPress)
                {