diff options
-rw-r--r-- | src/x11.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -366,12 +366,15 @@ puglRealize(PuglView* const view) } #ifdef HAVE_XRANDR - // Set refresh rate hint to the real refresh rate - XRRScreenConfiguration* conf = XRRGetScreenInfo(display, parent); - short current_rate = XRRConfigCurrentRate(conf); - - view->hints[PUGL_REFRESH_RATE] = current_rate; - XRRFreeScreenConfigInfo(conf); + int ignored = 0; + if (XRRQueryExtension(display, &ignored, &ignored)) { + // Set refresh rate hint to the real refresh rate + XRRScreenConfiguration* conf = XRRGetScreenInfo(display, parent); + short current_rate = XRRConfigCurrentRate(conf); + + view->hints[PUGL_REFRESH_RATE] = current_rate; + XRRFreeScreenConfigInfo(conf); + } #endif updateSizeHints(view); |