summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorDavid Skoland <david.skoland@qt.io>2021-10-26 13:32:48 +0200
committerDavid Skoland <david.skoland@qt.io>2021-10-27 13:45:08 +0200
commitaa6405ee037abd53e88c7cd2ceee78fd973cafa9 (patch)
tree46cbf2864e14c0ecfc19de910153ebc5bd8535e6 /src/plugins/platforms
parentea3ede9c45748aa8bc1dee572be2570f83fbcb95 (diff)
Adjust behavior of windowIsPopupType and hasTitleBar
The previous implementation did not check for the popup flag, so it was added, and the tool window exception was preserved. hasTitleBar was also changed so it checks for popups and not tooltips specifically (tooltips are always popups). Change-Id: I3e2ba3be56e992b30ca2a07375092073572e7fcb Pick-to: 6.2 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp15
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h2
2 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp
index f7bc2dc4a7..48d01ef6b5 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.cpp
+++ b/src/plugins/platforms/wasm/qwasmwindow.cpp
@@ -407,20 +407,19 @@ void QWasmWindow::requestUpdate()
bool QWasmWindow::hasTitleBar() const
{
- auto flags = window()->flags();
+ Qt::WindowFlags flags = window()->flags();
return !(m_windowState & Qt::WindowFullScreen)
&& flags.testFlag(Qt::WindowTitleHint)
- && !flags.testFlag(Qt::ToolTip)
+ && !(windowIsPopupType(flags))
&& m_needsCompositor;
}
-bool QWasmWindow::windowIsPopupType(Qt::WindowType type) const
+bool QWasmWindow::windowIsPopupType(Qt::WindowFlags flags) const
{
- if (type == Qt::Widget)
- type = window()->type();
- if (type != Qt::Tool)
- return true;
- return false;
+ if (flags.testFlag(Qt::Tool))
+ return false; // Qt::Tool has the Popup bit set but isn't
+
+ return (flags.testFlag(Qt::Popup));
}
void QWasmWindow::requestActivateWindow()
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h
index f99c69fc79..870377ce29 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.h
+++ b/src/plugins/platforms/wasm/qwasmwindow.h
@@ -124,7 +124,7 @@ protected:
bool m_needsCompositor = false;
friend class QWasmCompositor;
friend class QWasmEventTranslator;
- bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const;
+ bool windowIsPopupType(Qt::WindowFlags flags) const;
};
QT_END_NAMESPACE
#endif // QWASMWINDOW_H