-m flag to fix dwm selmon bug
7cf66b44
1 file(s) · +5 −1
| 42 | 42 | static int bh, mw, mh; |
|
| 43 | 43 | static int inputw = 0; |
|
| 44 | 44 | static int lines = 0; |
|
| 45 | + | static int monitor = -1; |
|
| 45 | 46 | static int promptw; |
|
| 46 | 47 | static size_t cursor = 0; |
|
| 47 | 48 | static const char *font = NULL; |
|
| 455 | 456 | ||
| 456 | 457 | XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du); |
|
| 457 | 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 | 461 | break; |
|
| 460 | 462 | x = info[i].x_org; |
|
| 461 | 463 | y = info[i].y_org + (topbar ? 0 : info[i].height - mh); |
|
| 514 | 516 | /* double flags */ |
|
| 515 | 517 | else if(!strcmp(argv[i], "-l")) |
|
| 516 | 518 | lines = atoi(argv[++i]); |
|
| 519 | + | else if(!strcmp(argv[i], "-m")) |
|
| 520 | + | monitor = atoi(argv[++i]); |
|
| 517 | 521 | else if(!strcmp(argv[i], "-p")) |
|
| 518 | 522 | prompt = argv[++i]; |
|
| 519 | 523 | else if(!strcmp(argv[i], "-fn")) |
|