Skip to content

Commit

Permalink
Really fix top of fullscreen window being cut off in GNOME
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Dec 5, 2023
1 parent 932d19f commit 57ec712
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sdl/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<float>(width_) / width;
Expand Down

0 comments on commit 57ec712

Please sign in to comment.