diff options
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r-- | pugl/detail/x11.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 7b8daf2..f9a45e8 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -37,6 +37,10 @@ #include <X11/Xutil.h> #include <X11/keysym.h> +#ifdef HAVE_XRANDR +# include <X11/extensions/Xrandr.h> +#endif + #ifdef HAVE_XSYNC # include <X11/extensions/sync.h> # include <X11/extensions/syncconst.h> @@ -325,6 +329,15 @@ puglRealize(PuglView* view) return st; } +#ifdef HAVE_XRANDR + // Set refresh rate hint to the real refresh rate + XRRScreenConfiguration* conf = XRRGetScreenInfo(display, xParent); + short current_rate = XRRConfigCurrentRate(conf); + + view->hints[PUGL_REFRESH_RATE] = current_rate; + XRRFreeScreenConfigInfo(conf); +#endif + updateSizeHints(view); XClassHint classHint = { world->className, world->className }; |