macos: Let host determine window sizes

Clean up lastUnfullscreenFrame attribute, as we do not really
need it. The application knows what to resize to.
This commit is contained in:
Arjan Molenaar
2024-02-18 16:19:07 +01:00
parent 60ddf7c421
commit 3f8f6f6792
3 changed files with 2 additions and 22 deletions

View File

@@ -715,26 +715,16 @@ typedef NSString *CALayerContentsGravity;
-(void)setStyleMask:(NSWindowStyleMask)styleMask
{
gboolean was_fullscreen;
gboolean is_fullscreen;
gboolean was_opaque;
gboolean is_opaque;
was_fullscreen = (([self styleMask] & NSWindowStyleMaskFullScreen) != 0);
was_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
[super setStyleMask:styleMask];
is_fullscreen = (([self styleMask] & NSWindowStyleMaskFullScreen) != 0);
is_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
if (was_fullscreen != is_fullscreen)
{
if (was_fullscreen)
[self setFrame:lastUnfullscreenFrame display:NO];
_gdk_macos_surface_update_fullscreen_state (gdk_surface);
}
_gdk_macos_surface_update_fullscreen_state (gdk_surface);
if (was_opaque != is_opaque)
{
@@ -777,7 +767,6 @@ typedef NSString *CALayerContentsGravity;
-(void)windowWillEnterFullScreen:(NSNotification *)aNotification
{
inFullscreenTransition = YES;
lastUnfullscreenFrame = [self frame];
}
-(void)windowDidEnterFullScreen:(NSNotification *)aNotification

View File

@@ -49,7 +49,6 @@
EdgeSnapping snapping;
NSRect lastUnfullscreenFrame;
BOOL inFullscreenTransition;
}

View File

@@ -56,14 +56,6 @@ enum {
static GParamSpec *properties [LAST_PROP];
static gboolean
window_is_fullscreen (GdkMacosSurface *self)
{
g_assert (GDK_IS_MACOS_SURFACE (self));
return ([self->window styleMask] & NSWindowStyleMaskFullScreen) != 0;
}
void
_gdk_macos_surface_request_frame (GdkMacosSurface *self)
{
@@ -758,7 +750,7 @@ _gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
state = GDK_SURFACE (self)->state;
is_fullscreen = window_is_fullscreen (self);
is_fullscreen = ([self->window styleMask] & NSWindowStyleMaskFullScreen) != 0;
was_fullscreen = (state & GDK_TOPLEVEL_STATE_FULLSCREEN) != 0;
if (is_fullscreen != was_fullscreen)