Make sure Qt::Popup is treated like a dialog

According to the documentation, Qt::Popup should have a proper frame
with a title bar. To honor this, two functions had to be
slightly altered.

Change-Id: I4bbc18e6b7fbec5702fad6e22ef2226c09dea15a
Fixes: QTBUG-94768
Pick-to: 5.15 6.2
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
David Skoland 2021-10-14 13:22:13 +02:00
parent 5335cc4a5a
commit 723a2c34a5
2 changed files with 2 additions and 3 deletions

View File

@ -248,8 +248,8 @@ QVariant QWasmIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
Qt::WindowState QWasmIntegration::defaultWindowState(Qt::WindowFlags flags) const
{
// Don't maximize dialogs
if (flags & Qt::Dialog & ~Qt::Window)
// Don't maximize dialogs or popups
if (flags.testFlag(Qt::Dialog) || flags.testFlag(Qt::Popup))
return Qt::WindowNoState;
return QPlatformIntegration::defaultWindowState(flags);

View File

@ -407,7 +407,6 @@ bool QWasmWindow::hasTitleBar() const
auto flags = window()->flags();
return !(m_windowState & Qt::WindowFullScreen)
&& flags.testFlag(Qt::WindowTitleHint)
&& !flags.testFlag(Qt::Popup)
&& !flags.testFlag(Qt::ToolTip)
&& m_needsCompositor;
}