[hackers] [dmenu] -m flag to fix dwm selmon bug || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Tue, 2 Nov 2010 12:15:20 +0000 (UTC)

changeset: 373:7057efb48ef3
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Tue Nov 02 12:15:15 2010 +0000
files: dmenu.c
description:
-m flag to fix dwm selmon bug

diff -r 414877c1c81b -r 7057efb48ef3 dmenu.c
--- a/dmenu.c Fri Oct 08 23:40:11 2010 +0100
+++ b/dmenu.c Tue Nov 02 12:15:15 2010 +0000
@@ -42,6 +42,7 @@
 static int bh, mw, mh;
 static int inputw = 0;
 static int lines = 0;
+static int monitor = -1;
 static int promptw;
 static size_t cursor = 0;
 static const char *font = NULL;
@@ -455,7 +456,8 @@
 
                 XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du);
                 for(i = 0; i < n; i++)
- if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))
+ if((monitor == info[i].screen_number)
+ || (monitor < 0 && INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)))
                                 break;
                 x = info[i].x_org;
                 y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
@@ -514,6 +516,8 @@
                 /* double flags */
                 else if(!strcmp(argv[i], "-l"))
                         lines = atoi(argv[++i]);
+ else if(!strcmp(argv[i], "-m"))
+ monitor = atoi(argv[++i]);
                 else if(!strcmp(argv[i], "-p"))
                         prompt = argv[++i];
                 else if(!strcmp(argv[i], "-fn"))
Received on Tue Nov 02 2010 - 13:15:20 CET

This archive was generated by hypermail 2.2.0 : Tue Nov 02 2010 - 13:24:04 CET