From 6e4dabef8e42f8b812247dcc52239eaf902f3b4f Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 9 Feb 2026 07:52:10 +0800 Subject: [PATCH] opt: allow none mode in some mouse button --- config.conf | 5 ++--- src/mango.c | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config.conf b/config.conf index c455f0f..f9dafb2 100644 --- a/config.conf +++ b/config.conf @@ -219,12 +219,11 @@ bind=CTRL+ALT,Left,resizewin,-50,+0 bind=CTRL+ALT,Right,resizewin,+50,+0 # Mouse Button Bindings -# NONE mode key only work in ov mode +# btn_left and btn_right can't bind none mod key mousebind=SUPER,btn_left,moveresize,curmove mousebind=NONE,btn_middle,togglemaximizescreen,0 mousebind=SUPER,btn_right,moveresize,curresize -mousebind=NONE,btn_left,toggleoverview,1 -mousebind=NONE,btn_right,killclient,0 + # Axis Bindings axisbind=SUPER,UP,viewtoleft_have_client diff --git a/src/mango.c b/src/mango.c index 551b254..c68c4bf 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2008,14 +2008,21 @@ buttonpress(struct wl_listener *listener, void *data) { if (config.mouse_bindings_count < 1) break; m = &config.mouse_bindings[ji]; + + if (selmon->isoverview && event->button == BTN_LEFT && c) { + toggleoverview(&(Arg){.i = 1}); + return; + } + + if (selmon->isoverview && event->button == BTN_RIGHT && c) { + pending_kill_client(c); + return; + } + if (CLEANMASK(mods) == CLEANMASK(m->mod) && event->button == m->button && m->func && - (selmon->isoverview == 1 || m->button == BTN_MIDDLE) && c) { - m->func(&m->arg); - return; - } else if (CLEANMASK(mods) == CLEANMASK(m->mod) && - event->button == m->button && m->func && - CLEANMASK(m->mod) != 0) { + (CLEANMASK(m->mod) != 0 || + (event->button != BTN_LEFT && event->button != BTN_RIGHT))) { m->func(&m->arg); return; }