From ed3b02b460d3a422d644fe49badf2db7743bbb72 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Jun 2018 20:21:47 -0400 Subject: [PATCH] Revert "Merge pull request #3192 from deathbeam/add-support-for-fullscreen" This reverts commit 108f441f233db3bc3f774a46d2895052e23c6b30, reversing changes made to be34e6f7ba60e1ed3e461b4e6f666137c59be681. --- .../client/config/RuneLiteConfig.java | 12 ---------- .../java/net/runelite/client/ui/ClientUI.java | 22 +++++-------------- .../net/runelite/client/util/OSXUtil.java | 17 -------------- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index b1ee0f4c59..d582ad81d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -112,18 +112,6 @@ public interface RuneLiteConfig extends Config return false; } - @ConfigItem( - keyName = "fullscreen", - name = "Fullscreen mode", - description = "Switch window to fullscreen mode.", - warning = "Please restart your client after changing this setting", - position = 17 - ) - default boolean enableFullscreen() - { - return false; - } - @ConfigItem( keyName = "notificationTray", name = "Enable tray notifications", diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index b0e49d65d3..61f5a21755 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -62,15 +62,14 @@ import net.runelite.api.events.ConfigChanged; import net.runelite.client.RuneLite; import net.runelite.client.RuneLiteProperties; import net.runelite.client.config.ConfigManager; -import net.runelite.client.config.ExpandResizeType; import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.events.ClientUILoaded; import net.runelite.client.events.PluginToolbarButtonAdded; import net.runelite.client.events.PluginToolbarButtonRemoved; import net.runelite.client.events.TitleToolbarButtonAdded; import net.runelite.client.events.TitleToolbarButtonRemoved; -import net.runelite.client.input.KeyManager; import net.runelite.client.ui.skin.SubstanceRuneLiteLookAndFeel; +import net.runelite.client.input.KeyManager; import net.runelite.client.util.OSType; import net.runelite.client.util.OSXUtil; import net.runelite.client.util.SwingUtil; @@ -162,8 +161,7 @@ public class ClientUI @Subscribe public void onConfigChanged(ConfigChanged event) { - // Ignore all window related settings in fullscreen - if (!event.getGroup().equals("runelite") || config.enableFullscreen()) + if (!event.getGroup().equals("runelite")) { return; } @@ -368,7 +366,6 @@ public class ClientUI SwingUtil.addGracefulExitCallback(frame, () -> { - frame.getGraphicsConfiguration().getDevice().setFullScreenWindow(null); saveClientBoundsConfig(); runelite.shutdown(); }, @@ -408,11 +405,13 @@ public class ClientUI */ public void show() throws Exception { + final boolean withTitleBar = config.enableCustomChrome(); + SwingUtilities.invokeAndWait(() -> { - frame.setUndecorated(config.enableCustomChrome() || config.enableFullscreen()); + frame.setUndecorated(withTitleBar); - if (config.enableCustomChrome() && !config.enableFullscreen()) + if (withTitleBar) { frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME); @@ -528,15 +527,6 @@ public class ClientUI titleToolbar.addComponent(sidebarNavigationButton, sidebarNavigationJButton); toggleSidebar(); - - // Force fullscreen - if (config.enableFullscreen() && !OSXUtil.toggleFullscreen(frame)) - { - frame.setExpandResizeType(ExpandResizeType.KEEP_WINDOW_SIZE); - frame.setResizable(false); - frame.getGraphicsConfiguration().getDevice().setFullScreenWindow(frame); - frame.setIgnoreRepaint(true); - } }); eventBus.post(new ClientUILoaded()); diff --git a/runelite-client/src/main/java/net/runelite/client/util/OSXUtil.java b/runelite-client/src/main/java/net/runelite/client/util/OSXUtil.java index dc776f8492..f521349b94 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/OSXUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/OSXUtil.java @@ -26,7 +26,6 @@ package net.runelite.client.util; import com.apple.eawt.Application; import com.apple.eawt.FullScreenUtilities; -import java.awt.Window; import javax.swing.JFrame; import lombok.extern.slf4j.Slf4j; @@ -62,20 +61,4 @@ public class OSXUtil log.debug("Requested focus on macOS"); } } - - /** - * Requests the fullscreen in a macOS friendly way - */ - public static boolean toggleFullscreen(final Window window) - { - if (OSType.getOSType() == OSType.MacOS) - { - Application app = Application.getApplication(); - app.requestToggleFullScreen(window); - log.debug("Requested fullscreen on macOS"); - return true; - } - - return false; - } }