Revert "Merge pull request #3192 from deathbeam/add-support-for-fullscreen"
This reverts commit108f441f23, reversing changes made tobe34e6f7ba.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user