From 57ec71234b2e1d9cb8b2f86d670d645c0363fe0f Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Tue, 5 Dec 2023 19:25:45 +0100 Subject: [PATCH] Really fix top of fullscreen window being cut off in GNOME See 4df6e5c6cd019170627d23e224ec8dd93ed27d8f --- src/sdl/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdl/window.cpp b/src/sdl/window.cpp index 1eb0c236..8c4fb3e4 100644 --- a/src/sdl/window.cpp +++ b/src/sdl/window.cpp @@ -98,6 +98,9 @@ Window::Window(const std::string& title, int width, int height, const bool fulls } } +#ifndef __linux__ // This code was written for UWP, Emscripten and macOS (annoying HiDPI scaling by + // SDL2). On Linux (GNOME) it results in the top of the window being cut off (by + // the header bar height?). { assert(width_ == width); assert(height_ == height); @@ -122,6 +125,7 @@ Window::Window(const std::string& title, int width, int height, const bool fulls } SDL_GL_GetDrawableSize(impl->sdlWindow, &width_, &height_); +#endif impl->actualWidth = width_; impl->actualHeight = height_; impl->hidpiScaleFactor = static_cast(width_) / width;