[gtk/wip/chergert/for-main] macos: request layout with server-side decoration
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/for-main] macos: request layout with server-side decoration
- Date: Fri, 11 Mar 2022 07:56:49 +0000 (UTC)
commit 021a3dc791923222456bafab2c24578f1c70623d
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 10 23:16:38 2022 -0800
macos: request layout with server-side decoration
If we have server-side decorations we might need to request a layout in
response to the resize notification. We don't need to do this in other
cases because we already handle that in the process of doing the resize
(and that code is that way because of delayed delivery of NSNotification).
gdk/macos/GdkMacosWindow.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c
index f565814106..d2d69f8b3e 100644
--- a/gdk/macos/GdkMacosWindow.c
+++ b/gdk/macos/GdkMacosWindow.c
@@ -376,8 +376,15 @@ typedef NSString *CALayerContentsGravity;
-(void)windowDidResize:(NSNotification *)notification
{
- _gdk_macos_surface_configure ([self gdkSurface]);
- gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
+ _gdk_macos_surface_configure (gdk_surface);
+
+ /* If we're using server-side decorations, this notification is coming
+ * in from a display-side change. We need to request a layout in
+ * addition to the configure event.
+ */
+ if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) &&
+ GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated)
+ gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
}
/* Used by gdkmacosdisplay-translate.c to decide if our sendEvent() handler
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]