Skip to content

Commit 15d0f40

Browse files
authored
Disable "borderless window fullscreen" support on Linux for now. (#1480)
* Disable "borderless window fullscreen" support on Linux for now. This has never quite worked properly; screen mode setting behaves inconsistently between X11 and Wayland sessions. * Remove inadvertently-added "using"
1 parent 71b5cbe commit 15d0f40

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

Client/Window.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ public void UpdateWindow()
284284
GLFW.SetWindowMonitor(WindowPtr, monitor, 0, 0, modePtr->Width, modePtr->Height, modePtr->RefreshRate);
285285
break;
286286
case RenderWindowState.BorderlessFullscreenWindow:
287+
if (OperatingSystem.IsLinux())
288+
{
289+
// Borderless fullscreen mode changes on linux are _really_ inconsistent, so let's just not do that for now.
290+
GLFW.SetWindowMonitor(WindowPtr, monitor, 0, 0, modePtr->Width, modePtr->Height, modePtr->RefreshRate);
291+
break;
292+
}
293+
287294
// Hide border before going fullscreen, otherwise taskbar gets stuck on Windows
288295
WindowBorder = WindowBorder.Hidden;
289296
WindowState = WindowState.Normal;
@@ -311,16 +318,6 @@ public void UpdateWindow()
311318
GLFW.RestoreWindow(WindowPtr);
312319
}
313320

314-
if (m_isLinuxX11 && oldWindowState == RenderWindowState.BorderlessFullscreenWindow)
315-
{
316-
// Note: There seems to be a weird bug here where if the application is started in borderless,
317-
// and then the user goes to Windowed _without ever moving their mouse_, the mouse cursor gets "stuck"
318-
// in a narrow range and cannot be moved.
319-
320-
// Need to quickly bounce through full-screen for...reasons?
321-
GLFW.SetWindowMonitor(WindowPtr, monitor, 0, 0, modePtr->Width, modePtr->Height, modePtr->RefreshRate);
322-
}
323-
324321
// Note: Wayland (at least on Gnome, Ubuntu 24.04) seems to ignore window decor settings.
325322
WindowBorder = m_config.Window.Border;
326323
GLFW.SetWindowMonitor(WindowPtr, null, windowX, windowY, (int)(windowDimension.Width / m_clientScaling.X), (int)(windowDimension.Height / m_clientScaling.Y), GLFW.DontCare);

Core/Util/Configs/Components/ConfigWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class ConfigWindow: ConfigElement<ConfigWindow>
7878
[OptionMenu(OptionSectionType.Video, "Render Mode")]
7979
public readonly ConfigValue<ConfigRenderMode> RenderMode = new(ConfigRenderMode.TrueColorFast);
8080

81-
[ConfigInfo("Display fullscreen or windowed.")]
81+
[ConfigInfo("Display fullscreen or windowed. Borderless Fullscreen is treated as Fullscreen on Linux.")]
8282
[OptionMenu(OptionSectionType.Video, "Fullscreen/Window", allowReset: false, spacer: true)]
8383
public readonly ConfigValue<RenderWindowState> State = new(RenderWindowState.Fullscreen, OnlyValidEnums<RenderWindowState>());
8484

0 commit comments

Comments
 (0)