Qt

Merge lp:~oif-team/qt/reenable-tablet into lp:~kubuntu-packagers/kubuntu-packaging/qt

Proposed by Chase Douglas
Status: Merged
Merged at revision: 173
Proposed branch: lp:~oif-team/qt/reenable-tablet
Merge into: lp:~kubuntu-packagers/kubuntu-packaging/qt
Diff against target: 133 lines (+23/-14)
2 files modified
debian/changelog (+7/-0)
debian/patches/kubuntu_28_xi2.1.patch (+16/-14)
To merge this branch: bzr merge lp:~oif-team/qt/reenable-tablet
Reviewer Review Type Date Requested Status
Denis Dzyubenko (community) Approve
Kubuntu Packagers Pending
Review via email: mp+64244@code.launchpad.net

Description of the change

The patch to enable XInput 2.1 multitouch support disabled XInput 1.x support. The Wacom tablet support depends on XInput 1.x support. The two XInput code paths should be able to work side by side, and with some minor modifications appear to do so without issue. I have tested tablet and multitouch support with this change and verified that they seem to work appropriately.

To post a comment you must log in.
Revision history for this message
Denis Dzyubenko (shadone) wrote :

Looks good to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-06-09 16:33:21 +0000
+++ debian/changelog 2011-06-10 19:43:27 +0000
@@ -1,3 +1,10 @@
1qt4-x11 (4:4.7.3-1ubuntu4) UNRELEASED; urgency=low
2
3 * Re-enable tablet support (LP: #762938)
4 - Updated kubuntu_28_xi2.1.patch with the fix
5
6 -- Chase Douglas <chase.douglas@ubuntu.com> Fri, 10 Jun 2011 13:09:55 -0400
7
1qt4-x11 (4:4.7.3-1ubuntu3) oneiric; urgency=low8qt4-x11 (4:4.7.3-1ubuntu3) oneiric; urgency=low
29
3 * debian/rules:10 * debian/rules:
411
=== modified file 'debian/patches/kubuntu_28_xi2.1.patch'
--- debian/patches/kubuntu_28_xi2.1.patch 2011-06-03 13:46:31 +0000
+++ debian/patches/kubuntu_28_xi2.1.patch 2011-06-10 19:43:27 +0000
@@ -148,7 +148,7 @@
148 $XIY -xinput ............ Compile Xinput support. This also enabled tablet support148 $XIY -xinput ............ Compile Xinput support. This also enabled tablet support
149 which requires IRIX with wacom.h and libXi or149 which requires IRIX with wacom.h and libXi or
150 XFree86 with X11/extensions/XInput.h and libXi.150 XFree86 with X11/extensions/XInput.h and libXi.
151@@ -5934,7 +5952,23 @@151@@ -5934,7 +5952,22 @@
152 fi152 fi
153 fi153 fi
154 154
@@ -157,7 +157,6 @@
157+ if [ "$CFG_XINPUT2" != "no" ]; then157+ if [ "$CFG_XINPUT2" != "no" ]; then
158+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinput2 "XInput2" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then158+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinput2 "XInput2" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
159+ CFG_XINPUT2=yes159+ CFG_XINPUT2=yes
160+ CFG_XINPUT=no
161+ else160+ else
162+ if [ "$CFG_XINPUT2" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then161+ if [ "$CFG_XINPUT2" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
163+ echo "XInput2 support cannot be enabled due to functionality tests!"162+ echo "XInput2 support cannot be enabled due to functionality tests!"
@@ -351,11 +350,12 @@
351 // ### This should be static but it isn't because of the friend declaration350 // ### This should be static but it isn't because of the friend declaration
352 // ### in qpaintdevice.h which then should have a static too but can't have351 // ### in qpaintdevice.h which then should have a static too but can't have
353 // ### it because "storage class specifiers invalid in friend function352 // ### it because "storage class specifiers invalid in friend function
354@@ -1659,9 +1678,13 @@353@@ -1659,9 +1678,14 @@
355 354
356 // XInputExtension355 // XInputExtension
357 X11->use_xinput = false;356 X11->use_xinput = false;
358- X11->xinput_major = 0;357- X11->xinput_major = 0;
358+ X11->use_xinput2 = false;
359+ X11->xinput_opcode = 0;359+ X11->xinput_opcode = 0;
360 X11->xinput_eventbase = 0;360 X11->xinput_eventbase = 0;
361 X11->xinput_errorbase = 0;361 X11->xinput_errorbase = 0;
@@ -366,23 +366,24 @@
366 366
367 X11->use_xkb = false;367 X11->use_xkb = false;
368 X11->xkb_major = 0;368 X11->xkb_major = 0;
369@@ -2123,14 +2146,25 @@369@@ -2123,14 +2146,26 @@
370 #endif // QT_RUNTIME_XINERAMA370 #endif // QT_RUNTIME_XINERAMA
371 #endif // QT_NO_XINERAMA371 #endif // QT_NO_XINERAMA
372 372
373-#ifndef QT_NO_XINPUT373-#ifndef QT_NO_XINPUT
374+#if !defined(QT_NO_XINPUT2)374+#if !defined(QT_NO_XINPUT2)
375+ X11->use_xinput = XQueryExtension(X11->display, "XInputExtension", &X11->xinput_opcode,375+ X11->use_xinput2 = XQueryExtension(X11->display, "XInputExtension", &X11->xinput_opcode,
376+ &X11->xinput_eventbase, &X11->xinput_errorbase);376+ &X11->xinput_eventbase, &X11->xinput_errorbase);
377+ if (X11->use_xinput) {377+ if (X11->use_xinput2) {
378+ // we want XInput2378+ // we want XInput2
379+ int ximajor = 2, ximinor = 1;379+ int ximajor = 2, ximinor = 1;
380+ if (XIQueryVersion(X11->display, &ximajor, &ximinor) == BadRequest) {380+ if (XIQueryVersion(X11->display, &ximajor, &ximinor) == BadRequest) {
381+ // XInput2 not available381+ // XInput2 not available
382+ X11->use_xinput = false;382+ X11->use_xinput2 = false;
383+ }383+ }
384+ }384+ }
385+#elif !defined(QT_NO_XINPUT)385+#endif
386+#if !defined(QT_NO_XINPUT)
386 // See if Xinput is supported on the connected display387 // See if Xinput is supported on the connected display
387 X11->ptrXCloseDevice = 0;388 X11->ptrXCloseDevice = 0;
388 X11->ptrXListInputDevices = 0;389 X11->ptrXListInputDevices = 0;
@@ -409,7 +410,7 @@
409 break;410 break;
410+#if !defined(QT_NO_XINPUT2)411+#if !defined(QT_NO_XINPUT2)
411+ case GenericEvent:412+ case GenericEvent:
412+ if (X11->use_xinput413+ if (X11->use_xinput2
413+ && XGetEventData(X11->display, &event->xcookie)414+ && XGetEventData(X11->display, &event->xcookie)
414+ && event->xcookie.extension == X11->xinput_opcode) {415+ && event->xcookie.extension == X11->xinput_opcode) {
415+ // remember for later416+ // remember for later
@@ -757,15 +758,15 @@
757===================================================================758===================================================================
758--- qt-everywhere-opensource-src-4.7.2.orig/src/gui/kernel/qt_x11_p.h 2011-02-22 12:03:58.000000000 +0000759--- qt-everywhere-opensource-src-4.7.2.orig/src/gui/kernel/qt_x11_p.h 2011-02-22 12:03:58.000000000 +0000
759+++ qt-everywhere-opensource-src-4.7.2/src/gui/kernel/qt_x11_p.h 2011-03-02 18:15:16.057309732 +0000760+++ qt-everywhere-opensource-src-4.7.2/src/gui/kernel/qt_x11_p.h 2011-03-02 18:15:16.057309732 +0000
760@@ -97,13 +97,14 @@761@@ -97,13 +97,15 @@
761 # include <X11/extensions/shape.h>762 # include <X11/extensions/shape.h>
762 #endif // QT_NO_SHAPE763 #endif // QT_NO_SHAPE
763 764
764-765-
765-#if !defined (QT_NO_TABLET)
766+#if !defined(QT_NO_XINPUT2)766+#if !defined(QT_NO_XINPUT2)
767+# include <X11/extensions/XInput2.h>767+# include <X11/extensions/XInput2.h>
768+#elif !defined (QT_NO_TABLET)768+#endif
769 #if !defined (QT_NO_TABLET)
769 # include <X11/extensions/XInput.h>770 # include <X11/extensions/XInput.h>
770-#if defined (Q_OS_IRIX)771-#if defined (Q_OS_IRIX)
771-# include <X11/extensions/SGIMisc.h>772-# include <X11/extensions/SGIMisc.h>
@@ -778,7 +779,7 @@
778 #endif // QT_NO_TABLET779 #endif // QT_NO_TABLET
779 780
780 781
781@@ -434,11 +435,15 @@782@@ -434,11 +435,16 @@
782 bool use_mitshm_pixmaps;783 bool use_mitshm_pixmaps;
783 int mitshm_major;784 int mitshm_major;
784 785
@@ -786,6 +787,7 @@
786+ // true if Qt is compiled w/ XInput2 or Tablet support and we have a tablet.787+ // true if Qt is compiled w/ XInput2 or Tablet support and we have a tablet.
787 bool use_xinput;788 bool use_xinput;
788- int xinput_major;789- int xinput_major;
790+ bool use_xinput2;
789+ int xinput_opcode;791+ int xinput_opcode;
790 int xinput_eventbase;792 int xinput_eventbase;
791 int xinput_errorbase;793 int xinput_errorbase;
@@ -900,7 +902,7 @@
900+ if (!q->testAttribute(Qt::WA_WState_Created) || q->windowType() == Qt::Desktop)902+ if (!q->testAttribute(Qt::WA_WState_Created) || q->windowType() == Qt::Desktop)
901+ return;903+ return;
902+904+
903+ if (X11->use_xinput) {905+ if (X11->use_xinput2) {
904+ XIEventMask xieventmask;906+ XIEventMask xieventmask;
905+907+
906+ const int mask_len = XIMaskLen(XI_LASTEVENT);908+ const int mask_len = XIMaskLen(XI_LASTEVENT);

Subscribers

People subscribed via source and target branches