From a213c39fa9d741d519df56bc4d4abb86113985f4 Mon Sep 17 00:00:00 2001 From: Xerxes RĂ„nby Date: Sun, 16 Aug 2015 04:38:39 +0200 Subject: Bug 1183: X11RandR13 XRRGetScreenResourcesCurrent _occasionally_ reports empty data --- src/newt/native/X11RandR13.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/newt/native/X11RandR13.c') diff --git a/src/newt/native/X11RandR13.c b/src/newt/native/X11RandR13.c index 0dd53feb8..3f9dff289 100644 --- a/src/newt/native/X11RandR13.c +++ b/src/newt/native/X11RandR13.c @@ -39,6 +39,14 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_RandR13_getScreenResources0 Display *dpy = (Display *) (intptr_t) display; Window root = RootWindow(dpy, (int)screen_idx); + /* Bug 1183 + * XRRGetScreenResourcesCurrent (or XRRGetScreenResources) + * _occasionally_ reports empty data + * unless XRRGetScreenSizeRange has been called once. + */ + int minWidth, minHeight, maxWidth, maxHeight; + XRRGetScreenSizeRange ( dpy, root, &minWidth, &minHeight, &maxWidth, &maxHeight); + XRRScreenResources *res = XRRGetScreenResourcesCurrent( dpy, root); // 1.3 // XRRScreenResources *res = XRRGetScreenResources( dpy, root); // 1.2 -- cgit v1.2.3