summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xrandr-notify.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/xrandr-notify.c b/xrandr-notify.c
index 3c1ad52..fc8e60d 100644
--- a/xrandr-notify.c
+++ b/xrandr-notify.c
@@ -23,15 +23,18 @@ int main(int argc, char **argv)
has_randr = false;
has_randr = XRRQueryExtension(dpy, &randr_event_base, &dummy);
- if (has_randr) {
- /* Get root window */
- screen = DefaultScreen(dpy) ;
- root = RootWindow(dpy, screen) ;
-
- /* Notify on configuration change */
- XRRSelectInput(dpy, root, RRScreenChangeNotifyMask);
+ if (!has_randr) {
+ fputs("ERROR: RandR extension unavailable on current screen!\n", stderr);
+ return EXIT_FAILURE;
}
+ /* Get root window */
+ screen = DefaultScreen(dpy) ;
+ root = RootWindow(dpy, screen) ;
+
+ /* Notify on configuration change */
+ XRRSelectInput(dpy, root, RRScreenChangeNotifyMask);
+
while (true) {
XNextEvent(dpy, &event);