I have an Qt application that can be displayed either "normal" (a normal window that's neither maximized nor minimized), maximized or fullscreen. I achieve that by calling the functions QWidget::showNormal()
, QWidget::showMaximized()
and QWidget::showFullscreen()
.
Let me first of all explain what does work:
What doesn't work?
When going from normal to maximized, then to fullscreen, back to maximized and then back to normal that does not work as expected. The window will not be resized to the size that it had originally, before maximizing. Instead the window will be as large as the screen (basically as large as the OS allows the window to be).
If I now go to fullscreen again then in the right upper corner and on the bottom edge there are weird artifacts that seem to look like parts of an old Vista window frame with visual effects disabled.
Here is an image that should illustrate the process I just explained:
I tried to save the last size of the window using QWidget::saveGeometry()
or just saving the size obtained by QWidget::size()
when a window state change event occured, but there were always cases when it behaved strangely. Apart from that, that last step when going full screen again looks like a bug to me.
What do you think?
UPDATE:
If I resize the window manually (to an arbitrary size) before the last step (which is going to fullscreen again), the fullscreen works without problems.
The new Qt 5.6 release apparently fixed that bug.