Merge branch 'wip/chergert/macos-fix-fullscreen' into 'main'

macos: allow windows to enter fullscreen

See merge request GNOME/gtk!4494
This commit is contained in:
Matthias Clasen 2022-02-22 19:36:20 +00:00
commit e9ffe8f212
2 changed files with 19 additions and 0 deletions

View File

@ -746,12 +746,28 @@ typedef NSString *CALayerContentsGravity;
lastUnfullscreenFrame = [self frame];
}
-(void)windowDidEnterFullScreen:(NSNotification *)aNotification
{
initialPositionKnown = NO;
[self checkSendEnterNotify];
}
-(void)windowWillExitFullScreen:(NSNotification *)aNotification
{
[self setFrame:lastUnfullscreenFrame display:YES];
}
-(void)windowDidExitFullScreen:(NSNotification *)aNotification
{
initialPositionKnown = NO;
[self checkSendEnterNotify];
}
-(void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
{
}
-(void)windowDidFailToExitFullScreen:(NSNotification *)aNotification
{
}

View File

@ -690,6 +690,9 @@ _gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
defer:NO
screen:screen];
/* Allow NSWindow to go fullscreen */
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
self = g_object_new (GDK_TYPE_MACOS_TOPLEVEL_SURFACE,
"display", display,
"frame-clock", frame_clock,