From cc68392ccbdf2151d81b62d38d7910b3e4867a8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 21 Aug 2012 20:38:48 +0200 Subject: [PATCH] wmbutton: Middle button enabled by default The mouse middle button should be enabled by default (see the help and the manpage). This patch solves this bug. The MIDMOUSE definition is removed because the value of MIDMOUSE changes the middle button behaviour. Now, the middle button always works, except if the user uses the -m argument. Now the manpage and the help show the same info. --- wmbutton/wmb_libs.c | 4 ---- wmbutton/wmbutton.c | 4 ++-- wmbutton/wmbutton.h | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/wmbutton/wmb_libs.c b/wmbutton/wmb_libs.c index 0d8daad..8f54d5e 100644 --- a/wmbutton/wmb_libs.c +++ b/wmbutton/wmb_libs.c @@ -116,11 +116,7 @@ void show_usage() { fprintf(stderr,"-F Custom tooltip font (e.g. -b\\&h-lucidatypewriter-medium-*-*-*-12-*)\n"); fprintf(stderr,"-v Verbose Mode.\n"); fprintf(stderr,"-h Help. This message.\n"); -#if MIDMOUSE fprintf(stderr,"-m Disable Middle Mouse functionality.\n"); -#else - fprintf(stderr,"-m Enable Middle Mouse functionality.\n"); -#endif fprintf(stderr,"-s Swap tooltip colors.\n"); fprintf(stderr,"-n Turn off tooltips.\n"); fprintf(stderr,"\n"); diff --git a/wmbutton/wmbutton.c b/wmbutton/wmbutton.c index cd0617f..14831fd 100644 --- a/wmbutton/wmbutton.c +++ b/wmbutton/wmbutton.c @@ -296,7 +296,7 @@ int main(int argc, char **argv) break; case Button2: - if (Config.mmouse) { + if (!Config.mmouse) { N = whichButton(report.xbutton.x, report.xbutton.y); if ((N >= 0) && (N <= NUMB_OF_APPS)) { button_pressed = N + MMASK; @@ -339,7 +339,7 @@ int main(int argc, char **argv) break; case Button2: - if (Config.mmouse) { + if (!Config.mmouse) { N = whichButton(report.xbutton.x, report.xbutton.y); if ((N >= 0) && (N <= NUMB_OF_APPS) && (N == button_pressed)) RunAppN(N + MMASK); diff --git a/wmbutton/wmbutton.h b/wmbutton/wmbutton.h index ebf62ff..9facaae 100644 --- a/wmbutton/wmbutton.h +++ b/wmbutton/wmbutton.h @@ -36,7 +36,6 @@ /****** Define Other Options ****************************************/ #define VERB 0 /* Enable=1, Disable=0: Debugging (verbose) Mode*/ -#define MIDMOUSE 1 /* Define Middle Mouse functionality */ #define LMASK 0 /* left button mask: run app # mask + button #*/ #define MMASK 10 /* middle button mask: run app # mask + button #*/ #define RMASK 20 /* right button mask: run app # mask + button #*/ -- 2.11.4.GIT