Chase Douglas has proposed merging
lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi into
lp:~kubuntu-packagers/kubuntu-packaging/qt.
Requested reviews:
Kubuntu Packagers (kubuntu-packagers)
For more details, see:
https://code.launchpad.net/~chasedouglas/kubuntu-packaging/qt-upstream-xi/+merge/88912
Refresh XI multitouch patch.
The previous version was written for the prototype implementation of XInput
multitouch support in Ubuntu 11.04 and 11.10. Ubuntu 12.04 will have the
upstream implementation, which has some differences from the prototype
implementation. This branch includes the necessary changes to continue the same
level of functionality.
--
https://code.launchpad.net/~chasedouglas/kubuntu-packaging/qt-upstream-xi/+merge/88912
Your team Kubuntu Packagers is requested to review the proposed merge of
lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi into
lp:~kubuntu-packagers/kubuntu-packaging/qt.
=== modified file 'debian/changelog'
--- debian/changelog 2012-01-17 13:41:16 +0000
+++ debian/changelog 2012-01-17 18:08:24 +0000
@@ -1,9 +1,14 @@
qt4-x11 (4:4.8.0-1ubuntu2) UNRELEASED; urgency=low
+ [ Felix Geyer ]
* Fix include path of qdeclarativeitemchangelistener_p.h in
kubuntu_97_a11y_qt_and_qml_backport.diff. This caused QtCreator to FTBFS.
- -- Felix Geyer <[email protected]> Tue, 17 Jan 2012 14:39:43 +0100
+ [ Chase Douglas ]
+ * Update kubuntu_28_xi2.1.patch for upstream multitouch implementation
+ * Update Build-Depends on libxi-dev >= 1.5.99.2 for multitouch support
+
+ -- Chase Douglas <[email protected]> Tue, 17 Jan 2012 09:51:48 -0800
qt4-x11 (4:4.8.0-1ubuntu1) precise; urgency=low
=== modified file 'debian/control'
--- debian/control 2011-12-30 17:08:51 +0000
+++ debian/control 2012-01-17 18:08:24 +0000
@@ -42,7 +42,7 @@
libxcursor-dev,
libxext-dev,
libxft-dev,
- libxi-dev,
+ libxi-dev (>= 1.5.99.2),
libxinerama-dev,
libxmu-dev,
libxrandr-dev,
=== modified file 'debian/patches/kubuntu_28_xi2.1.patch'
--- debian/patches/kubuntu_28_xi2.1.patch 2012-01-07 10:15:07 +0000
+++ debian/patches/kubuntu_28_xi2.1.patch 2012-01-17 18:08:24 +0000
@@ -1,18 +1,3 @@
----
- config.tests/x11/xinput2/xinput2.cpp | 75 ++++++
- config.tests/x11/xinput2/xinput2.pro | 4
- configure | 46 +++
- examples/touch/fingerpaint/scribblearea.cpp | 2
- src/gui/kernel/kernel.pri | 1
- src/gui/kernel/qapplication_p.h | 29 ++
- src/gui/kernel/qapplication_x11.cpp | 350 +++++++++++++++++++++++++++-
- src/gui/kernel/qevent.h | 1
- src/gui/kernel/qt_x11_p.h | 27 +-
- src/gui/kernel/qwidget.cpp | 2
- src/gui/kernel/qwidget_p.h | 5
- src/gui/kernel/qwidget_x11.cpp | 39 +++
- 12 files changed, 556 insertions(+), 25 deletions(-)
-
--- /dev/null
+++ b/config.tests/x11/xinput2/xinput2.cpp
@@ -0,0 +1,75 @@
@@ -61,8 +46,8 @@
+#include <X11/extensions/XInput2.h>
+#include <X11/extensions/Xge.h>
+
-+#ifndef XInput_2_1
-+# error "Missing XInput_2_1 #define"
++#if XI_2_Major < 2 || XI_2_Minor < 2
++# error "Missing XInput 2.2 or later"
+#endif
+
+int main(int, char **)
@@ -113,7 +98,7 @@
;;
#Qt style yes options
- -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
-+ -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput2|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
++ -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
@@ -195,19 +180,19 @@
if [ "$CFG_XINPUT" = "yes" ]; then
QT_CONFIG="$QT_CONFIG xinput tablet"
fi
-@@ -8340,6 +8376,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then
- [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
+@@ -8341,6 +8377,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then
[ "$CFG_XVIDEO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO"
[ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
-+ [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2"
[ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
++ [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2"
[ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
+ [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
@@ -8904,6 +8941,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then
echo "Xfixes support ......... $CFG_XFIXES"
echo "Xrandr support ......... $CFG_XRANDR"
echo "Xrender support ........ $CFG_XRENDER"
-+ echo "Xi2 support ............ $CFG_XINPUT2"
++ echo "XInput2 support ........ $CFG_XINPUT2"
echo "Xi support ............. $CFG_XINPUT"
echo "MIT-SHM support ........ $CFG_MITSHM"
echo "FontConfig support ..... $CFG_FONTCONFIG"
@@ -334,24 +319,7 @@
extensionName = "XInputExtension";
else if (err->request_code == X11->mitshm_major)
extensionName = "MIT-SHM";
-@@ -1649,6 +1658,16 @@ static void getXDefault(const char *grou
- }
- #endif
-
-+inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst,
-+ const XITouchValuatorClassInfo &src)
-+{
-+ dst.number = src.number;
-+ dst.label = src.label;
-+ dst.min = src.min;
-+ dst.max = src.max;
-+ dst.resolution = src.resolution;
-+}
-+
- // ### This should be static but it isn't because of the friend declaration
- // ### in qpaintdevice.h which then should have a static too but can't have
- // ### it because "storage class specifiers invalid in friend function
-@@ -1681,9 +1700,14 @@ void qt_init(QApplicationPrivate *priv,
+@@ -1681,9 +1690,14 @@ void qt_init(QApplicationPrivate *priv,
// XInputExtension
X11->use_xinput = false;
@@ -367,7 +335,7 @@
X11->use_xkb = false;
X11->xkb_major = 0;
-@@ -2154,14 +2178,26 @@ void qt_init(QApplicationPrivate *priv,
+@@ -2154,14 +2168,26 @@ void qt_init(QApplicationPrivate *priv,
#endif // QT_RUNTIME_XINERAMA
#endif // QT_NO_XINERAMA
@@ -396,16 +364,18 @@
&X11->xinput_eventbase, &X11->xinput_errorbase);
if (X11->use_xinput) {
X11->ptrXCloseDevice = XINPUT_LOAD(XCloseDevice);
-@@ -3224,6 +3260,8 @@ int QApplication::x11ProcessEvent(XEvent
+@@ -3224,6 +3250,10 @@ int QApplication::x11ProcessEvent(XEvent
Q_D(QApplication);
QScopedLoopLevelCounter loopLevelCounter(d->threadData);
++#if !defined(QT_NO_XINPUT2)
+ bool isXI2Event = false;
++#endif
+
#ifdef ALIEN_DEBUG
//qDebug() << "QApplication::x11ProcessEvent:" << event->type;
#endif
-@@ -3254,6 +3292,16 @@ int QApplication::x11ProcessEvent(XEvent
+@@ -3254,6 +3284,16 @@ int QApplication::x11ProcessEvent(XEvent
case SelectionClear:
X11->time = event->xselectionclear.time;
break;
@@ -422,7 +392,7 @@
default:
break;
}
-@@ -3267,7 +3315,43 @@ int QApplication::x11ProcessEvent(XEvent
+@@ -3267,7 +3307,43 @@ int QApplication::x11ProcessEvent(XEvent
}
#endif
@@ -467,7 +437,7 @@
if (wPRmapper) { // just did a widget reparent?
if (widget == 0) { // not in std widget mapper
-@@ -3279,6 +3363,15 @@ int QApplication::x11ProcessEvent(XEvent
+@@ -3279,6 +3355,15 @@ int QApplication::x11ProcessEvent(XEvent
case XKeyRelease:
widget = qPRFindWidget(event->xany.window);
break;
@@ -483,18 +453,21 @@
}
}
else if (widget->testAttribute(Qt::WA_WState_Reparented))
-@@ -3913,6 +4006,10 @@ int QApplication::x11ProcessEvent(XEvent
+@@ -3913,6 +3998,13 @@ int QApplication::x11ProcessEvent(XEvent
}
break;
++#if !defined(QT_NO_XINPUT2)
+ case GenericEvent:
+ if (isXI2Event)
+ widget->translateXI2Event((XIEvent *)event->xcookie.data);
+ break;
++#endif
++
default:
break;
}
-@@ -5135,6 +5232,191 @@ bool QETWidget::translatePropertyEvent(c
+@@ -5135,6 +5227,191 @@ bool QETWidget::translatePropertyEvent(c
return true;
}
@@ -686,11 +659,21 @@
//
// Paint event translation
-@@ -6282,11 +6564,61 @@ void QApplicationPrivate::_q_readRX71Mul
+@@ -6282,11 +6559,77 @@ void QApplicationPrivate::_q_readRX71Mul
#else // !QT_RX71_MULTITOUCH
+#if !defined(QT_NO_XINPUT2)
++static inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst,
++ const XIValuatorClassInfo &src)
++{
++ dst.number = src.number;
++ dst.label = src.label;
++ dst.min = src.min;
++ dst.max = src.max;
++ dst.resolution = src.resolution;
++}
++
+void QApplicationPrivate::x11GetTouchDeviceInfo()
+{
+ int count = 0;
@@ -699,17 +682,20 @@
+ for (int i = 0; i < count; ++i) {
+ if (!devices[i].enabled)
+ continue;
++
++ bool is_touch = false;
++ QApplicationPrivate::TouchDeviceInfo tdi;
++
+ for (int k = 0; k < devices[i].num_classes; ++k) {
+ XIAnyClassInfo *xiclassinfo = devices[i].classes[k];
+ if (xiclassinfo->type == XITouchClass) {
++ is_touch = true;
+ XITouchClassInfo *t = (XITouchClassInfo *)xiclassinfo;
-+ QApplicationPrivate::TouchDeviceInfo& tdi = touchDevices[devices[i].deviceid];
+ tdi.deviceid = devices[i].deviceid;
+ tdi.directTouch = t->mode == XIDirectTouch;
+ tdi.maxTouches = t->num_touches;
-+ } else if (xiclassinfo->type == XITouchValuatorClass) {
-+ XITouchValuatorClassInfo *v = (XITouchValuatorClassInfo *)xiclassinfo;
-+ QApplicationPrivate::TouchDeviceInfo &tdi = touchDevices[devices[i].deviceid];
++ } else if (xiclassinfo->type == XIValuatorClass) {
++ XIValuatorClassInfo *v = (XIValuatorClassInfo *)xiclassinfo;
+ tdi.numValuators++;
+ if (v->label == ATOM(XAbsMTTouchMajor))
+ copy(tdi.xivTouchMajor, *v);
@@ -723,6 +709,9 @@
+ copy(tdi.xivPosY, *v);
+ }
+ }
++
++ if (is_touch)
++ touchDevices[devices[i].deviceid] = tdi;
+ }
+ XIFreeDeviceInfo(devices);
+ }
@@ -826,39 +815,14 @@
#endif
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
-@@ -688,6 +688,8 @@ public:
-
- inline QRect mapFromWS(const QRect &r) const
- { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; }
-+
+@@ -789,6 +789,7 @@ public:
+ void updateX11AcceptFocus();
+ QPoint mapToGlobal(const QPoint &pos) const;
+ QPoint mapFromGlobal(const QPoint &pos) const;
+ void registerTouchWindow();
- #endif
-
- // Variables.
-@@ -802,7 +804,6 @@ public:
- void unregisterOleDnd(QWidget *widget, QOleDropTarget *target);
- #endif
- void grabMouseWhileInWindow();
-- void registerTouchWindow();
- void winSetupGestures();
- #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
- // This is new stuff
-@@ -886,7 +887,6 @@ public:
- static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *);
- static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *);
- static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
-- void registerTouchWindow(bool enable = true);
- #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
- void setMaxWindowState_helper();
- void setFullScreenSize_helper();
-@@ -914,7 +914,6 @@ public:
- bool fixNativeOrientationCalled;
- void s60UpdateIsOpaque();
- void reparentChildren();
-- void registerTouchWindow();
- QList<WId> widCleanupList;
- #endif
-
+ #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
+ uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine()
+ #ifndef QT_NO_GESTURES
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -873,7 +873,13 @@ void QWidgetPrivate::create_sys(WId wind
@@ -905,7 +869,7 @@
+ QVector<uchar> mask_vector(mask_len, 0);
+ uchar *bitmask = mask_vector.data();
+
-+ xieventmask.deviceid = XIAllDevices;
++ xieventmask.deviceid = XIAllMasterDevices;
+ xieventmask.mask = bitmask;
+ xieventmask.mask_len = mask_len;
+
--
kubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel