]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/x11/xcommon.c: fix XShm detection on remote X.
authorSam Hocevar <sam@videolan.org>
Sat, 17 Mar 2007 21:20:59 +0000 (21:20 +0000)
committerSam Hocevar <sam@videolan.org>
Sat, 17 Mar 2007 21:20:59 +0000 (21:20 +0000)
modules/video_output/x11/xcommon.c

index ef9fc2b9b0faac7604398f453fb28ab551e7159f..6d47910fa58908fffbb2d11de5ad62d38bdf2d16 100644 (file)
@@ -2787,20 +2787,21 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
  *****************************************************************************/
 static int X11ErrorHandler( Display * display, XErrorEvent * event )
 {
-    /* Ingnore errors on XSetInputFocus()
-     * (they happen when a window is not yet mapped) */
-    if( event->request_code == X_SetInputFocus )
+    switch( event->request_code )
     {
-        fprintf(stderr, "XSetInputFocus failed\n");
+    case X_SetInputFocus:
+        /* Ingnore errors on XSetInputFocus()
+         * (they happen when a window is not yet mapped) */
         return 0;
-    }
 
-    if( event->request_code == 150 /* MIT-SHM */ &&
-        event->minor_code == X_ShmAttach )
-    {
-        fprintf(stderr, "XShmAttach failed\n");
-        b_shm = VLC_FALSE;
-        return 0;
+    case 150: /* MIT-SHM */
+    case 146: /* MIT-SHM too, what gives? */
+        if( event->minor_code == X_ShmAttach )
+        {
+            b_shm = VLC_FALSE;
+            return 0;
+        }
+        break;
     }
 
     XSetErrorHandler(NULL);