summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2005-10-06 10:03:08 +0000
committerAaron Plattner <aplattner@nvidia.com>2005-10-06 10:03:08 +0000
commit35e7414c6e4505b2e71be0e54ed0c7ff74f39db1 (patch)
tree4f6d06dc9be82258f08ee75bc602f1f41366c1df
parent938ff7de3f2bc4979bbf8a5f68190cde2be12696 (diff)
Tell the user when setting the screen configuration fails. Return nonzeroXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901
so scripts can find out too.
-rw-r--r--xrandr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xrandr.c b/xrandr.c
index e82cf58..60f3d9d 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -106,6 +106,7 @@ main (int argc, char **argv)
int reflection = 0;
int width = 0, height = 0;
int have_pixel_size = 0;
+ int ret = 0;
program_name = argv[0];
if (argc == 1) query = 1;
@@ -330,6 +331,12 @@ main (int argc, char **argv)
(SizeID) size, (Rotation) (rotation | reflection), rate, CurrentTime);
XRRQueryExtension(dpy, &event_base, &error_base);
+
+ if (setit && status == RRSetConfigFailed) {
+ printf ("Failed to change the screen configuration!\n");
+ ret = 1;
+ }
+
if (verbose && setit) {
if (status == RRSetConfigSuccess)
{
@@ -373,5 +380,5 @@ main (int argc, char **argv)
}
}
XRRFreeScreenConfigInfo(sc);
- return(0);
+ return(ret);
}