From 6e8fb5fe1c8a0a75b698fc25bb8c54bc105179ee Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 9 Jul 2012 05:02:30 +0000 Subject: [PATCH] Allow shift-modkey-mouse1 for resizing --- wm-wmii.c | 8 +++++--- wmpus.1 | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wm-wmii.c b/wm-wmii.c index 7814d71..1cc43af 100644 --- a/wm-wmii.c +++ b/wm-wmii.c @@ -722,10 +722,11 @@ int wm_handle_event(win_t *win, event_t ev, mod_t mod, ptr_t ptr) if (EV_MOUSE0 <= ev && ev <= EV_MOUSE7) { if (ev == EV_MOUSE1 && !mod.MODKEY && !mod.up) return raise_float(win), 0; + if ((ev == EV_MOUSE3 && mod.MODKEY && !mod.up) || + (ev == EV_MOUSE1 && mod.MODKEY && !mod.up && mod.shift)) + return set_move(win,ptr,RESIZE), 1; if (ev == EV_MOUSE1 && mod.MODKEY && !mod.up) return set_move(win,ptr,MOVE), 1; - if (ev == EV_MOUSE3 && mod.MODKEY && !mod.up) - return set_move(win,ptr,RESIZE), 1; if (move_mode != NONE && mod.up) return set_move(win,ptr,NONE), 1; if (ev == EV_MOUSE1 && !mod.up && win->state == ST_SHADE) @@ -928,7 +929,8 @@ void wm_init(win_t *root) event_t ev_e[] = {EV_ENTER, EV_FOCUS}; event_t ev_s[] = {'h', 'j', 'k', 'l', 'c', 'q', ' ', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + EV_MOUSE1, EV_MOUSE3}; event_t ev_m[] = {'h', 'j', 'k', 'l', 'd', 's', 'm', 't', 'f', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', EV_F1, EV_F2, EV_F3, EV_F4, EV_F5, EV_F6, diff --git a/wmpus.1 b/wmpus.1 index c475e11..a3e191f 100644 --- a/wmpus.1 +++ b/wmpus.1 @@ -147,7 +147,7 @@ Click in a floating window brings it to the top .B Alt-Button1 Click and drag moves a floating window under the cursor .TP -.B Alt-Button3 +.B Alt-Button3, Alt-Shift-Button1 Click and drag resizes the window under the cursor .SH X11 BACKEND The X11 backend draws a small 2px border around each window. The border for the -- 2.43.2