Possible bug: exit from Fullscreen does not restore window position

Hi.
I have troubles with fullscreen mode, maybe you can help with this.
I'll try to explain behaviour I see, maybe this is intended...
I'm on Windows 10 21H2/x64.
So FRV window can be either in normal state or maximized (with taskbar visible, not fullscreen), most of the time I have it maximized.
When I enter fullscreen mode by pressing 'F' and then exiting from it - FRV always exits to normal window state.
Because of this - if I enter fullscreen from normal window state, FRV exits to previous position just fine, but if I enter fullscreen from maximized window I'm expecting to exit from it to maximized window state - and it fails, still exits to normal window state.
Is this intended behaviour?
If not - can this be fixed?
Thanks.

The 'normal window geometry' (not maximized, not full-screen) is maintained by Windows, not (only) in FastRawViewerr.

Return from Full-screen and return from maximized are both requests to Windows 'please set normal geometry for this window'.



So, implementing your request is hardly possible.

--

Alex Tutubalin/FastRawViewer team

This is possible in QT also.
Before entering fullscreen mode you can use windowState() which returns current window state.
And then after exiting fullscreen you can restore state by using setWindowState()
So it's possible to switch from Qt::WindowFullScreen to Qt::WindowMaximized.

https://doc.qt.io/qt-5/qwindow.html#windowState
https://doc.qt.io/qt-5/qwindow.html#setWindowState
https://doc.qt.io/qt-5/qt.html#WindowState-enum
 

This implies that we have to keep a list of the window's previous states, right?

--

Alex Tutubalin/FastRawViewer team

I guess no.
All this stuff applies to main window only - tool windows can't be maximized or changed to fullscreen.
So this will only require one variable to keep previous state of the main window.

Yes, single variable can keep single track for this specific case ('go from fullscreen'). Although I'm not sure if this is the only case



We add new features based on the frequency of user requests, but no one has asked for such a function yet.

We will add your request to the waiting list, perhaps some other user will ask for something similar.


 

--

Alex Tutubalin/FastRawViewer team

Sorry, I don't get it.
As I can see you are using QT and I don't know if it supports all the native Windows features - maybe this is the issue.
But using WinApi - this is doable:
-before entering fullscreen mode call GetWindowPlacement(), it will return window placement including state (normal or maximized)
-after exiting fullscreen just call SetWindowPlacement() or ShowWindow() to restore window position
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-ge...
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-se...
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sh...
Sample code:
https://devblogs.microsoft.com/oldnewthing/20100412-00/?p=14353

Add new comment