diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-15 01:00:11 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-15 01:00:11 +0100 |
commit | 8264e495fa9220c101a8a913701a0b8834a6d58b (patch) | |
tree | 069aa1d3efab926991c1edfc5b69a3d9e58dcfba /src/plugins/platforms/windows | |
parent | 80f52812f2651e6d427bb3dd2e338b60fb25d48b (diff) | |
parent | 8eb3944dac81b8c51d7bac7784204d457551b50c (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 21 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 1 |
3 files changed, 23 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 3d0dbd7b1a..20d6e6e8d4 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1364,9 +1364,10 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result, &platformWindow); if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) { if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) { - qCDebug(lcQpaEvents) << "EVENT: hwd=" << hwnd << eventName << hex << "msg=0x" << message - << "et=0x" << et << dec << "wp=" << int(wParam) << "at" - << GET_X_LPARAM(lParam) << GET_Y_LPARAM(lParam) << "handled=" << handled; + qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=" << hwnd << ' ' << eventName + << " msg=0x" << hex << message << " et=0x" << et << dec << " wp=" + << int(wParam) << " at " << GET_X_LPARAM(lParam) << ',' + << GET_Y_LPARAM(lParam) << " handled=" << handled; } } if (!handled) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 159e1250d0..9fff4b5e42 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1077,6 +1077,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, */ const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; +const char *QWindowsWindow::hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen"; QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : QWindowsBaseWindow(aWindow), @@ -1106,7 +1107,6 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) updateDropSite(window()->isTopLevel()); registerTouchWindow(); - setWindowState(aWindow->windowStates()); const qreal opacity = qt_window_private(aWindow)->opacity; if (!qFuzzyCompare(opacity, qreal(1.0))) setOpacity(opacity); @@ -1115,6 +1115,8 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) if (aWindow->isTopLevel()) setWindowIcon(aWindow->icon()); + if (aWindow->property(hasBorderInFullScreenProperty).toBool()) + setFlag(HasBorderInFullScreen); clearFlag(WithinCreate); } @@ -1133,9 +1135,11 @@ void QWindowsWindow::initialize() QWindowCreationContextPtr creationContext = QWindowsContext::instance()->setWindowCreationContext(QWindowCreationContextPtr()); + QWindow *w = window(); + setWindowState(w->windowStates()); + // Trigger geometry change (unless it has a special state in which case setWindowState() // will send the message) and screen change signals of QWindow. - QWindow *w = window(); if (w->type() != Qt::Desktop) { const Qt::WindowState state = w->windowState(); if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen @@ -2662,15 +2666,26 @@ void QWindowsWindow::setHasBorderInFullScreenStatic(QWindow *window, bool border if (QPlatformWindow *handle = window->handle()) static_cast<QWindowsWindow *>(handle)->setHasBorderInFullScreen(border); else - qWarning("%s invoked without window handle; call has no effect.", Q_FUNC_INFO); + window->setProperty(hasBorderInFullScreenProperty, QVariant(border)); } void QWindowsWindow::setHasBorderInFullScreen(bool border) { + if (testFlag(HasBorderInFullScreen) == border) + return; if (border) setFlag(HasBorderInFullScreen); else clearFlag(HasBorderInFullScreen); + // Directly apply the flag in case we are fullscreen. + if (m_windowState == Qt::WindowFullScreen) { + LONG_PTR style = GetWindowLongPtr(handle(), GWL_STYLE); + if (border) + style |= WS_BORDER; + else + style &= ~WS_BORDER; + SetWindowLongPtr(handle(), GWL_STYLE, style); + } } QString QWindowsWindow::formatWindowTitle(const QString &title) diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 8d29b871bf..fe2518e329 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -340,6 +340,7 @@ public: static QString formatWindowTitle(const QString &title); static const char *embeddedNativeParentHandleProperty; + static const char *hasBorderInFullScreenProperty; private: inline void show_sys() const; |