Fix saving/restoring window position for maximized windows

Save both the normal window geometry and its maximized position instead
of saving just its current position. This fixes restoring geometry of
the maximized windows as previously they were always restored on the
primary monitor, as their original position was lost.

Use the native {Get,Set}WindowPlacement() functions for a MSW-specific
wxTLWGeometry implementation to achieve this.

Closes #16335.
This commit is contained in:
Vadim Zeitlin
2018-04-29 20:30:30 +02:00
parent d97c055514
commit 6ae7aa4443
4 changed files with 187 additions and 0 deletions

View File

@@ -57,6 +57,9 @@ public:
#define wxPERSIST_TLW_MAXIMIZED "Maximized"
#define wxPERSIST_TLW_ICONIZED "Iconized"
// MSW has its own native implementation and doesn't use this class.
#ifndef __WXMSW__
class wxTLWGeometryGeneric : public wxTLWGeometryBase
{
public:
@@ -166,8 +169,12 @@ private:
bool m_maximized;
};
#endif // !__WXMSW__
#ifdef __WXGTK20__
#include "wx/gtk/private/tlwgeom.h"
#elif defined(__WXMSW__)
#include "wx/msw/private/tlwgeom.h"
#else
class wxTLWGeometry : public wxTLWGeometryGeneric
{