tigervnc/u_tigervnc-check-shm-harder.patch
2014-08-18 12:26:36 +00:00

27 lines
932 B
Diff

Index: vncviewer/X11PixelBuffer.cxx
===================================================================
--- vncviewer/X11PixelBuffer.cxx (revision 5186)
+++ vncviewer/X11PixelBuffer.cxx (working copy)
@@ -158,6 +158,8 @@
Bool pixmaps;
XErrorHandler old_handler;
Status status;
+ Window test_window;
+ GC test_gc;
if (!XShmQueryVersion(fl_display, &major, &minor, &pixmaps))
return 0;
@@ -187,6 +189,12 @@
old_handler = XSetErrorHandler(XShmAttachErrorHandler);
XShmAttach(fl_display, shminfo);
+ test_window = XCreateSimpleWindow(fl_display, XDefaultRootWindow(fl_display), 0, 0, width(), height(), 0, 0, 0);
+ test_gc = XCreateGC(fl_display, test_window, 0, 0);
+ XShmPutImage(fl_display, test_window, test_gc, xim, 0, 0, 0, 0, width(), height(), False);
+ XFreeGC(fl_display, test_gc);
+ XDestroyWindow(fl_display, test_window);
+
XSync(fl_display, False);
XSetErrorHandler(old_handler);