Merge lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi into lp:~kubuntu-packagers/kubuntu-packaging/qt

Proposed by Chase Douglas on 2012-01-17
Status: Rejected
Rejected by: Chase Douglas on 2012-01-17
Proposed branch: lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi
Merge into: lp:~kubuntu-packagers/kubuntu-packaging/qt
Diff against target: 311 lines (+56/-87)
3 files modified
debian/changelog (+6/-1)
debian/control (+1/-1)
debian/patches/kubuntu_28_xi2.1.patch (+49/-85)
To merge this branch: bzr merge lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi
Reviewer Review Type Date Requested Status
Kubuntu Packagers 2012-01-17 Pending
Review via email: mp+88912@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Chase Douglas (chasedouglas) wrote :

I realized I had permissions to push this change directly to the packaging branch. No review needed.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-01-17 13:41:16 +0000
3+++ debian/changelog 2012-01-17 18:08:24 +0000
4@@ -1,9 +1,14 @@
5 qt4-x11 (4:4.8.0-1ubuntu2) UNRELEASED; urgency=low
6
7+ [ Felix Geyer ]
8 * Fix include path of qdeclarativeitemchangelistener_p.h in
9 kubuntu_97_a11y_qt_and_qml_backport.diff. This caused QtCreator to FTBFS.
10
11- -- Felix Geyer <debfx@ubuntu.com> Tue, 17 Jan 2012 14:39:43 +0100
12+ [ Chase Douglas ]
13+ * Update kubuntu_28_xi2.1.patch for upstream multitouch implementation
14+ * Update Build-Depends on libxi-dev >= 1.5.99.2 for multitouch support
15+
16+ -- Chase Douglas <chase.douglas@ubuntu.com> Tue, 17 Jan 2012 09:51:48 -0800
17
18 qt4-x11 (4:4.8.0-1ubuntu1) precise; urgency=low
19
20
21=== modified file 'debian/control'
22--- debian/control 2011-12-30 17:08:51 +0000
23+++ debian/control 2012-01-17 18:08:24 +0000
24@@ -42,7 +42,7 @@
25 libxcursor-dev,
26 libxext-dev,
27 libxft-dev,
28- libxi-dev,
29+ libxi-dev (>= 1.5.99.2),
30 libxinerama-dev,
31 libxmu-dev,
32 libxrandr-dev,
33
34=== modified file 'debian/patches/kubuntu_28_xi2.1.patch'
35--- debian/patches/kubuntu_28_xi2.1.patch 2012-01-07 10:15:07 +0000
36+++ debian/patches/kubuntu_28_xi2.1.patch 2012-01-17 18:08:24 +0000
37@@ -1,18 +1,3 @@
38----
39- config.tests/x11/xinput2/xinput2.cpp | 75 ++++++
40- config.tests/x11/xinput2/xinput2.pro | 4
41- configure | 46 +++
42- examples/touch/fingerpaint/scribblearea.cpp | 2
43- src/gui/kernel/kernel.pri | 1
44- src/gui/kernel/qapplication_p.h | 29 ++
45- src/gui/kernel/qapplication_x11.cpp | 350 +++++++++++++++++++++++++++-
46- src/gui/kernel/qevent.h | 1
47- src/gui/kernel/qt_x11_p.h | 27 +-
48- src/gui/kernel/qwidget.cpp | 2
49- src/gui/kernel/qwidget_p.h | 5
50- src/gui/kernel/qwidget_x11.cpp | 39 +++
51- 12 files changed, 556 insertions(+), 25 deletions(-)
52-
53 --- /dev/null
54 +++ b/config.tests/x11/xinput2/xinput2.cpp
55 @@ -0,0 +1,75 @@
56@@ -61,8 +46,8 @@
57 +#include <X11/extensions/XInput2.h>
58 +#include <X11/extensions/Xge.h>
59 +
60-+#ifndef XInput_2_1
61-+# error "Missing XInput_2_1 #define"
62++#if XI_2_Major < 2 || XI_2_Minor < 2
63++# error "Missing XInput 2.2 or later"
64 +#endif
65 +
66 +int main(int, char **)
67@@ -113,7 +98,7 @@
68 ;;
69 #Qt style yes options
70 - -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)
71-+ -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)
72++ -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)
73 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
74 VAL=yes
75 ;;
76@@ -195,19 +180,19 @@
77 if [ "$CFG_XINPUT" = "yes" ]; then
78 QT_CONFIG="$QT_CONFIG xinput tablet"
79 fi
80-@@ -8340,6 +8376,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then
81- [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
82+@@ -8341,6 +8377,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then
83 [ "$CFG_XVIDEO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO"
84 [ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
85-+ [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2"
86 [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
87++ [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2"
88
89 [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
90+ [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
91 @@ -8904,6 +8941,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then
92 echo "Xfixes support ......... $CFG_XFIXES"
93 echo "Xrandr support ......... $CFG_XRANDR"
94 echo "Xrender support ........ $CFG_XRENDER"
95-+ echo "Xi2 support ............ $CFG_XINPUT2"
96++ echo "XInput2 support ........ $CFG_XINPUT2"
97 echo "Xi support ............. $CFG_XINPUT"
98 echo "MIT-SHM support ........ $CFG_MITSHM"
99 echo "FontConfig support ..... $CFG_FONTCONFIG"
100@@ -334,24 +319,7 @@
101 extensionName = "XInputExtension";
102 else if (err->request_code == X11->mitshm_major)
103 extensionName = "MIT-SHM";
104-@@ -1649,6 +1658,16 @@ static void getXDefault(const char *grou
105- }
106- #endif
107-
108-+inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst,
109-+ const XITouchValuatorClassInfo &src)
110-+{
111-+ dst.number = src.number;
112-+ dst.label = src.label;
113-+ dst.min = src.min;
114-+ dst.max = src.max;
115-+ dst.resolution = src.resolution;
116-+}
117-+
118- // ### This should be static but it isn't because of the friend declaration
119- // ### in qpaintdevice.h which then should have a static too but can't have
120- // ### it because "storage class specifiers invalid in friend function
121-@@ -1681,9 +1700,14 @@ void qt_init(QApplicationPrivate *priv,
122+@@ -1681,9 +1690,14 @@ void qt_init(QApplicationPrivate *priv,
123
124 // XInputExtension
125 X11->use_xinput = false;
126@@ -367,7 +335,7 @@
127
128 X11->use_xkb = false;
129 X11->xkb_major = 0;
130-@@ -2154,14 +2178,26 @@ void qt_init(QApplicationPrivate *priv,
131+@@ -2154,14 +2168,26 @@ void qt_init(QApplicationPrivate *priv,
132 #endif // QT_RUNTIME_XINERAMA
133 #endif // QT_NO_XINERAMA
134
135@@ -396,16 +364,18 @@
136 &X11->xinput_eventbase, &X11->xinput_errorbase);
137 if (X11->use_xinput) {
138 X11->ptrXCloseDevice = XINPUT_LOAD(XCloseDevice);
139-@@ -3224,6 +3260,8 @@ int QApplication::x11ProcessEvent(XEvent
140+@@ -3224,6 +3250,10 @@ int QApplication::x11ProcessEvent(XEvent
141 Q_D(QApplication);
142 QScopedLoopLevelCounter loopLevelCounter(d->threadData);
143
144++#if !defined(QT_NO_XINPUT2)
145 + bool isXI2Event = false;
146++#endif
147 +
148 #ifdef ALIEN_DEBUG
149 //qDebug() << "QApplication::x11ProcessEvent:" << event->type;
150 #endif
151-@@ -3254,6 +3292,16 @@ int QApplication::x11ProcessEvent(XEvent
152+@@ -3254,6 +3284,16 @@ int QApplication::x11ProcessEvent(XEvent
153 case SelectionClear:
154 X11->time = event->xselectionclear.time;
155 break;
156@@ -422,7 +392,7 @@
157 default:
158 break;
159 }
160-@@ -3267,7 +3315,43 @@ int QApplication::x11ProcessEvent(XEvent
161+@@ -3267,7 +3307,43 @@ int QApplication::x11ProcessEvent(XEvent
162 }
163 #endif
164
165@@ -467,7 +437,7 @@
166
167 if (wPRmapper) { // just did a widget reparent?
168 if (widget == 0) { // not in std widget mapper
169-@@ -3279,6 +3363,15 @@ int QApplication::x11ProcessEvent(XEvent
170+@@ -3279,6 +3355,15 @@ int QApplication::x11ProcessEvent(XEvent
171 case XKeyRelease:
172 widget = qPRFindWidget(event->xany.window);
173 break;
174@@ -483,18 +453,21 @@
175 }
176 }
177 else if (widget->testAttribute(Qt::WA_WState_Reparented))
178-@@ -3913,6 +4006,10 @@ int QApplication::x11ProcessEvent(XEvent
179+@@ -3913,6 +3998,13 @@ int QApplication::x11ProcessEvent(XEvent
180 }
181 break;
182
183++#if !defined(QT_NO_XINPUT2)
184 + case GenericEvent:
185 + if (isXI2Event)
186 + widget->translateXI2Event((XIEvent *)event->xcookie.data);
187 + break;
188++#endif
189++
190 default:
191 break;
192 }
193-@@ -5135,6 +5232,191 @@ bool QETWidget::translatePropertyEvent(c
194+@@ -5135,6 +5227,191 @@ bool QETWidget::translatePropertyEvent(c
195 return true;
196 }
197
198@@ -686,11 +659,21 @@
199
200 //
201 // Paint event translation
202-@@ -6282,11 +6564,61 @@ void QApplicationPrivate::_q_readRX71Mul
203+@@ -6282,11 +6559,77 @@ void QApplicationPrivate::_q_readRX71Mul
204
205 #else // !QT_RX71_MULTITOUCH
206
207 +#if !defined(QT_NO_XINPUT2)
208++static inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst,
209++ const XIValuatorClassInfo &src)
210++{
211++ dst.number = src.number;
212++ dst.label = src.label;
213++ dst.min = src.min;
214++ dst.max = src.max;
215++ dst.resolution = src.resolution;
216++}
217++
218 +void QApplicationPrivate::x11GetTouchDeviceInfo()
219 +{
220 + int count = 0;
221@@ -699,17 +682,20 @@
222 + for (int i = 0; i < count; ++i) {
223 + if (!devices[i].enabled)
224 + continue;
225++
226++ bool is_touch = false;
227++ QApplicationPrivate::TouchDeviceInfo tdi;
228++
229 + for (int k = 0; k < devices[i].num_classes; ++k) {
230 + XIAnyClassInfo *xiclassinfo = devices[i].classes[k];
231 + if (xiclassinfo->type == XITouchClass) {
232++ is_touch = true;
233 + XITouchClassInfo *t = (XITouchClassInfo *)xiclassinfo;
234-+ QApplicationPrivate::TouchDeviceInfo& tdi = touchDevices[devices[i].deviceid];
235 + tdi.deviceid = devices[i].deviceid;
236 + tdi.directTouch = t->mode == XIDirectTouch;
237 + tdi.maxTouches = t->num_touches;
238-+ } else if (xiclassinfo->type == XITouchValuatorClass) {
239-+ XITouchValuatorClassInfo *v = (XITouchValuatorClassInfo *)xiclassinfo;
240-+ QApplicationPrivate::TouchDeviceInfo &tdi = touchDevices[devices[i].deviceid];
241++ } else if (xiclassinfo->type == XIValuatorClass) {
242++ XIValuatorClassInfo *v = (XIValuatorClassInfo *)xiclassinfo;
243 + tdi.numValuators++;
244 + if (v->label == ATOM(XAbsMTTouchMajor))
245 + copy(tdi.xivTouchMajor, *v);
246@@ -723,6 +709,9 @@
247 + copy(tdi.xivPosY, *v);
248 + }
249 + }
250++
251++ if (is_touch)
252++ touchDevices[devices[i].deviceid] = tdi;
253 + }
254 + XIFreeDeviceInfo(devices);
255 + }
256@@ -826,39 +815,14 @@
257 #endif
258 --- a/src/gui/kernel/qwidget_p.h
259 +++ b/src/gui/kernel/qwidget_p.h
260-@@ -688,6 +688,8 @@ public:
261-
262- inline QRect mapFromWS(const QRect &r) const
263- { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; }
264-+
265+@@ -789,6 +789,7 @@ public:
266+ void updateX11AcceptFocus();
267+ QPoint mapToGlobal(const QPoint &pos) const;
268+ QPoint mapFromGlobal(const QPoint &pos) const;
269 + void registerTouchWindow();
270- #endif
271-
272- // Variables.
273-@@ -802,7 +804,6 @@ public:
274- void unregisterOleDnd(QWidget *widget, QOleDropTarget *target);
275- #endif
276- void grabMouseWhileInWindow();
277-- void registerTouchWindow();
278- void winSetupGestures();
279- #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC
280- // This is new stuff
281-@@ -886,7 +887,6 @@ public:
282- static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *);
283- static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *);
284- static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
285-- void registerTouchWindow(bool enable = true);
286- #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
287- void setMaxWindowState_helper();
288- void setFullScreenSize_helper();
289-@@ -914,7 +914,6 @@ public:
290- bool fixNativeOrientationCalled;
291- void s60UpdateIsOpaque();
292- void reparentChildren();
293-- void registerTouchWindow();
294- QList<WId> widCleanupList;
295- #endif
296-
297+ #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
298+ uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine()
299+ #ifndef QT_NO_GESTURES
300 --- a/src/gui/kernel/qwidget_x11.cpp
301 +++ b/src/gui/kernel/qwidget_x11.cpp
302 @@ -873,7 +873,13 @@ void QWidgetPrivate::create_sys(WId wind
303@@ -905,7 +869,7 @@
304 + QVector<uchar> mask_vector(mask_len, 0);
305 + uchar *bitmask = mask_vector.data();
306 +
307-+ xieventmask.deviceid = XIAllDevices;
308++ xieventmask.deviceid = XIAllMasterDevices;
309 + xieventmask.mask = bitmask;
310 + xieventmask.mask_len = mask_len;
311 +

Subscribers

People subscribed via source and target branches