]> Dogcows Code - chaz/openbox/commitdiff
better VIDMODE support, handle the cases where the functions fail
authorDana Jansens <danakj@orodu.net>
Wed, 4 Jun 2003 23:21:51 +0000 (23:21 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 4 Jun 2003 23:21:51 +0000 (23:21 +0000)
openbox/client.c

index 450263843b5b09d243401a93c67aa542d96934ec..f704ca1a61924dd41f5e4ef89d0c66ae6b18f621 100644 (file)
@@ -1613,17 +1613,21 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
         int dot;
         XF86VidModeModeLine mode;
 
-        XF86VidModeGetViewPort(ob_display, ob_screen, &x, &y);
-        XF86VidModeGetModeLine(ob_display, ob_screen, &dot, &mode);
-        w = mode.hdisplay;
-        h = mode.vdisplay;
-        if (mode.privsize) XFree(mode.private);
+        if (XF86VidModeGetModeLine(ob_display, ob_screen, &dot, &mode)) {
+            w = mode.hdisplay;
+            h = mode.vdisplay;
+            if (mode.privsize) XFree(mode.private);
+        } else {
 #else
-       x = 0;
-       y = 0;
-       w = screen_physical_size.width;
-       h = screen_physical_size.height;
+            w = screen_physical_size.width;
+            h = screen_physical_size.height;
 #endif
+#ifdef VIDMODE
+        }
+        if (!XF86VidModeGetViewPort(ob_display, ob_screen, &x, &y)) {
+            x = y = 0;
+#endif
+        }
         user = FALSE; /* ignore that increment etc shit when in fullscreen */
     } else {
         /* set the size and position if maximized */
This page took 0.029024 seconds and 4 git commands to generate.