From: Dana Jansens Date: Fri, 15 Jan 2010 19:50:36 +0000 (-0500) Subject: Remember the maximized state of a window when it goes fullscreen and try restore... X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=d3ca5d5b4c36f6b3e5f64e5332e907471ee2196e;p=chaz%2Fopenbox Remember the maximized state of a window when it goes fullscreen and try restore it after --- diff --git a/openbox/client.c b/openbox/client.c index 6d934bd7..909112ea 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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; diff --git a/openbox/client.h b/openbox/client.h index 7370efcf..5830066e 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -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