Prevent window self-maximisation

https://bugzilla.gnome.org/show_bug.cgi?id=461927
This commit is contained in:
Peter Bloomfield
2010-01-20 10:59:07 -05:00
committed by Owen W. Taylor
parent 11e01ec074
commit c6793d477a
4 changed files with 35 additions and 11 deletions

View File

@@ -723,6 +723,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->maximize_vertically_after_placement = FALSE;
window->minimize_after_placement = FALSE;
window->fullscreen = FALSE;
window->fullscreen_after_placement = FALSE;
window->fullscreen_monitors[0] = -1;
window->require_fully_onscreen = TRUE;
window->require_on_single_monitor = TRUE;
@@ -746,6 +747,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
meta_topic (META_DEBUG_PLACEMENT,
"Not placing window 0x%lx since it's already mapped\n",
xwindow);
window->force_save_user_rect = TRUE;
window->denied_focus_and_not_transient = FALSE;
window->unmanaging = FALSE;
window->is_in_queues = 0;
@@ -3008,6 +3010,8 @@ meta_window_maximize_internal (MetaWindow *window,
window->maximized_horizontally || maximize_horizontally;
window->maximized_vertically =
window->maximized_vertically || maximize_vertically;
if (maximize_horizontally || maximize_vertically)
window->force_save_user_rect = FALSE;
/* Fix for #336850: If the frame shape isn't reapplied, it is
* possible that the frame will retains its rounded corners. That
@@ -3187,6 +3191,10 @@ meta_window_unmaximize (MetaWindow *window,
window->display->grab_anchor_window_pos = target_rect;
}
/* Make sure user_rect is current.
*/
force_save_user_window_placement (window);
if (window->display->compositor)
{
MetaRectangle old_rect, new_rect;
@@ -3264,6 +3272,7 @@ meta_window_make_fullscreen_internal (MetaWindow *window)
meta_window_save_rect (window);
window->fullscreen = TRUE;
window->force_save_user_rect = FALSE;
meta_stack_freeze (window->screen->stack);
meta_window_update_layer (window);
@@ -3319,6 +3328,10 @@ meta_window_unmake_fullscreen (MetaWindow *window)
target_rect.width,
target_rect.height);
/* Make sure user_rect is current.
*/
force_save_user_window_placement (window);
meta_window_update_layer (window);
recalc_window_features (window);
@@ -4133,7 +4146,7 @@ meta_window_move_resize_internal (MetaWindow *window,
if (need_configure_notify)
send_configure_notify (window);
if (!window->placed)
if (!window->placed && window->force_save_user_rect && !window->fullscreen)
force_save_user_window_placement (window);
else if (is_user_action)
save_user_window_placement (window);