From 39b166bf176fb0128f2547ff502032533d257f9e Mon Sep 17 00:00:00 2001 From: speedie Date: Tue, 4 Apr 2023 01:14:23 +0200 Subject: [PATCH] oops, just like in dwm we need to remove the padding and border width in the buttonpress function --- libs/mouse.c | 4 ++-- mouse.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/mouse.c b/libs/mouse.c index 12e7567..2fbdcfd 100644 --- a/libs/mouse.c +++ b/libs/mouse.c @@ -85,9 +85,9 @@ buttonpress(XEvent *e) // check if we clicked on the prompt or the input if (ev->x < x + promptw + plw) { click = clickprompt; - } else if (ev->x > mw - modeWidth) { + } else if (ev->x > mw - modeWidth - 2 * sp - 2 * borderwidth) { click = clickmode; - } else if (ev->x > mw - modeWidth - numberWidth) { + } else if (ev->x > mw - modeWidth - numberWidth - 2 * sp - 2 * borderwidth) { click = clicknumber; } else { // actually we clicked on the input w = (lines > 0 || !matches) ? mw - x : inputw; diff --git a/mouse.h b/mouse.h index 283dc9d..10fe124 100644 --- a/mouse.h +++ b/mouse.h @@ -23,4 +23,6 @@ static Mouse buttons[] = { { clickinput, 0, Button1, clear, {0} }, { clickprompt, 0, Button1, clear, {0} }, + { clickmode, 0, Button1, switchmode, {0} }, + { clicknumber, 0, Button1, viewhist, {0} }, };