summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscontext.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-11-26 07:23:13 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-05 17:19:07 +0100
commit434b37323a6feb3210168f70ad59f5ecdaa5a597 (patch)
tree72474021b27ee755fd8160bf10e9dc9f7e15e97a /src/plugins/platforms/windows/qwindowscontext.cpp
parentb8084618545570a8832d344a2e9586e1226cc697 (diff)
Respect the WindowDoesNotAcceptFocus flag
When the window is requested to be made active then it should check if the window accepts focus or not. If it does not then it should ensure it informs the underlying system that it does not accept the activate event. Change-Id: I3e6533be792d8bdbb2bfcdf3b9c1a93e2c67c75a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 77cac647ba..a87dfe5f16 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -928,6 +928,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return true;
#ifndef Q_OS_WINCE
case QtWindows::ActivateWindowEvent:
+ if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) {
+ *result = LRESULT(MA_NOACTIVATE);
+ return true;
+ }
#ifndef QT_NO_TABLETEVENT
if (!d->m_tabletSupport.isNull())
d->m_tabletSupport->notifyActivate();
@@ -936,6 +940,12 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
if (const QWindow *modalWindow = QGuiApplication::modalWindow())
QWindowsWindow::baseWindowOf(modalWindow)->alertWindow();
break;
+ case QtWindows::MouseActivateWindowEvent:
+ if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) {
+ *result = LRESULT(MA_NOACTIVATE);
+ return true;
+ }
+ break;
#endif
#ifndef QT_NO_CONTEXTMENU
case QtWindows::ContextMenu: