[macos] Use FullSizeContent for CSD

This commit is contained in:
Paul Rouget 2022-11-04 16:22:06 +01:00 committed by Arjan Molenaar
parent 9b9e8b385e
commit a6ce506714
2 changed files with 24 additions and 8 deletions

View File

@ -398,8 +398,7 @@ typedef NSString *CALayerContentsGravity;
* in from a display-side change. We need to request a layout in * in from a display-side change. We need to request a layout in
* addition to the configure event. * addition to the configure event.
*/ */
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) && if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface))
GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated)
gdk_surface_request_layout (GDK_SURFACE (gdk_surface)); gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
} }
@ -875,12 +874,21 @@ typedef NSString *CALayerContentsGravity;
{ {
NSWindowStyleMask style_mask = [self styleMask]; NSWindowStyleMask style_mask = [self styleMask];
[self setHasShadow:decorated];
if (decorated) if (decorated)
style_mask |= NSWindowStyleMaskTitled; {
style_mask &= ~NSWindowStyleMaskFullSizeContentView;
[self setTitleVisibility:NSWindowTitleVisible];
}
else else
style_mask &= ~NSWindowStyleMaskTitled; {
style_mask |= NSWindowStyleMaskFullSizeContentView;
[self setTitleVisibility:NSWindowTitleHidden];
}
[self setTitlebarAppearsTransparent:!decorated];
[[self standardWindowButton:NSWindowCloseButton] setHidden:!decorated];
[[self standardWindowButton:NSWindowMiniaturizeButton] setHidden:!decorated];
[[self standardWindowButton:NSWindowZoomButton] setHidden:!decorated];
[self setStyleMask:style_mask]; [self setStyleMask:style_mask];
} }

View File

@ -2972,6 +2972,10 @@ gtk_window_supports_client_shadow (GtkWindow *window)
} }
#endif #endif
#ifdef GDK_WINDOWING_MACOS
return FALSE;
#endif
return TRUE; return TRUE;
} }
@ -2983,9 +2987,13 @@ gtk_window_enable_csd (GtkWindow *window)
/* We need a visual with alpha for client shadows */ /* We need a visual with alpha for client shadows */
if (priv->use_client_shadow) if (priv->use_client_shadow)
gtk_widget_add_css_class (widget, "csd"); {
gtk_widget_add_css_class (widget, "csd");
}
else else
gtk_widget_add_css_class (widget, "solid-csd"); {
/* gtk_widget_add_css_class (widget, "solid-csd"); */
}
priv->client_decorated = TRUE; priv->client_decorated = TRUE;
} }