[gtk/wip/chergert/quartz4u: 72/116] macos: check workarea top in final check for snapping



commit 61e1f9b2ff225fe2deba85a6f056b5f776899947
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 21 09:46:33 2020 -0700

    macos: check workarea top in final check for snapping
    
    This helps large surfaces (like from widget factory) do not let
    the CSD window fall underneath the top bar.
    
    We don't want them to end up there until we've dragged across
    monitors (which we will have a new geometry for anyway).

 gdk/macos/edgesnapping.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gdk/macos/edgesnapping.c b/gdk/macos/edgesnapping.c
index e81b29626c..bf9347265a 100644
--- a/gdk/macos/edgesnapping.c
+++ b/gdk/macos/edgesnapping.c
@@ -206,6 +206,12 @@ _edge_snapping_motion (EdgeSnapping   *self,
       new_window.y = pointer_position->y - self->pointer_offset_in_window.y;
     }
 
+  /* And finally make sure we aren't underneath the top bar of the
+   * particular monitor.
+   */
+  if (Y1 (&new_window) < Y1 (&self->workarea))
+    new_window.y = self->workarea.y;
+
   *window = new_window;
 }
 


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