summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-01-21 15:11:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 21:21:16 +0100
commitdebe31e047060d790fb32c06e514d9df476df8bf (patch)
treedca6220afab063b826ccee259b158b0b60df1cc8
parent5b570c287f0ddd8897a22acc53416b1f89c11da7 (diff)
X11: Qt::ActiveWindowFocusReason in QFocusEvent when appropriate
When one window loses focus because another window got it, the reason should not be Qt::OtherFocusReason. If it is ActiveWindowFocusReason or PopupFocusReason, any QtQuick text elements that were in the window which lost focus will not deselect any selected text. Task-number: QTBUG-36292 Change-Id: I4630f74e6aacd928284cedab6ed711c95b24bff7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index f46bed77d6..3d8f91649a 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1550,7 +1550,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
handleXEmbedMessage(event);
} else if (event->type == atom(QXcbAtom::_NET_ACTIVE_WINDOW)) {
connection()->setFocusWindow(this);
- QWindowSystemInterface::handleWindowActivated(window());
+ QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
} else if (event->type == atom(QXcbAtom::MANAGER)
|| event->type == atom(QXcbAtom::_NET_WM_STATE)
|| event->type == atom(QXcbAtom::WM_CHANGE_STATE)) {
@@ -1855,14 +1855,14 @@ void QXcbWindow::handleFocusInEvent(const xcb_focus_in_event_t *)
QWindow *w = window();
w = static_cast<QWindowPrivate *>(QObjectPrivate::get(w))->eventReceiver();
connection()->setFocusWindow(static_cast<QXcbWindow *>(w->handle()));
- QWindowSystemInterface::handleWindowActivated(w);
+ QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason);
}
static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event)
{
if (!event) {
// FocusIn event is not in the queue, proceed with FocusOut normally.
- QWindowSystemInterface::handleWindowActivated(0);
+ QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason);
return true;
}
uint response_type = event->response_type & ~0x80;