From debe31e047060d790fb32c06e514d9df476df8bf Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 21 Jan 2014 15:11:03 +0100 Subject: 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 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(QObjectPrivate::get(w))->eventReceiver(); connection()->setFocusWindow(static_cast(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; -- cgit v1.2.1