summaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorTim Waugh <twaugh@redhat.com>2014-10-16 14:53:17 +0100
committerTim Waugh <twaugh@redhat.com>2014-10-16 14:53:17 +0100
commitb17c9c4dedf09873b10b3c23d5f189aa9eba6978 (patch)
tree1c4a331c37f711f14c525216f2a79fdb029d1120 /vncviewer
parent705276743c0dcf15c17c8b56794855cebdecfc1b (diff)
downloadtigervnc-b17c9c4dedf09873b10b3c23d5f189aa9eba6978.tar.gz
tigervnc-b17c9c4dedf09873b10b3c23d5f189aa9eba6978.zip
Don't use MIT-SHM on remote displays.
When run from within 'ssh -X' or 'ssh -Y', MIT-SHM will appear to be available even though it won't work: the shared memory will be on the machine running vncviewer, not on the machine running the X server it displays to. Depending on what shm segments are available on the machine running the X server, the failure may not be apparent when checking that MIT-SHM works. Avoid this by not using MIT-SHM when XDisplayName() indicates we may not be running locally. Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1072733
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/X11PixelBuffer.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx
index 59b90e2c..f83aa5f4 100644
--- a/vncviewer/X11PixelBuffer.cxx
+++ b/vncviewer/X11PixelBuffer.cxx
@@ -156,6 +156,11 @@ int X11PixelBuffer::setupShm()
Bool pixmaps;
XErrorHandler old_handler;
Status status;
+ const char *display_name = XDisplayName (NULL);
+
+ /* Don't use MIT-SHM on remote displays */
+ if (*display_name && *display_name != ':')
+ return 0;
if (!XShmQueryVersion(fl_display, &major, &minor, &pixmaps))
return 0;