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;
|
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(
|
@ConfigItem(
|
||||||
keyName = "notificationTray",
|
keyName = "notificationTray",
|
||||||
name = "Enable tray notifications",
|
name = "Enable tray notifications",
|
||||||
|
|||||||
@@ -62,15 +62,14 @@ import net.runelite.api.events.ConfigChanged;
|
|||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
import net.runelite.client.RuneLiteProperties;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.config.ExpandResizeType;
|
|
||||||
import net.runelite.client.config.RuneLiteConfig;
|
import net.runelite.client.config.RuneLiteConfig;
|
||||||
import net.runelite.client.events.ClientUILoaded;
|
import net.runelite.client.events.ClientUILoaded;
|
||||||
import net.runelite.client.events.PluginToolbarButtonAdded;
|
import net.runelite.client.events.PluginToolbarButtonAdded;
|
||||||
import net.runelite.client.events.PluginToolbarButtonRemoved;
|
import net.runelite.client.events.PluginToolbarButtonRemoved;
|
||||||
import net.runelite.client.events.TitleToolbarButtonAdded;
|
import net.runelite.client.events.TitleToolbarButtonAdded;
|
||||||
import net.runelite.client.events.TitleToolbarButtonRemoved;
|
import net.runelite.client.events.TitleToolbarButtonRemoved;
|
||||||
import net.runelite.client.input.KeyManager;
|
|
||||||
import net.runelite.client.ui.skin.SubstanceRuneLiteLookAndFeel;
|
import net.runelite.client.ui.skin.SubstanceRuneLiteLookAndFeel;
|
||||||
|
import net.runelite.client.input.KeyManager;
|
||||||
import net.runelite.client.util.OSType;
|
import net.runelite.client.util.OSType;
|
||||||
import net.runelite.client.util.OSXUtil;
|
import net.runelite.client.util.OSXUtil;
|
||||||
import net.runelite.client.util.SwingUtil;
|
import net.runelite.client.util.SwingUtil;
|
||||||
@@ -162,8 +161,7 @@ public class ClientUI
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged event)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
// Ignore all window related settings in fullscreen
|
if (!event.getGroup().equals("runelite"))
|
||||||
if (!event.getGroup().equals("runelite") || config.enableFullscreen())
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -368,7 +366,6 @@ public class ClientUI
|
|||||||
SwingUtil.addGracefulExitCallback(frame,
|
SwingUtil.addGracefulExitCallback(frame,
|
||||||
() ->
|
() ->
|
||||||
{
|
{
|
||||||
frame.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
|
|
||||||
saveClientBoundsConfig();
|
saveClientBoundsConfig();
|
||||||
runelite.shutdown();
|
runelite.shutdown();
|
||||||
},
|
},
|
||||||
@@ -408,11 +405,13 @@ public class ClientUI
|
|||||||
*/
|
*/
|
||||||
public void show() throws Exception
|
public void show() throws Exception
|
||||||
{
|
{
|
||||||
|
final boolean withTitleBar = config.enableCustomChrome();
|
||||||
|
|
||||||
SwingUtilities.invokeAndWait(() ->
|
SwingUtilities.invokeAndWait(() ->
|
||||||
{
|
{
|
||||||
frame.setUndecorated(config.enableCustomChrome() || config.enableFullscreen());
|
frame.setUndecorated(withTitleBar);
|
||||||
|
|
||||||
if (config.enableCustomChrome() && !config.enableFullscreen())
|
if (withTitleBar)
|
||||||
{
|
{
|
||||||
frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
|
frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
|
||||||
|
|
||||||
@@ -528,15 +527,6 @@ public class ClientUI
|
|||||||
|
|
||||||
titleToolbar.addComponent(sidebarNavigationButton, sidebarNavigationJButton);
|
titleToolbar.addComponent(sidebarNavigationButton, sidebarNavigationJButton);
|
||||||
toggleSidebar();
|
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());
|
eventBus.post(new ClientUILoaded());
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ package net.runelite.client.util;
|
|||||||
|
|
||||||
import com.apple.eawt.Application;
|
import com.apple.eawt.Application;
|
||||||
import com.apple.eawt.FullScreenUtilities;
|
import com.apple.eawt.FullScreenUtilities;
|
||||||
import java.awt.Window;
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@@ -62,20 +61,4 @@ public class OSXUtil
|
|||||||
log.debug("Requested focus on macOS");
|
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