[gtk/wip/chergert/quartz4u: 82/116] macos: fix click through when CSD is used



commit f8e2111deea8295bb9fb1b33068c7ad8cd8391fb
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jun 1 16:05:06 2020 -0700

    macos: fix click through when CSD is used

 gdk/macos/gdkmacostoplevelsurface.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c
index bc5c398916..8407636774 100644
--- a/gdk/macos/gdkmacostoplevelsurface.c
+++ b/gdk/macos/gdkmacostoplevelsurface.c
@@ -114,7 +114,16 @@ _gdk_macos_toplevel_surface_present (GdkToplevel       *toplevel,
       geometry.min_height = gdk_toplevel_layout_get_min_height (layout);
       mask = GDK_HINT_MIN_SIZE;
 
-      style_mask |= NSWindowStyleMaskResizable;
+      /* Only set 'Resizable' mask to get native resize zones if the window is
+       * titled, otherwise we do this internally for CSD and do not need
+       * NSWindow to do it for us. Additionally, it can mess things up when
+       * doing a window resize since it can cause mouseDown to get passed
+       * through to the next window.
+       */
+      if ((style_mask & NSWindowStyleMaskTitled) != 0)
+        style_mask |= NSWindowStyleMaskResizable;
+      else
+        style_mask &= ~NSWindowStyleMaskResizable;
     }
   else
     {


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