[gnome-control-center/benzea/arrangement-snapping: 9/9] display: Correctly add minor axis to snapping



commit 8808b0259bfedf55cd855679bfe9b291d152ae7d
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Oct 1 11:48:02 2018 +0200

    display: Correctly add minor axis to snapping
    
    There was an issue where the "minor" axis snapping would not be done if
    the "major" axis snapping had a zero distance. This could be seen when e.g.
    moving a monitor on the right up/down slightly. In that case, no
    snapping to align the bottom/top edges were done unless you also moved
    the mouse sideways a bit.
    
    Fixes #211

 panels/display/cc-display-arrangement.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/panels/display/cc-display-arrangement.c b/panels/display/cc-display-arrangement.c
index d4a96c5df..943c156e2 100644
--- a/panels/display/cc-display-arrangement.c
+++ b/panels/display/cc-display-arrangement.c
@@ -279,6 +279,13 @@ maybe_update_snap (CcDisplayArrangement *self,
         {
           update_snap = SNAP_DIR_BOTH;
         }
+
+      /* Also allow a minor axis to be added if the first axis remains identical. */
+      if (((snap_data->snapped == SNAP_DIR_X) && (major_axis == SNAP_DIR_X) && (new_x == snap_data->mon_x)) 
||
+          ((snap_data->snapped == SNAP_DIR_Y) && (major_axis == SNAP_DIR_Y) && (new_y == snap_data->mon_y)))
+        {
+          update_snap = SNAP_DIR_BOTH;
+        }
     }
   else if (snapped == SNAP_DIR_X)
     {


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