Skip to content

[rcore][GLFW] Fix ToggleBorderlessWindowed() entering exclusive fullscreen instead of windowed - #6026

Open
tillua467 wants to merge 2 commits into
raysan5:masterfrom
tillua467:master
Open

[rcore][GLFW] Fix ToggleBorderlessWindowed() entering exclusive fullscreen instead of windowed#6026
tillua467 wants to merge 2 commits into
raysan5:masterfrom
tillua467:master

Conversation

@tillua467

Copy link
Copy Markdown

Fixes #5854

glfwSetWindowMonitor() was called with a non NULL monitor handle when entering borderless windowed mode. Per GLFW's documented behavior, a non NULL monitor negotiates exclusive fullscreen, which is the same call ToggleFullscreen() makes not what borderless windowed is supposed to do. The windowed restore branch of this same function already calls glfwSetWindowMonitor() with NULL for this reason, this makes the enter branch consistent with it.

Checked on Windows 11 works as intended, although it's not a issue in linux i did checked on debian gnome and wslg, no issue there as well.

…lscreen instead of windowed

ToggleBorderlessWindowed() passes monitors[monitor] as the monitor argument.
but passing a non-NULL monitor here is what puts a window into full screen mode that's the exact same call ToggleFullscreen() makes,
Since borderless windowed is supposed to stay in windowed mode, this should be NULL instead

Signed-off-by: tillua467 <tillua467@gmail.com>
@raysan5 raysan5 added the windowing Issues about the window system label Jul 29, 2026
@raysan5

raysan5 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

@tillua467 thanks for the review, all windowing reviews are very sensitive and platform dependant. Could you test on macOS? Did you test it with multiple monitors?

@raysan5 raysan5 changed the title [rcore][GLFW] Fix ToggleBorderlessWindowed() entering exclusive fullscreen instead of windowed [rcore][GLFW] Fix ToggleBorderlessWindowed() entering exclusive fullscreen instead of windowed Jul 29, 2026
@tillua467

Copy link
Copy Markdown
Author

@raysan5 hello thanks for looking at my pr! i did tested on multiple monitors and tested and it works fine! the windows did minimize at the monitor it was opened, and also sadly i don't own a mac device so i can't really test that sorry

…itor()`

the glfw documentation clearly says
  - When the monitor is NULL, the position, width and height are used to place the window content area. The refresh rate is ignored when no monitor is specified.
so it' useless to pass a refreshrate, not to mention we are already doing it in https://github.com/raysan5/raylib/blob/63f82f0ca873f762ffea0c83ed14e461a905b7fc/src/platforms/rcore_desktop_glfw.c#L241

Signed-off-by: tillua467 <tillua467@gmail.com>
@tillua467

tillua467 commented Jul 29, 2026

Copy link
Copy Markdown
Author

@raysan5 i found a weird bug after my commit, it seems when the window is minimized it doesn't minimized to the original, i happens because we call glfwSetWindowAttrib() and it changes CORE.Window.screen i am not sure why but here is my way of fixing it:
tillua467@6727062

Haven't tested it in my Debian I will test tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

windowing Issues about the window system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rcore] Unable to alt-tab/switch windows when fullscreen or borderless-windowed modes are enabled

2 participants