Remember the maximized state of a window when it goes fullscreen and try restore it after

This commit is contained in:
Dana Jansens 2010-01-15 14:50:36 -05:00
parent 54e04a520b
commit d3ca5d5b4c
2 changed files with 17 additions and 0 deletions

View 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;

View 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