diff options
author | Keith Packard <keithp@keithp.com> | 2009-01-30 20:11:02 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-01-30 20:11:02 -0800 |
commit | 77891e7900765a320ad3d43b56bbb1f3081b6582 (patch) | |
tree | 9e7e6a9c222f9c03c3e3b582cddf7ffe7283cd02 | |
parent | 6f3e2bb207cff069791811ef2bbe7798759ed810 (diff) |
Add --nograb option
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | xrandr.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -48,6 +48,7 @@ static int screen = -1; static Bool verbose = False; static Bool automatic = False; static Bool properties = False; +static Bool grab_server = True; static char *direction[5] = { "normal", @@ -106,6 +107,7 @@ usage(void) fprintf(stderr, " --screen <screen>\n"); fprintf(stderr, " --verbose\n"); fprintf(stderr, " --dryrun\n"); + fprintf(stderr, " --nograb\n"); #if HAS_RANDR_1_2 fprintf(stderr, " --prop or --properties\n"); fprintf(stderr, " --fb <width>x<height>\n"); @@ -1442,7 +1444,8 @@ apply (void) * event and ask for xinerama information from the server * receive up-to-date information */ - XGrabServer (dpy); + if (grab_server) + XGrabServer (dpy); /* * Set the screen size @@ -1461,11 +1464,15 @@ apply (void) if (s != RRSetConfigSuccess) panic (s, crtc); } + + set_primary (); + /* * Release the server grab and let all clients * respond to the updated state */ - XUngrabServer (dpy); + if (grab_server) + XUngrabServer (dpy); } /* @@ -2011,6 +2018,10 @@ main (int argc, char **argv) verbose = True; continue; } + if (!strcmp ("--nograb", argv[i])) { + grab_server = False; + continue; + } if (!strcmp("--current", argv[i])) { current = True; /* if --current was the only arg, then query */ |