diff options
author | Sven Gothel <[email protected]> | 2011-08-01 20:18:28 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-08-01 20:18:28 +0200 |
commit | 5884366b39182fdc84dd1565d1727dde03606897 (patch) | |
tree | ebcc41f15a2de0f4d1452e3a68f3b367dd23efc7 /src/nativewindow/native | |
parent | 4afe6456f631352933bd5dcb7610b516a90f29eb (diff) |
AWT/X11 Reduce XQueryExtension 'hang' ; Impl. use XineramaIsActive() instead of XineramaQueryScreens()
- Reenable creating own XDisplay for AWT components, which reduces/removes hang
in subsequent XQueryExtension call (fetchScreens .. XineramaEnabled())
- Impl. use XineramaIsActive() instead of XineramaQueryScreens()
Reducing memory allocation, XFree call (which was missing anyways)
Diffstat (limited to 'src/nativewindow/native')
-rw-r--r-- | src/nativewindow/native/x11/XineramaHelper.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nativewindow/native/x11/XineramaHelper.c b/src/nativewindow/native/x11/XineramaHelper.c index 25a79645b..a4d380e13 100644 --- a/src/nativewindow/native/x11/XineramaHelper.c +++ b/src/nativewindow/native/x11/XineramaHelper.c @@ -37,6 +37,7 @@ #include <gluegen_stdint.h> #include <X11/Xlib.h> +#include <stdio.h> #ifdef __sun @@ -98,23 +99,23 @@ Bool XineramaEnabled(Display* display) { #else - char* XinExtName = "XINERAMA"; + static const char* XinExtName = "XINERAMA"; int32_t major_opcode, first_event, first_error; Bool gotXinExt = False; - int32_t locNumScr = 0; + Bool isXinActive = False; - XineramaScreenInfo *xinInfo; + // fprintf(stderr, "XineramaEnabled: p0\n"); fflush(stderr); gotXinExt = XQueryExtension(display, XinExtName, &major_opcode, &first_event, &first_error); + // fprintf(stderr, "XineramaEnabled: p1 gotXinExt %d\n",gotXinExt); fflush(stderr); if (gotXinExt) { - xinInfo = XineramaQueryScreens(display, &locNumScr); - if (xinInfo != NULL) { - return True; - } + isXinActive = XineramaIsActive(display); } - return False; + // fprintf(stderr, "XineramaEnabled: p2 XineramaIsActive %d\n", isXinActive); fflush(stderr); + + return isXinActive; #endif } |