Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion runtime/include/window_fullscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ static inline int psx_window_fullscreen_set(SDL_Window* window,
SDL_SetWindowBordered(window, SDL_FALSE);
SDL_SetWindowResizable(window, SDL_FALSE);
SDL_SetWindowPosition(window, desktop.x, desktop.y);
SDL_SetWindowSize(window, desktop.w, desktop.h);
/* One row taller than the display: a window exactly covering it is
* promoted by Windows to a direct/independent flip, and OpenGL swaps
* from the render thread then stop reaching the screen (NVIDIA: the
* image freezes while the game runs; any overlay -- taskbar, another
* window -- forces composition and the frames reappear). The extra
* row is off-screen; the window stays composed. */
SDL_SetWindowSize(window, desktop.w, desktop.h + 1);
SDL_SyncWindow(window);
#elif defined(PSX_SDL3)
if (!SDL_SetWindowFullscreen(window, true)) return -1;
Expand Down
3 changes: 2 additions & 1 deletion runtime/tests/test_window_fullscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ int main() {
SDL_Rect bounds{};
SDL_GetDisplayBounds(SDL_GetDisplayForWindow(window), &bounds);
int full_w, full_h; SDL_GetWindowSize(window, &full_w, &full_h);
check(full_w == bounds.w && full_h == bounds.h, "borderless covers the current display");
check(full_w == bounds.w && full_h == bounds.h + 1,
"borderless covers the current display (one row over: stays composed)");
check(!SDL_CursorVisible(), "fullscreen cursor hidden");
SDL_DisplayMode current{};
check(SDL_GetCurrentDisplayMode(original_display, &current) == 0 &&
Expand Down
Loading