Make FloatingWindow::normalGeometry() virtual

So it can be overridden by QtQuick, since there's no "normal geometry"
for QWindow.

Also useful to workaround window manager bugs in a class derived from FloatingWindow.
This commit is contained in:
Sergio Martins
2021-09-03 15:33:46 +01:00
parent e22ca48674
commit 25b48920bb
2 changed files with 12 additions and 0 deletions

View File

@@ -606,6 +606,11 @@ void FloatingWindow::showMinimized()
QWidgetAdapter::showMinimized();
}
QRect FloatingWindow::normalGeometry() const
{
return QWidgetAdapter::normalGeometry();
}
int FloatingWindow::userType() const
{
if (Frame *f = singleFrame())

View File

@@ -203,6 +203,13 @@ public:
/// @sa QTBUG-95478
virtual void showMinimized();
///@brief By default equivalent to QWidget::normalGeometry()
/// Derived classes can implement something different here, to workaround window manager issues with Qt::Tool
/// Also useful for QtQuick to eventually perserve normal geometry uppon save/restore of a maximized window. As
/// QWindow has no notion of normal geometry, so we need to implement it here.
/// @sa QTBUG-95478
virtual QRect normalGeometry() const;
///@brief Allows the user app to specify which window flags to use, instead of KDDWs default ones
///Bugs caused by this won't be supported, as the amount of combinations that could go wrong can
///be open ended