I’ve got a slight problem with my Windows projects. The project settings reflect the resolution of my monitor, 1920x1080.
Whenever I start a project in Windows 10, it does not start in a maximized window, but a “maximizable” one. And this window is larger than a maximized one and parts of the content are hidden behind the taskbar. So, using defos.toggle_fullscreen() right after start-up toggles between fullscreen and this too-large window.
Ok, let’s maximize the window then. Nope, defos.toggle_fullscreen() ignores the maximized window and chooses the too-large window.
Only when I resize the window to a smaller size does toggling work as expected.
Right, what happens if the user maximizes this smaller window? defos.toggle_fullscreen() again ignores the maximized window and chooses the smaller window.
In Manjaro Linux, my apps start in a maximized window and toggling works well. Only when this maximized window has not been resized yet and “restore down” is clicked the problem with the too-large window occurs.
I have searched the forum for answers and found this thread.
So, I used defos.set_window_size() to set the start-up window to a size slightly smaller than the project settings. The toggling now works quite nicely, but still ignores a maximized window. Also, I would like the app to start in fullscreen mode.
I tried to fix the problem via code. So far, I was able to write some lines to force toggling between fullscreen and maximized but not between fullscreen and a smaller window.
I have also tried some convoluted code involving a window listener but so far without success.
My cunning plan to bundle a window.exe in Manjaro Linux did not work either, same behaviour as on Windows.
In short: when a maximized window has not been resized yet, the window produced when “restore down” is pressed is too large. Is there a way to fix this? Also, is there a way to make defos.toggle_fullscreen() stop ignoring maximized windows on Windows?
Sorry for the long post!