Add warning if RandR initialization fails

Since currently the multimonitor extension support is a compile-time
argument, there is not much we can do to recover from not being able to
initialize RandR other than print an error and exit.
This commit is contained in:
Nikos Tsipinakis 2017-04-19 08:18:44 +03:00
parent ce623af5ae
commit 56dfc25baf

View File

@ -77,7 +77,10 @@ int randr_event_base = 0;
void init_screens()
{
int randr_error_base = 0;
XRRQueryExtension(xctx.dpy, &randr_event_base, &randr_error_base);
if (!XRRQueryExtension(xctx.dpy, &randr_event_base, &randr_error_base)) {
fprintf(stderr, "Dunst was compiled with RandR but RandR extension is missing.");
exit(1);
}
XRRSelectInput(xctx.dpy, RootWindow(xctx.dpy, DefaultScreen(xctx.dpy)), RRScreenChangeNotifyMask);
x_update_screens();
}