[SCM] qtbase packaging branch, master, updated. debian/5.5.1+dfsg-13-2-gc77d2b0
Lisandro Damián Nicanor Pérez
lisandro at moszumanska.debian.org
Mon Feb 15 17:42:58 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtbase.git;a=commitdiff;h=c77d2b0
The following commit has been merged in the master branch:
commit c77d2b087f4a89d9a92992349e391744567a1c57
Author: Lisandro Damián Nicanor Pérez Meyer <perezmeyer at gmail.com>
Date: Mon Feb 15 14:42:40 2016 -0300
Backport fix_not_delivering_focus.patch.
---
debian/changelog | 2 +
debian/patches/fix_not_delivering_focus.patch | 86 +++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 89 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 6ca4fc4..622c82a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
qtbase-opensource-src (5.5.1+dfsg-14) UNRELEASED; urgency=medium
+ * Backport fix_not_delivering_focus.patch to fix not delivering focusIn event
+ on hide/show.
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Wed, 03 Feb 2016 19:03:04 -0300
diff --git a/debian/patches/fix_not_delivering_focus.patch b/debian/patches/fix_not_delivering_focus.patch
new file mode 100644
index 0000000..7032686
--- /dev/null
+++ b/debian/patches/fix_not_delivering_focus.patch
@@ -0,0 +1,86 @@
+From d44ab0cdca239fbd58c8c824eb1ba06073b1b21c Mon Sep 17 00:00:00 2001
+From: Alexander Bersenev <bay at hackerdom.ru>
+Date: Fri, 6 Nov 2015 01:39:27 +0500
+Subject: [PATCH] xcb: Fix not delivering focusIn event on hide/show
+
+Consider a window which was hidden and shown with hide() and show()
+methods and mouse pointer was in window when hide() was called.
+
+At first, window got focusOutEvent and then Qt library sends X server
+a message to unmap the window.
+
+Then X server will send client two messages:
+1) FocusOut(10) detail=Nonlinear(0x03)
+2) FocusIn(9) detail=Pointer(0x05)
+
+QXcbWindow has a logic for not seting active window to 0 if there is
+a FocusIn coming (see QXcbWindow::doFocusOut).
+
+So QGuiApplicationPrivate::focus_window still points to the current
+window.
+
+Then when show() is called, qt compares previous focus with new focus
+and, since they are equal, doesn't do anything. Event focusInEvent
+isn't delivered to the window.
+
+Here are two links why X server sends FocusIn just after FocusOut:
+http://lists.freedesktop.org/archives/xorg/2008-December/041684.html
+https://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html
+
+Proposed fix ignores FocusIn events with detail==Pointer.
+The text of explaining comment is taken from the Chromium project:
+https://chromium.googlesource.com/chromium/src/+/master/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+from X11DesktopHandler::ProcessXEvent function.
+
+[ChangeLog][module][Linux/XCB] Fix not delivering focusIn event on
+hide/show with XCB
+
+Task-number: QTBUG-49071
+Change-Id: I433c8b638834c25f113cc134ee4185778c44f540
+---
+ src/plugins/platforms/xcb/qxcbwindow.cpp | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
+@@ -969,8 +969,13 @@ static bool focusInPeeker(QXcbConnection
+ return true;
+ }
+ uint response_type = event->response_type & ~0x80;
+- if (response_type == XCB_FOCUS_IN)
+- return true;
++ if (response_type == XCB_FOCUS_IN) {
++ // Ignore focus events that are being sent only because the pointer is over
++ // our window, even if the input focus is in a different window.
++ xcb_focus_in_event_t *e = (xcb_focus_in_event_t *) event;
++ if (e->detail != XCB_NOTIFY_DETAIL_POINTER)
++ return true;
++ }
+
+ /* We are also interested in XEMBED_FOCUS_IN events */
+ if (response_type == XCB_CLIENT_MESSAGE) {
+@@ -2417,14 +2422,22 @@ void QXcbWindow::handlePropertyNotifyEve
+ }
+ }
+
+-void QXcbWindow::handleFocusInEvent(const xcb_focus_in_event_t *)
++void QXcbWindow::handleFocusInEvent(const xcb_focus_in_event_t *event)
+ {
++ // Ignore focus events that are being sent only because the pointer is over
++ // our window, even if the input focus is in a different window.
++ if (event->detail == XCB_NOTIFY_DETAIL_POINTER)
++ return;
+ doFocusIn();
+ }
+
+
+-void QXcbWindow::handleFocusOutEvent(const xcb_focus_out_event_t *)
++void QXcbWindow::handleFocusOutEvent(const xcb_focus_out_event_t *event)
+ {
++ // Ignore focus events that are being sent only because the pointer is over
++ // our window, even if the input focus is in a different window.
++ if (event->detail == XCB_NOTIFY_DETAIL_POINTER)
++ return;
+ doFocusOut();
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index 2118627..f20e259 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,6 +12,7 @@ Fix-crash-on-exit-caused-by-QStringLiterals.patch
multiscreen.diff
xcb_dont_select_XInput_events_on_root_window.patch
xcb_fix_drag_and_drop_when_window_is_hidden.patch
+fix_not_delivering_focus.patch
# Debian specific.
gnukfreebsd.diff
--
qtbase packaging
More information about the pkg-kde-commits
mailing list