diff --git a/util/linux/x11/X11Window.cpp b/util/linux/x11/X11Window.cpp index e7ee13a66..d76313628 100644 --- a/util/linux/x11/X11Window.cpp +++ b/util/linux/x11/X11Window.cpp @@ -361,6 +361,17 @@ bool X11Window::initializeImpl(const std::string &name, int width, int height) return false; } + // Set PMinSize and PMaxSize on XSizeHints so windows larger than the screen do not get adjusted + // to screen size + XSizeHints sizeHints = { + .flags = PMinSize | PMaxSize, + .min_width = width, + .min_height = height, + .max_width = width, + .max_height = height, + }; + XSetWMNormalHints(mDisplay, mWindow, &sizeHints); + XFlush(mDisplay); mX = 0; @@ -447,6 +458,18 @@ bool X11Window::setPosition(int x, int y) bool X11Window::resize(int width, int height) { XResizeWindow(mDisplay, mWindow, width, height); + + // Set PMinSize and PMaxSize on XSizeHints so windows larger than the screen do not get adjusted + // to screen size + XSizeHints sizeHints = { + .flags = PMinSize | PMaxSize, + .min_width = width, + .min_height = height, + .max_width = width, + .max_height = height, + }; + XSetWMNormalHints(mDisplay, mWindow, &sizeHints); + XFlush(mDisplay); Timer timer;