]> Dogcows Code - chaz/openbox/commitdiff
fix for acroread - don't shrink windows when they specifically fit an entire monitor
authorDana Jansens <danakj@orodu.net>
Wed, 1 Aug 2007 22:54:02 +0000 (18:54 -0400)
committerDana Jansens <danakj@orodu.net>
Wed, 1 Aug 2007 22:54:02 +0000 (18:54 -0400)
openbox/client.c

index 712df3a579768f8a0664fc727717e7097094cbe7..ca85db6197d73e721b27463dc4fba6205195ebc8 100644 (file)
@@ -403,26 +403,33 @@ void client_manage(Window window)
           client_normal(self) &&
           !self->session)))
     {
-        Rect placer;
+        Rect *monitor, *a, placer;
+
+        monitor = screen_physical_area_monitor(client_monitor(self));
 
         RECT_SET(placer, placex, placey, placew, placeh);
         frame_rect_to_frame(self->frame, &placer);
 
-        Rect *a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &placer);
+        a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &placer);
 
         /* shrink by the frame's area */
         a->width -= self->frame->size.left + self->frame->size.right;
         a->height -= self->frame->size.top + self->frame->size.bottom;
 
-        /* fit the window inside the area */
-        if (placew > a->width || self->area.height > a->height) {
+        /* fit the window inside the area
+           but, don't shrink oldschool fullscreen windows to fit inside the
+           struts (fixes Acroread, which makes its fullscreen window
+           fit the screen but it is not USSize'd or USPosition'd) */
+        if ((placew > a->width || self->area.height > a->height) &&
+            !(self->decorations == 0 && RECT_EQUAL(placer, *monitor)))
+        {
             placew = MIN(self->area.width, a->width);
             placeh = MIN(self->area.height, a->height);
 
-            ob_debug("setting window size to %dx%d\n",
-                     self->area.width, self->area.height);
+            ob_debug("setting window size to %dx%d\n", placew, placeh);
         }
         g_free(a);
+        g_free(monitor);
     }
 
 
This page took 0.0379 seconds and 4 git commands to generate.