diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-17 15:40:59 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-08-18 14:04:36 +0000 |
commit | 4531ae8d699d06197d8485702fc48214c5e4dda8 (patch) | |
tree | 7114ef0a139abb5f6393318a7698e3156712d52c /src/plugins/platforms/winrt/qwinrtscreen.cpp | |
parent | a75cfa60d7f15513218f7719410b09f708a2940e (diff) |
winrt: only update window title for top level widgets
Previously we always updated the window title, independently whether the
window was visible / the toplevel one. This can also cause troubles when
setting the title during initialization.
Change-Id: I02ec0f0e385fa490f641ce83a6cb27717a31620f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrtscreen.cpp')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 77185f1bb9..dd2ebee3d5 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -764,6 +764,7 @@ void QWinRTScreen::addWindow(QWindow *window) return; d->visibleWindows.prepend(window); + updateWindowTitle(window->title()); QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); handleExpose(); QWindowSystemInterface::flushWindowSystemEvents(); @@ -813,15 +814,10 @@ void QWinRTScreen::lower(QWindow *window) handleExpose(); } -void QWinRTScreen::updateWindowTitle() +void QWinRTScreen::updateWindowTitle(const QString &title) { Q_D(QWinRTScreen); - QWindow *window = topWindow(); - if (!window) - return; - - const QString title = window->title(); HStringReference titleRef(reinterpret_cast<LPCWSTR>(title.utf16()), title.length()); HRESULT hr = d->view->put_Title(titleRef.Get()); RETURN_VOID_IF_FAILED("Unable to set window title"); |