diff options
author | Keith Packard <keithp@keithp.com> | 2009-01-30 20:37:34 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-01-30 20:37:34 -0800 |
commit | 909defc8a2b009ab845d875ba10e1ca01fb9d648 (patch) | |
tree | d062bba05626979a19a9f9086f3944c406c6d12f | |
parent | 6c70e0ee693ea293e8674d049249b462f3d36855 (diff) |
Add --noprimary option
-rw-r--r-- | xrandr.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -49,6 +49,7 @@ static Bool verbose = False; static Bool automatic = False; static Bool properties = False; static Bool grab_server = True; +static Bool no_primary = False; static char *direction[5] = { "normal", @@ -138,6 +139,7 @@ usage(void) fprintf(stderr, " --panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l>/<t>/<r>/<b>]]]\n"); fprintf(stderr, " --gamma <r>:<g>:<b>\n"); fprintf(stderr, " --primary\n"); + fprintf(stderr, " --noprimary\n"); fprintf(stderr, " --newmode <name> <clock MHz>\n"); fprintf(stderr, " <hdisp> <hsync-start> <hsync-end> <htotal>\n"); fprintf(stderr, " <vdisp> <vsync-start> <vsync-end> <vtotal>\n"); @@ -1242,11 +1244,15 @@ set_primary(void) { output_t *output; - for (output = outputs; output; output = output->next) { - if (!(output->changes & changes_primary)) - continue; - if (output->primary) - XRRSetOutputPrimary(dpy, root, output->output.xid); + if (no_primary) { + XRRSetOutputPrimary(dpy, root, None); + } else { + for (output = outputs; output; output = output->next) { + if (!(output->changes & changes_primary)) + continue; + if (output->primary) + XRRSetOutputPrimary(dpy, root, output->output.xid); + } } } @@ -2292,6 +2298,11 @@ main (int argc, char **argv) setit_1_2 = True; continue; } + if (!strcmp ("--noprimary", argv[i])) { + no_primary = True; + setit_1_2 = True; + continue; + } if (!strcmp ("--set", argv[i])) { output_prop_t *prop; if (!output) usage(); |