glfwMaximizeWindow bug on Windows 8.1 and Windows 10 with undecorated window


#1

Hello everyone! Thanks for taking the time to read this!

(with the GLFW version found on LWJGL 3.1.0)

Using an undecorated window, glfwMaximizeWindow works perfectly fine on Linux Mint 18, but on Windows 8.1 and 10, the window hides the task/start bar, sizing itself as a full-screen window, but allowing movement and resizing (through a custom frame), meaning it’s not really a proper full-screen either.

The original window size is 1280x720, and the screen resolution of the Windows 8.1 computer is 1900x1600. The resolution of the Windows 10 computer is 1600x900.


Maximize borderless window outside of task bar
#2

Hi Leo!

glfwMaximizeWindow is an OS function wrapper for maximizing the window, and internally on Windows calls ShowWindow(window->win32.handle, SW_MAXIMIZE);.

So the behaviour you’re seeing is the Windows OS specific behaviour for a maximized undecorated window, and not a bug.

I agree that this isn’t particularly useful, as being able to make a decorated window as big as possible whilst keeping the OS bar active is pretty useful. The question is whether to change the behaviour of glfwMaximizeWindow or add new functions to enable your desired behaviour - basically either a glfwMaximizeToClientArea or a function to get the client area size (in windows this would probably use GetMonitorInfo to get the rcWork size.

Any thoughts?


#3

Hi Doug! Thank you for your response!

I find it odd that glfwMaximizeWindow behaves different when undecorated, so I would be inclined to consider changing its behavior to be consistent on both situations: when using undecorated window frames, or the OS frames. But that is just my opinion, and any kind of solution would be welcome.

My particular use case is having a custom frame and title bar for my application, instead of using the OS one. It’s working great so far except for the maximize behavior on Windows. If there’s any other way to achieve a homogeneous behavior across the different OS for the maximize button, I’d be very interested to know about it.


#4

I think the best way to proceed then would be to raise this as an issue - perhaps “glfwMaximizeWindow behaviour not consistent across all operating systems for undecorated windows” rather than ‘bug’, and reference this thread.

It would be best if you raised this since you have a need for the behaviour, but I can raise it if needed.


#5

I would appreciate if you could raise the issue since I currently don’t have a GitHub account. I apologize if my wording was incorrect, English is not my native language.

Thank you for your time!


#6

Your working was fine, I just thought this wording would help clarify things!

I’ve added the issue to GLFW on github.


#7

This has been fixed for 3.3.