diff options
| author | Connor Lane Smith <cls@lubutu.com> | 2010-11-02 12:15:15 +0000 |
|---|---|---|
| committer | Connor Lane Smith <cls@lubutu.com> | 2010-11-02 12:15:15 +0000 |
| commit | 7cf66b443ad1cc9a698db477401b843f3c14184b (patch) | |
| tree | 7febe80d2a1a5200b706cf26bcd45938e6074bc4 | |
| parent | 038a78a3f4ac507a819a12035c379c20077a0051 (diff) | |
-m flag to fix dwm selmon bug
| -rw-r--r-- | dmenu.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -42,6 +42,7 @@ static char text[BUFSIZ]; | |||
| 42 | static int bh, mw, mh; | 42 | static int bh, mw, mh; |
| 43 | static int inputw = 0; | 43 | static int inputw = 0; |
| 44 | static int lines = 0; | 44 | static int lines = 0; |
| 45 | static int monitor = -1; | ||
| 45 | static int promptw; | 46 | static int promptw; |
| 46 | static size_t cursor = 0; | 47 | static size_t cursor = 0; |
| 47 | static const char *font = NULL; | 48 | static const char *font = NULL; |
| @@ -455,7 +456,8 @@ setup(void) { | |||
| 455 | 456 | ||
| 456 | XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du); | 457 | XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du); |
| 457 | for(i = 0; i < n; i++) | 458 | for(i = 0; i < n; i++) |
| 458 | if(INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height)) | 459 | if((monitor == info[i].screen_number) |
| 460 | || (monitor < 0 && INRECT(x, y, info[i].x_org, info[i].y_org, info[i].width, info[i].height))) | ||
| 459 | break; | 461 | break; |
| 460 | x = info[i].x_org; | 462 | x = info[i].x_org; |
| 461 | y = info[i].y_org + (topbar ? 0 : info[i].height - mh); | 463 | y = info[i].y_org + (topbar ? 0 : info[i].height - mh); |
| @@ -514,6 +516,8 @@ main(int argc, char *argv[]) { | |||
| 514 | /* double flags */ | 516 | /* double flags */ |
| 515 | else if(!strcmp(argv[i], "-l")) | 517 | else if(!strcmp(argv[i], "-l")) |
| 516 | lines = atoi(argv[++i]); | 518 | lines = atoi(argv[++i]); |
| 519 | else if(!strcmp(argv[i], "-m")) | ||
| 520 | monitor = atoi(argv[++i]); | ||
| 517 | else if(!strcmp(argv[i], "-p")) | 521 | else if(!strcmp(argv[i], "-p")) |
| 518 | prompt = argv[++i]; | 522 | prompt = argv[++i]; |
| 519 | else if(!strcmp(argv[i], "-fn")) | 523 | else if(!strcmp(argv[i], "-fn")) |
