diff options
Diffstat (limited to 'src/core/window.c')
-rw-r--r-- | src/core/window.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/window.c b/src/core/window.c index ed67aa235..a57f59b29 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3004,7 +3004,8 @@ meta_window_tile (MetaWindow *window, meta_window_move_resize_internal (window, (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | - META_MOVE_RESIZE_STATE_CHANGED), + META_MOVE_RESIZE_STATE_CHANGED | + META_MOVE_RESIZE_USER_ACTION), NorthWestGravity, new_rect); @@ -3733,6 +3734,18 @@ meta_window_update_monitor (MetaWindow *window, } } +static void +meta_window_update_screen_ratio (MetaWindow *window, + MetaRectangle rect) +{ + MetaRectangle workarea; + + meta_window_get_work_area_current_monitor (window, &workarea); + + window->hpercentage = rect.width / (gdouble) workarea.width; + window->vpercentage = rect.height / (gdouble) workarea.height; +} + void meta_window_move_resize_internal (MetaWindow *window, MetaMoveResizeFlags flags, @@ -3811,6 +3824,10 @@ meta_window_move_resize_internal (MetaWindow *window, else g_assert_not_reached (); + /* Only update percentage when the user resizes the window */ + if ((flags & META_MOVE_RESIZE_USER_ACTION) && (flags & META_MOVE_RESIZE_RESIZE_ACTION)) + meta_window_update_screen_ratio (window, unconstrained_rect); + constrained_rect = unconstrained_rect; if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION) && window->monitor) |