summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-04-21 11:46:42 +0200
committerAlexander Larsson <alexl@redhat.com>2010-04-23 16:36:31 +0200
commit43a61bb6fe1e9741e686fc57b51e782432c384de (patch)
tree3b6669dd8104a80492cc7c601ed456430e25ed17 /client
parentc39f9e4a5baa7208a791f41531e87f05c43ceb71 (diff)
downloadspice-43a61bb6fe1e9741e686fc57b51e782432c384de.tar.gz
spice-43a61bb6fe1e9741e686fc57b51e782432c384de.tar.xz
spice-43a61bb6fe1e9741e686fc57b51e782432c384de.zip
Detect XShm extension sanely
The previous way XShm detection worked failed at least for me, and is not the standard way. We now just use XShmQueryExtension and XShmQueryVersion.
Diffstat (limited to 'client')
-rw-r--r--client/x11/platform.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 0151b416..2c3604a4 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -2169,9 +2169,8 @@ void Platform::init()
{
int err, ev;
int threads_enable;
- int connection_fd;
- socklen_t sock_len;
- struct sockaddr sock_addr;
+ int major, minor;
+ Bool pixmaps;
DBG(0, "");
@@ -2184,9 +2183,8 @@ void Platform::init()
THROW("open X display failed");
}
- connection_fd = ConnectionNumber(x_display);
- if (!getsockname(connection_fd, &sock_addr, &sock_len) &&
- XShmQueryExtension(x_display) && sock_addr.sa_family == AF_UNIX ) {
+ if (XShmQueryExtension (x_display) &&
+ XShmQueryVersion (x_display, &major, &minor, &pixmaps)) {
x_shm_avail = true;
}