wasm: make windows fullscreen by default

(fullscreen as in use the entire canvas area, without
showing window decorations)

This is a better default for Qt on the web where window
decorations are not common. We also avoid the “window
close” trap, where there is no way to re-open a closed
main window.

Change-Id: Ie0fbf6ada3f49244bee765ea882acb473809e715
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Morten Johan Sørvig 2019-03-25 14:54:58 +01:00
parent 69beb5f5a0
commit 81ed119da1
2 changed files with 13 additions and 0 deletions

View File

@ -186,9 +186,21 @@ QAbstractEventDispatcher *QWasmIntegration::createEventDispatcher() const
QVariant QWasmIntegration::styleHint(QPlatformIntegration::StyleHint hint) const QVariant QWasmIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{ {
if (hint == ShowIsFullScreen)
return true;
return QPlatformIntegration::styleHint(hint); return QPlatformIntegration::styleHint(hint);
} }
Qt::WindowState QWasmIntegration::defaultWindowState(Qt::WindowFlags flags) const
{
// Don't maximize dialogs
if (flags & Qt::Dialog & ~Qt::Window)
return Qt::WindowNoState;
return QPlatformIntegration::defaultWindowState(flags);
}
QStringList QWasmIntegration::themeNames() const QStringList QWasmIntegration::themeNames() const
{ {
return QStringList() << QLatin1String("webassembly"); return QStringList() << QLatin1String("webassembly");

View File

@ -67,6 +67,7 @@ public:
QPlatformFontDatabase *fontDatabase() const override; QPlatformFontDatabase *fontDatabase() const override;
QAbstractEventDispatcher *createEventDispatcher() const override; QAbstractEventDispatcher *createEventDispatcher() const override;
QVariant styleHint(QPlatformIntegration::StyleHint hint) const override; QVariant styleHint(QPlatformIntegration::StyleHint hint) const override;
Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const override;
QStringList themeNames() const override; QStringList themeNames() const override;
QPlatformTheme *createPlatformTheme(const QString &name) const override; QPlatformTheme *createPlatformTheme(const QString &name) const override;
QPlatformClipboard *clipboard() const override; QPlatformClipboard *clipboard() const override;