[mutter/wip/gbsneto/edge-constraints: 2/6] constraints: Add percentage constraint



commit 3af8df690ec7f90790e36505f545284e5a450f21
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Aug 18 21:27:35 2017 -0300

    constraints: Add percentage constraint
    
    In the past, the tiling constraint was used to enforce
    that windows would have 50% of the workarea, even when
    the monitor changes.
    
    Now that windows can be resized when tiled, this aspect
    of the tiling constraint was lost. Its purpose, now, is
    to keep the tiled windows in the position we expect them
    to be, but now, tiled windows have a slightly mistuned
    behavior when changing monitors: they keep their widths,
    not the percentage of window covered.
    
    Fix that by adding a new percentage constraint. This new
    constraint enforces that, when windows are tiled, they
    keep the same percentage of the screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645153

 src/core/window.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 440c335..0e5feb0 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3784,6 +3784,8 @@ meta_window_move_resize_internal (MetaWindow          *window,
     {
       /* We're both moving and resizing. Just use the passed in rect. */
       unconstrained_rect = frame_rect;
+
+      meta_window_update_percentage (window, unconstrained_rect);
     }
   else if ((flags & META_MOVE_RESIZE_RESIZE_ACTION))
     {
@@ -3795,6 +3797,8 @@ meta_window_move_resize_internal (MetaWindow          *window,
                                           gravity,
                                           frame_rect.width,
                                           frame_rect.height);
+
+      meta_window_update_percentage (window, unconstrained_rect);
     }
   else if ((flags & META_MOVE_RESIZE_MOVE_ACTION))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]