From b1d0d8e1f77eb3882a490aea6e31b7ec9ae642c1 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 11 Mar 2022 13:59:42 +0800 Subject: [PATCH] Allow C-mouse-2 to split windows on XInput 2 builds * src/xterm.c (handle_one_xevent): Use x_scroll_bar_handle_click if ControlMask is set. --- src/xterm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 5b1e1023799..2adf70b829d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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) { -- 2.39.2