diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.h b/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.h deleted file mode 100644 index 9e2c51c4116..00000000000 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#import -#import - -@interface GlassFullscreenWindow : NSWindow -{ - NSPoint point; -} - -- (id)initWithContentRect:(NSRect)contentRect withHostView:(NSView *)hostView withView:(NSView *)view withScreen:(NSScreen *)screen withPoint:(NSPoint)point; -- (NSPoint)point; - -@end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.m deleted file mode 100644 index dcfa471502b..00000000000 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassFullscreenWindow.m +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#import "GlassFullscreenWindow.h" - -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -@implementation GlassFullscreenWindow : NSWindow - -- (id)initWithContentRect:(NSRect)contentRect withHostView:(NSView *)hostView withView:(NSView *)view withScreen:(NSScreen *)screen withPoint:(NSPoint)p -{ - self = [super initWithContentRect:contentRect styleMask:(NSBorderlessWindowMask|NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO screen:screen]; - if (self != nil) - { - self->point = p; - - [self useOptimizedDrawing:NO]; - [self setContentView:hostView]; - [self setInitialFirstResponder:view]; - [self makeFirstResponder:view]; - [self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; - - [self setBackgroundColor:[NSColor colorWithCalibratedRed:0.0f green:0.0f blue:0.0f alpha:0.0f]]; - - [hostView release]; - } - return self; -} - -- (void)dealloc -{ - [super dealloc]; -} - -- (BOOL)isReleasedWhenClosed -{ - return YES; -} - -- (BOOL)isOpaque -{ - return NO; -} - -- (BOOL)hasShadow -{ - return NO; -} - -- (BOOL)canBecomeMainWindow -{ - return YES; -} - -- (BOOL)canBecomeKeyWindow -{ - return YES; -} - -- (NSPoint)point -{ - return self->point; -} - -@end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassView.h b/modules/javafx.graphics/src/main/native-glass/mac/GlassView.h index fd1b472f5d2..8d27823419f 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassView.h +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassView.h @@ -27,7 +27,6 @@ #import #import "GlassHostView.h" -#import "GlassFullscreenWindow.h" #import "GlassViewDelegate.h" // main GlassView protocol diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m index 0d2f98185c8..da0fa9f396d 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m @@ -467,10 +467,6 @@ - (BOOL)performKeyEquivalent:(NSEvent *)theEvent { KEYLOG("performKeyEquivalent"); - // Crash if the FS window is released while performing a key equivalent - // Local copy of the id keeps the retain/release calls balanced. - id fsWindow = [self->_delegate->fullscreenWindow retain]; - // RT-37093, RT-37399 Command-EQUALS and Command-DOT needs special casing on Mac // as it is passed through as two calls to performKeyEquivalent, which in turn // create extra KeyEvents. @@ -500,13 +496,11 @@ - (BOOL)performKeyEquivalent:(NSEvent *)theEvent (*env)->DeleteLocalRef(env, jKeyChars); GLASS_CHECK_EXCEPTION(env); - [fsWindow release]; return YES; } } BOOL result = [self handleKeyDown: theEvent]; - [fsWindow release]; return result; } diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.h b/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.h index e8cbfc2be57..7c3f2248f90 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.h +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.h @@ -27,7 +27,6 @@ #import #import "GlassHostView.h" -#import "GlassFullscreenWindow.h" #import "GlassDragSource.h" #import "GlassDraggingSource.h" #import "GlassAccessible.h" @@ -69,8 +68,6 @@ typedef enum GestureMaskType { @public jobject jView; - // not nil when we create a new FS window ourselves - GlassFullscreenWindow *fullscreenWindow; } - (id)initWithView:(NSView*)view withJview:(jobject)jview; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m index 1b84e04fdba..559020ab6e6 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m @@ -195,9 +195,6 @@ - (void)dealloc [self->parentWindow release]; self->parentWindow = nil; - [self->fullscreenWindow release]; - self->fullscreenWindow = nil; - [self->nativeFullScreenModeWindow release]; self->nativeFullScreenModeWindow = nil; @@ -1282,40 +1279,6 @@ - (void)exitFullscreenWithAnimate:(BOOL)animate [GlassApplication enterFullScreenExitingLoop]; return; } - - [self->fullscreenWindow toggleFullScreen:self->fullscreenWindow]; - - NSRect frame = [self->parentHost bounds]; - frame.origin = [self->fullscreenWindow point]; - [self->fullscreenWindow setFrame:frame display:YES animate:animate]; - - [self->fullscreenWindow disableFlushWindow]; - { - [self->nsView retain]; - { - [self->nsView removeFromSuperviewWithoutNeedingDisplay]; - [self->parentHost addSubview:self->nsView]; - } - [self->nsView release]; - - [self->parentWindow setInitialFirstResponder:self->nsView]; - [self->parentWindow makeFirstResponder:self->nsView]; - - if ([[self->parentWindow delegate] isKindOfClass:[GlassWindow class]]) - { - GlassWindow *window = (GlassWindow*)[self->parentWindow delegate]; - [window setFullscreenWindow: nil]; - } - } - [self->fullscreenWindow enableFlushWindow]; - [self->parentWindow enableFlushWindow]; - - [self->fullscreenWindow orderOut:nil]; - [self->fullscreenWindow close]; - self->fullscreenWindow = nil; - - // It was retained upon entering the FS mode - [self->nsView release]; } @catch (NSException *e) { diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.h b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.h index 15e4337e9b6..98c3908ad41 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.h +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.h @@ -36,7 +36,6 @@ - (void)_sendJavaWindowNotifyScaleChanged:(CGFloat)newScale; - (id)_initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle screen:(NSScreen *)screen jwindow:(jobject)jwindow; -- (NSWindow*)_getCurrentWindow; - (void)_ungrabFocus; + (void)_resetGrab; - (void)_checkUngrab; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.m index a8398a7d3d3..482d27da57e 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.m @@ -160,14 +160,9 @@ - (id)_initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle return self; } -- (NSWindow*)_getCurrentWindow -{ - return self->fullscreenWindow ? self->fullscreenWindow : self->nsWindow; -} - - (void)_ungrabFocus { - NSWindow *window = [self _getCurrentWindow]; + NSWindow *window = self->nsWindow; if (s_grabWindow != window) { return; @@ -207,7 +202,7 @@ - (void)_checkUngrab - (void)_grabFocus { - NSWindow *window = [self _getCurrentWindow]; + NSWindow *window = self->nsWindow; if (s_grabWindow == window) { return; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Overrides.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Overrides.m index 982a5b295da..8737e791ebd 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Overrides.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Overrides.m @@ -62,11 +62,6 @@ - (void)dealloc - (void)windowDidBecomeKey:(NSNotification *)notification { - if (self->fullscreenWindow) - { - return; - } - GET_MAIN_JENV; if (!self->isEnabled) { @@ -86,11 +81,6 @@ - (void)windowDidBecomeKey:(NSNotification *)notification - (void)windowDidResignKey:(NSNotification *)notification { - if (self->fullscreenWindow) - { - return; - } - [self _ungrabFocus]; GET_MAIN_JENV_NOWARN; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.h b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.h index 9580e4707a3..4c90a481a10 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.h +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.h @@ -43,7 +43,6 @@ NSScreen *currentScreen; GlassMenubar *menubar; NSRect preZoomedRect; - NSWindow *fullscreenWindow; BOOL isFocusable; BOOL isEnabled; @@ -68,8 +67,6 @@ BOOL isWindowResizable; } -- (void)setFullscreenWindow:(NSWindow *)fsWindow; - // NSWindow overrides delegate methods - (void)close; - (void)sendEvent:(NSEvent *)event; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m index a054ac12c69..af76c546565 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m @@ -291,35 +291,6 @@ - (id)accessibilityAttributeValue:(NSString *)attribute @implementation GlassWindow -- (void)setFullscreenWindow:(NSWindow*)fsWindow -{ - if (self->fullscreenWindow == fsWindow) { - return; - } - - [self _ungrabFocus]; - - NSWindow *from, *to; - from = self->fullscreenWindow ? self->fullscreenWindow : self->nsWindow; - to = fsWindow ? fsWindow : self->nsWindow; - - NSArray * children = [from childWindows]; - for (NSUInteger i=0; i<[children count]; i++) - { - NSWindow *child = (NSWindow*)[children objectAtIndex:i]; - if ([[child delegate] isKindOfClass: [GlassWindow class]]) { - [from removeChildWindow: child]; - [to addChildWindow:child ordered:NSWindowAbove]; - } - } - - self->fullscreenWindow = fsWindow; - - GET_MAIN_JENV; - (*env)->CallVoidMethod(env, self->jWindow, jWindowNotifyDelegatePtr, ptr_to_jlong(fsWindow)); - GLASS_CHECK_EXCEPTION(env); -} - - (void)close { [self _ungrabFocus]; @@ -503,8 +474,6 @@ static jlong _createWindowCommonDo(JNIEnv *env, jobject jWindow, jlong jOwnerPtr [window->nsWindow setOpaque:YES]; } - window->fullscreenWindow = nil; - window->isSizeAssigned = NO; window->isLocationAssigned = NO;