]> Dogcows Code - chaz/openbox/commitdiff
Remember the maximized state of a window when it goes fullscreen and try restore...
authorDana Jansens <danakj@orodu.net>
Fri, 15 Jan 2010 19:50:36 +0000 (14:50 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 15 Jan 2010 19:50:36 +0000 (14:50 -0500)
openbox/client.c
openbox/client.h

index 6d934bd7edd89ab98305ef48138cb432ec27c151..909112ea63e3bd0ed32c28ee9c95f47ebafa82a7 100644 (file)
@@ -3149,6 +3149,9 @@ void client_fullscreen(ObClient *self, gboolean fs)
 
     if (fs) {
         self->pre_fullscreen_area = self->area;
+        self->pre_fullscreen_max_horz = self->max_horz;
+        self->pre_fullscreen_max_vert = self->max_vert;
+
         /* if the window is maximized, its area isn't all that meaningful.
            save its premax area instead. */
         if (self->max_horz) {
@@ -3170,6 +3173,17 @@ void client_fullscreen(ObClient *self, gboolean fs)
         g_assert(self->pre_fullscreen_area.width > 0 &&
                  self->pre_fullscreen_area.height > 0);
 
+        self->max_horz = self->pre_fullscreen_max_horz;
+        self->max_vert = self->pre_fullscreen_max_vert;
+        if (self->max_horz) {
+            self->pre_max_area.x = self->pre_fullscreen_area.x;
+            self->pre_max_area.width = self->pre_fullscreen_area.width;
+        }
+        if (self->max_vert) {
+            self->pre_max_area.y = self->pre_fullscreen_area.y;
+            self->pre_max_area.height = self->pre_fullscreen_area.height;
+        }
+
         x = self->pre_fullscreen_area.x;
         y = self->pre_fullscreen_area.y;
         w = self->pre_fullscreen_area.width;
index 7370efcfb33351a961b076e680f088b2464ec9ad..5830066efd5c78508feda3864190052cb360fe05 100644 (file)
@@ -147,6 +147,9 @@ struct _ObClient
     Rect pre_max_area;
     /*! Position and size of the window prior to being fullscreened */
     Rect pre_fullscreen_area;
+    /*! Remember if the window was maximized before going fullscreen */
+    gboolean pre_fullscreen_max_horz,
+             pre_fullscreen_max_vert;
 
     /*! The window's strut
       The strut defines areas of the screen that are marked off-bounds for
This page took 0.02772 seconds and 4 git commands to generate.