mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
new function, only saves rect after checking current state, #93795
2002-09-24 Havoc Pennington <hp@redhat.com> * src/window.c (meta_window_save_rect): new function, only saves rect after checking current state, #93795 (meta_window_make_fullscreen): use new function (meta_window_maximize): use new function
This commit is contained in:
parent
207eef305e
commit
49a9e74900
@ -1,3 +1,10 @@
|
||||
2002-09-24 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/window.c (meta_window_save_rect): new function,
|
||||
only saves rect after checking current state, #93795
|
||||
(meta_window_make_fullscreen): use new function
|
||||
(meta_window_maximize): use new function
|
||||
|
||||
2002-09-24 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/window.c (meta_window_update_layer): new function
|
||||
|
39
src/window.c
39
src/window.c
@ -104,6 +104,8 @@ static GList* meta_window_get_workspaces (MetaWindow *window);
|
||||
static gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
||||
MetaRectangle *rect);
|
||||
|
||||
static void meta_window_save_rect (MetaWindow *window);
|
||||
|
||||
static void adjust_for_gravity (MetaWindow *window,
|
||||
MetaFrameGeometry *fgeom,
|
||||
gboolean coords_assume_border,
|
||||
@ -1625,6 +1627,21 @@ meta_window_unminimize (MetaWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_save_rect (MetaWindow *window)
|
||||
{
|
||||
if (!(window->maximized || window->fullscreen))
|
||||
{
|
||||
/* save size/pos as appropriate args for move_resize */
|
||||
window->saved_rect = window->rect;
|
||||
if (window->frame)
|
||||
{
|
||||
window->saved_rect.x += window->frame->rect.x;
|
||||
window->saved_rect.y += window->frame->rect.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_maximize (MetaWindow *window)
|
||||
{
|
||||
@ -1635,19 +1652,13 @@ meta_window_maximize (MetaWindow *window)
|
||||
|
||||
if (window->shaded)
|
||||
meta_window_unshade (window);
|
||||
|
||||
meta_window_save_rect (window);
|
||||
|
||||
window->maximized = TRUE;
|
||||
|
||||
/* FIXME why did I put this here? */
|
||||
meta_window_raise (window);
|
||||
|
||||
/* save size/pos as appropriate args for move_resize */
|
||||
window->saved_rect = window->rect;
|
||||
if (window->frame)
|
||||
{
|
||||
window->saved_rect.x += window->frame->rect.x;
|
||||
window->saved_rect.y += window->frame->rect.y;
|
||||
}
|
||||
meta_window_raise (window);
|
||||
|
||||
/* move_resize with new maximization constraints
|
||||
*/
|
||||
@ -1689,6 +1700,8 @@ meta_window_make_fullscreen (MetaWindow *window)
|
||||
|
||||
if (window->shaded)
|
||||
meta_window_unshade (window);
|
||||
|
||||
meta_window_save_rect (window);
|
||||
|
||||
window->fullscreen = TRUE;
|
||||
|
||||
@ -1698,14 +1711,6 @@ meta_window_make_fullscreen (MetaWindow *window)
|
||||
meta_window_raise (window);
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
|
||||
/* save size/pos as appropriate args for move_resize */
|
||||
window->saved_rect = window->rect;
|
||||
if (window->frame)
|
||||
{
|
||||
window->saved_rect.x += window->frame->rect.x;
|
||||
window->saved_rect.y += window->frame->rect.y;
|
||||
}
|
||||
|
||||
/* move_resize with new constraints
|
||||
*/
|
||||
meta_window_queue_move_resize (window);
|
||||
|
Loading…
Reference in New Issue
Block a user