Merge lp:~chasedouglas/kubuntu-packaging/qt-upstream-xi into lp:~kubuntu-packagers/kubuntu-packaging/qt
- qt-upstream-xi
- Merge into qt
Proposed by
Chase Douglas
Status: | Rejected |
---|---|
Rejected by: | Chase Douglas |
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kubuntu Packagers | Pending | ||
Review via email: mp+88912@code.launchpad.net |
Commit message
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.
Revision history for this message
Chase Douglas (chasedouglas) wrote : | # |
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 | 1 | qt4-x11 (4:4.8.0-1ubuntu2) UNRELEASED; urgency=low | 1 | qt4-x11 (4:4.8.0-1ubuntu2) UNRELEASED; urgency=low |
6 | 2 | 2 | ||
7 | 3 | [ Felix Geyer ] | ||
8 | 3 | * Fix include path of qdeclarativeitemchangelistener_p.h in | 4 | * Fix include path of qdeclarativeitemchangelistener_p.h in |
9 | 4 | kubuntu_97_a11y_qt_and_qml_backport.diff. This caused QtCreator to FTBFS. | 5 | kubuntu_97_a11y_qt_and_qml_backport.diff. This caused QtCreator to FTBFS. |
10 | 5 | 6 | ||
12 | 6 | -- Felix Geyer <debfx@ubuntu.com> Tue, 17 Jan 2012 14:39:43 +0100 | 7 | [ Chase Douglas ] |
13 | 8 | * Update kubuntu_28_xi2.1.patch for upstream multitouch implementation | ||
14 | 9 | * Update Build-Depends on libxi-dev >= 1.5.99.2 for multitouch support | ||
15 | 10 | |||
16 | 11 | -- Chase Douglas <chase.douglas@ubuntu.com> Tue, 17 Jan 2012 09:51:48 -0800 | ||
17 | 7 | 12 | ||
18 | 8 | qt4-x11 (4:4.8.0-1ubuntu1) precise; urgency=low | 13 | qt4-x11 (4:4.8.0-1ubuntu1) precise; urgency=low |
19 | 9 | 14 | ||
20 | 10 | 15 | ||
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 | 42 | libxcursor-dev, | 42 | libxcursor-dev, |
26 | 43 | libxext-dev, | 43 | libxext-dev, |
27 | 44 | libxft-dev, | 44 | libxft-dev, |
29 | 45 | libxi-dev, | 45 | libxi-dev (>= 1.5.99.2), |
30 | 46 | libxinerama-dev, | 46 | libxinerama-dev, |
31 | 47 | libxmu-dev, | 47 | libxmu-dev, |
32 | 48 | libxrandr-dev, | 48 | libxrandr-dev, |
33 | 49 | 49 | ||
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 | 1 | --- | ||
39 | 2 | config.tests/x11/xinput2/xinput2.cpp | 75 ++++++ | ||
40 | 3 | config.tests/x11/xinput2/xinput2.pro | 4 | ||
41 | 4 | configure | 46 +++ | ||
42 | 5 | examples/touch/fingerpaint/scribblearea.cpp | 2 | ||
43 | 6 | src/gui/kernel/kernel.pri | 1 | ||
44 | 7 | src/gui/kernel/qapplication_p.h | 29 ++ | ||
45 | 8 | src/gui/kernel/qapplication_x11.cpp | 350 +++++++++++++++++++++++++++- | ||
46 | 9 | src/gui/kernel/qevent.h | 1 | ||
47 | 10 | src/gui/kernel/qt_x11_p.h | 27 +- | ||
48 | 11 | src/gui/kernel/qwidget.cpp | 2 | ||
49 | 12 | src/gui/kernel/qwidget_p.h | 5 | ||
50 | 13 | src/gui/kernel/qwidget_x11.cpp | 39 +++ | ||
51 | 14 | 12 files changed, 556 insertions(+), 25 deletions(-) | ||
52 | 15 | |||
53 | 16 | --- /dev/null | 1 | --- /dev/null |
54 | 17 | +++ b/config.tests/x11/xinput2/xinput2.cpp | 2 | +++ b/config.tests/x11/xinput2/xinput2.cpp |
55 | 18 | @@ -0,0 +1,75 @@ | 3 | @@ -0,0 +1,75 @@ |
56 | @@ -61,8 +46,8 @@ | |||
57 | 61 | +#include <X11/extensions/XInput2.h> | 46 | +#include <X11/extensions/XInput2.h> |
58 | 62 | +#include <X11/extensions/Xge.h> | 47 | +#include <X11/extensions/Xge.h> |
59 | 63 | + | 48 | + |
62 | 64 | +#ifndef XInput_2_1 | 49 | +#if XI_2_Major < 2 || XI_2_Minor < 2 |
63 | 65 | +# error "Missing XInput_2_1 #define" | 50 | +# error "Missing XInput 2.2 or later" |
64 | 66 | +#endif | 51 | +#endif |
65 | 67 | + | 52 | + |
66 | 68 | +int main(int, char **) | 53 | +int main(int, char **) |
67 | @@ -113,7 +98,7 @@ | |||
68 | 113 | ;; | 98 | ;; |
69 | 114 | #Qt style yes options | 99 | #Qt style yes options |
70 | 115 | - -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) | 100 | - -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) |
72 | 116 | + -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) | 101 | + -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 | 117 | VAR=`echo $1 | sed "s,^-\(.*\),\1,"` | 102 | VAR=`echo $1 | sed "s,^-\(.*\),\1,"` |
74 | 118 | VAL=yes | 103 | VAL=yes |
75 | 119 | ;; | 104 | ;; |
76 | @@ -195,19 +180,19 @@ | |||
77 | 195 | if [ "$CFG_XINPUT" = "yes" ]; then | 180 | if [ "$CFG_XINPUT" = "yes" ]; then |
78 | 196 | QT_CONFIG="$QT_CONFIG xinput tablet" | 181 | QT_CONFIG="$QT_CONFIG xinput tablet" |
79 | 197 | fi | 182 | fi |
82 | 198 | @@ -8340,6 +8376,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then | 183 | @@ -8341,6 +8377,7 @@ if [ "$XPLATFORM_SYMBIAN" = "no" ]; then |
81 | 199 | [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE" | ||
83 | 200 | [ "$CFG_XVIDEO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO" | 184 | [ "$CFG_XVIDEO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO" |
84 | 201 | [ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC" | 185 | [ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC" |
85 | 202 | + [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2" | ||
86 | 203 | [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET" | 186 | [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET" |
87 | 187 | + [ "$CFG_XINPUT2" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT2" | ||
88 | 204 | 188 | ||
89 | 205 | [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR" | 189 | [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR" |
90 | 190 | [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA" | ||
91 | 206 | @@ -8904,6 +8941,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then | 191 | @@ -8904,6 +8941,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then |
92 | 207 | echo "Xfixes support ......... $CFG_XFIXES" | 192 | echo "Xfixes support ......... $CFG_XFIXES" |
93 | 208 | echo "Xrandr support ......... $CFG_XRANDR" | 193 | echo "Xrandr support ......... $CFG_XRANDR" |
94 | 209 | echo "Xrender support ........ $CFG_XRENDER" | 194 | echo "Xrender support ........ $CFG_XRENDER" |
96 | 210 | + echo "Xi2 support ............ $CFG_XINPUT2" | 195 | + echo "XInput2 support ........ $CFG_XINPUT2" |
97 | 211 | echo "Xi support ............. $CFG_XINPUT" | 196 | echo "Xi support ............. $CFG_XINPUT" |
98 | 212 | echo "MIT-SHM support ........ $CFG_MITSHM" | 197 | echo "MIT-SHM support ........ $CFG_MITSHM" |
99 | 213 | echo "FontConfig support ..... $CFG_FONTCONFIG" | 198 | echo "FontConfig support ..... $CFG_FONTCONFIG" |
100 | @@ -334,24 +319,7 @@ | |||
101 | 334 | extensionName = "XInputExtension"; | 319 | extensionName = "XInputExtension"; |
102 | 335 | else if (err->request_code == X11->mitshm_major) | 320 | else if (err->request_code == X11->mitshm_major) |
103 | 336 | extensionName = "MIT-SHM"; | 321 | extensionName = "MIT-SHM"; |
122 | 337 | @@ -1649,6 +1658,16 @@ static void getXDefault(const char *grou | 322 | @@ -1681,9 +1690,14 @@ void qt_init(QApplicationPrivate *priv, |
105 | 338 | } | ||
106 | 339 | #endif | ||
107 | 340 | |||
108 | 341 | +inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst, | ||
109 | 342 | + const XITouchValuatorClassInfo &src) | ||
110 | 343 | +{ | ||
111 | 344 | + dst.number = src.number; | ||
112 | 345 | + dst.label = src.label; | ||
113 | 346 | + dst.min = src.min; | ||
114 | 347 | + dst.max = src.max; | ||
115 | 348 | + dst.resolution = src.resolution; | ||
116 | 349 | +} | ||
117 | 350 | + | ||
118 | 351 | // ### This should be static but it isn't because of the friend declaration | ||
119 | 352 | // ### in qpaintdevice.h which then should have a static too but can't have | ||
120 | 353 | // ### it because "storage class specifiers invalid in friend function | ||
121 | 354 | @@ -1681,9 +1700,14 @@ void qt_init(QApplicationPrivate *priv, | ||
123 | 355 | 323 | ||
124 | 356 | // XInputExtension | 324 | // XInputExtension |
125 | 357 | X11->use_xinput = false; | 325 | X11->use_xinput = false; |
126 | @@ -367,7 +335,7 @@ | |||
127 | 367 | 335 | ||
128 | 368 | X11->use_xkb = false; | 336 | X11->use_xkb = false; |
129 | 369 | X11->xkb_major = 0; | 337 | X11->xkb_major = 0; |
131 | 370 | @@ -2154,14 +2178,26 @@ void qt_init(QApplicationPrivate *priv, | 338 | @@ -2154,14 +2168,26 @@ void qt_init(QApplicationPrivate *priv, |
132 | 371 | #endif // QT_RUNTIME_XINERAMA | 339 | #endif // QT_RUNTIME_XINERAMA |
133 | 372 | #endif // QT_NO_XINERAMA | 340 | #endif // QT_NO_XINERAMA |
134 | 373 | 341 | ||
135 | @@ -396,16 +364,18 @@ | |||
136 | 396 | &X11->xinput_eventbase, &X11->xinput_errorbase); | 364 | &X11->xinput_eventbase, &X11->xinput_errorbase); |
137 | 397 | if (X11->use_xinput) { | 365 | if (X11->use_xinput) { |
138 | 398 | X11->ptrXCloseDevice = XINPUT_LOAD(XCloseDevice); | 366 | X11->ptrXCloseDevice = XINPUT_LOAD(XCloseDevice); |
140 | 399 | @@ -3224,6 +3260,8 @@ int QApplication::x11ProcessEvent(XEvent | 367 | @@ -3224,6 +3250,10 @@ int QApplication::x11ProcessEvent(XEvent |
141 | 400 | Q_D(QApplication); | 368 | Q_D(QApplication); |
142 | 401 | QScopedLoopLevelCounter loopLevelCounter(d->threadData); | 369 | QScopedLoopLevelCounter loopLevelCounter(d->threadData); |
143 | 402 | 370 | ||
144 | 371 | +#if !defined(QT_NO_XINPUT2) | ||
145 | 403 | + bool isXI2Event = false; | 372 | + bool isXI2Event = false; |
146 | 373 | +#endif | ||
147 | 404 | + | 374 | + |
148 | 405 | #ifdef ALIEN_DEBUG | 375 | #ifdef ALIEN_DEBUG |
149 | 406 | //qDebug() << "QApplication::x11ProcessEvent:" << event->type; | 376 | //qDebug() << "QApplication::x11ProcessEvent:" << event->type; |
150 | 407 | #endif | 377 | #endif |
152 | 408 | @@ -3254,6 +3292,16 @@ int QApplication::x11ProcessEvent(XEvent | 378 | @@ -3254,6 +3284,16 @@ int QApplication::x11ProcessEvent(XEvent |
153 | 409 | case SelectionClear: | 379 | case SelectionClear: |
154 | 410 | X11->time = event->xselectionclear.time; | 380 | X11->time = event->xselectionclear.time; |
155 | 411 | break; | 381 | break; |
156 | @@ -422,7 +392,7 @@ | |||
157 | 422 | default: | 392 | default: |
158 | 423 | break; | 393 | break; |
159 | 424 | } | 394 | } |
161 | 425 | @@ -3267,7 +3315,43 @@ int QApplication::x11ProcessEvent(XEvent | 395 | @@ -3267,7 +3307,43 @@ int QApplication::x11ProcessEvent(XEvent |
162 | 426 | } | 396 | } |
163 | 427 | #endif | 397 | #endif |
164 | 428 | 398 | ||
165 | @@ -467,7 +437,7 @@ | |||
166 | 467 | 437 | ||
167 | 468 | if (wPRmapper) { // just did a widget reparent? | 438 | if (wPRmapper) { // just did a widget reparent? |
168 | 469 | if (widget == 0) { // not in std widget mapper | 439 | if (widget == 0) { // not in std widget mapper |
170 | 470 | @@ -3279,6 +3363,15 @@ int QApplication::x11ProcessEvent(XEvent | 440 | @@ -3279,6 +3355,15 @@ int QApplication::x11ProcessEvent(XEvent |
171 | 471 | case XKeyRelease: | 441 | case XKeyRelease: |
172 | 472 | widget = qPRFindWidget(event->xany.window); | 442 | widget = qPRFindWidget(event->xany.window); |
173 | 473 | break; | 443 | break; |
174 | @@ -483,18 +453,21 @@ | |||
175 | 483 | } | 453 | } |
176 | 484 | } | 454 | } |
177 | 485 | else if (widget->testAttribute(Qt::WA_WState_Reparented)) | 455 | else if (widget->testAttribute(Qt::WA_WState_Reparented)) |
179 | 486 | @@ -3913,6 +4006,10 @@ int QApplication::x11ProcessEvent(XEvent | 456 | @@ -3913,6 +3998,13 @@ int QApplication::x11ProcessEvent(XEvent |
180 | 487 | } | 457 | } |
181 | 488 | break; | 458 | break; |
182 | 489 | 459 | ||
183 | 460 | +#if !defined(QT_NO_XINPUT2) | ||
184 | 490 | + case GenericEvent: | 461 | + case GenericEvent: |
185 | 491 | + if (isXI2Event) | 462 | + if (isXI2Event) |
186 | 492 | + widget->translateXI2Event((XIEvent *)event->xcookie.data); | 463 | + widget->translateXI2Event((XIEvent *)event->xcookie.data); |
187 | 493 | + break; | 464 | + break; |
188 | 465 | +#endif | ||
189 | 466 | + | ||
190 | 494 | default: | 467 | default: |
191 | 495 | break; | 468 | break; |
192 | 496 | } | 469 | } |
194 | 497 | @@ -5135,6 +5232,191 @@ bool QETWidget::translatePropertyEvent(c | 470 | @@ -5135,6 +5227,191 @@ bool QETWidget::translatePropertyEvent(c |
195 | 498 | return true; | 471 | return true; |
196 | 499 | } | 472 | } |
197 | 500 | 473 | ||
198 | @@ -686,11 +659,21 @@ | |||
199 | 686 | 659 | ||
200 | 687 | // | 660 | // |
201 | 688 | // Paint event translation | 661 | // Paint event translation |
203 | 689 | @@ -6282,11 +6564,61 @@ void QApplicationPrivate::_q_readRX71Mul | 662 | @@ -6282,11 +6559,77 @@ void QApplicationPrivate::_q_readRX71Mul |
204 | 690 | 663 | ||
205 | 691 | #else // !QT_RX71_MULTITOUCH | 664 | #else // !QT_RX71_MULTITOUCH |
206 | 692 | 665 | ||
207 | 693 | +#if !defined(QT_NO_XINPUT2) | 666 | +#if !defined(QT_NO_XINPUT2) |
208 | 667 | +static inline void copy(QApplicationPrivate::TouchDeviceInfo::Valuator &dst, | ||
209 | 668 | + const XIValuatorClassInfo &src) | ||
210 | 669 | +{ | ||
211 | 670 | + dst.number = src.number; | ||
212 | 671 | + dst.label = src.label; | ||
213 | 672 | + dst.min = src.min; | ||
214 | 673 | + dst.max = src.max; | ||
215 | 674 | + dst.resolution = src.resolution; | ||
216 | 675 | +} | ||
217 | 676 | + | ||
218 | 694 | +void QApplicationPrivate::x11GetTouchDeviceInfo() | 677 | +void QApplicationPrivate::x11GetTouchDeviceInfo() |
219 | 695 | +{ | 678 | +{ |
220 | 696 | + int count = 0; | 679 | + int count = 0; |
221 | @@ -699,17 +682,20 @@ | |||
222 | 699 | + for (int i = 0; i < count; ++i) { | 682 | + for (int i = 0; i < count; ++i) { |
223 | 700 | + if (!devices[i].enabled) | 683 | + if (!devices[i].enabled) |
224 | 701 | + continue; | 684 | + continue; |
225 | 685 | + | ||
226 | 686 | + bool is_touch = false; | ||
227 | 687 | + QApplicationPrivate::TouchDeviceInfo tdi; | ||
228 | 688 | + | ||
229 | 702 | + for (int k = 0; k < devices[i].num_classes; ++k) { | 689 | + for (int k = 0; k < devices[i].num_classes; ++k) { |
230 | 703 | + XIAnyClassInfo *xiclassinfo = devices[i].classes[k]; | 690 | + XIAnyClassInfo *xiclassinfo = devices[i].classes[k]; |
231 | 704 | + if (xiclassinfo->type == XITouchClass) { | 691 | + if (xiclassinfo->type == XITouchClass) { |
232 | 692 | + is_touch = true; | ||
233 | 705 | + XITouchClassInfo *t = (XITouchClassInfo *)xiclassinfo; | 693 | + XITouchClassInfo *t = (XITouchClassInfo *)xiclassinfo; |
234 | 706 | + QApplicationPrivate::TouchDeviceInfo& tdi = touchDevices[devices[i].deviceid]; | ||
235 | 707 | + tdi.deviceid = devices[i].deviceid; | 694 | + tdi.deviceid = devices[i].deviceid; |
236 | 708 | + tdi.directTouch = t->mode == XIDirectTouch; | 695 | + tdi.directTouch = t->mode == XIDirectTouch; |
237 | 709 | + tdi.maxTouches = t->num_touches; | 696 | + tdi.maxTouches = t->num_touches; |
241 | 710 | + } else if (xiclassinfo->type == XITouchValuatorClass) { | 697 | + } else if (xiclassinfo->type == XIValuatorClass) { |
242 | 711 | + XITouchValuatorClassInfo *v = (XITouchValuatorClassInfo *)xiclassinfo; | 698 | + XIValuatorClassInfo *v = (XIValuatorClassInfo *)xiclassinfo; |
240 | 712 | + QApplicationPrivate::TouchDeviceInfo &tdi = touchDevices[devices[i].deviceid]; | ||
243 | 713 | + tdi.numValuators++; | 699 | + tdi.numValuators++; |
244 | 714 | + if (v->label == ATOM(XAbsMTTouchMajor)) | 700 | + if (v->label == ATOM(XAbsMTTouchMajor)) |
245 | 715 | + copy(tdi.xivTouchMajor, *v); | 701 | + copy(tdi.xivTouchMajor, *v); |
246 | @@ -723,6 +709,9 @@ | |||
247 | 723 | + copy(tdi.xivPosY, *v); | 709 | + copy(tdi.xivPosY, *v); |
248 | 724 | + } | 710 | + } |
249 | 725 | + } | 711 | + } |
250 | 712 | + | ||
251 | 713 | + if (is_touch) | ||
252 | 714 | + touchDevices[devices[i].deviceid] = tdi; | ||
253 | 726 | + } | 715 | + } |
254 | 727 | + XIFreeDeviceInfo(devices); | 716 | + XIFreeDeviceInfo(devices); |
255 | 728 | + } | 717 | + } |
256 | @@ -826,39 +815,14 @@ | |||
257 | 826 | #endif | 815 | #endif |
258 | 827 | --- a/src/gui/kernel/qwidget_p.h | 816 | --- a/src/gui/kernel/qwidget_p.h |
259 | 828 | +++ b/src/gui/kernel/qwidget_p.h | 817 | +++ b/src/gui/kernel/qwidget_p.h |
265 | 829 | @@ -688,6 +688,8 @@ public: | 818 | @@ -789,6 +789,7 @@ public: |
266 | 830 | 819 | void updateX11AcceptFocus(); | |
267 | 831 | inline QRect mapFromWS(const QRect &r) const | 820 | QPoint mapToGlobal(const QPoint &pos) const; |
268 | 832 | { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; } | 821 | QPoint mapFromGlobal(const QPoint &pos) const; |
264 | 833 | + | ||
269 | 834 | + void registerTouchWindow(); | 822 | + void registerTouchWindow(); |
297 | 835 | #endif | 823 | #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN |
298 | 836 | 824 | uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine() | |
299 | 837 | // Variables. | 825 | #ifndef QT_NO_GESTURES |
273 | 838 | @@ -802,7 +804,6 @@ public: | ||
274 | 839 | void unregisterOleDnd(QWidget *widget, QOleDropTarget *target); | ||
275 | 840 | #endif | ||
276 | 841 | void grabMouseWhileInWindow(); | ||
277 | 842 | - void registerTouchWindow(); | ||
278 | 843 | void winSetupGestures(); | ||
279 | 844 | #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC | ||
280 | 845 | // This is new stuff | ||
281 | 846 | @@ -886,7 +887,6 @@ public: | ||
282 | 847 | static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); | ||
283 | 848 | static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); | ||
284 | 849 | static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); | ||
285 | 850 | - void registerTouchWindow(bool enable = true); | ||
286 | 851 | #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS | ||
287 | 852 | void setMaxWindowState_helper(); | ||
288 | 853 | void setFullScreenSize_helper(); | ||
289 | 854 | @@ -914,7 +914,6 @@ public: | ||
290 | 855 | bool fixNativeOrientationCalled; | ||
291 | 856 | void s60UpdateIsOpaque(); | ||
292 | 857 | void reparentChildren(); | ||
293 | 858 | - void registerTouchWindow(); | ||
294 | 859 | QList<WId> widCleanupList; | ||
295 | 860 | #endif | ||
296 | 861 | |||
300 | 862 | --- a/src/gui/kernel/qwidget_x11.cpp | 826 | --- a/src/gui/kernel/qwidget_x11.cpp |
301 | 863 | +++ b/src/gui/kernel/qwidget_x11.cpp | 827 | +++ b/src/gui/kernel/qwidget_x11.cpp |
302 | 864 | @@ -873,7 +873,13 @@ void QWidgetPrivate::create_sys(WId wind | 828 | @@ -873,7 +873,13 @@ void QWidgetPrivate::create_sys(WId wind |
303 | @@ -905,7 +869,7 @@ | |||
304 | 905 | + QVector<uchar> mask_vector(mask_len, 0); | 869 | + QVector<uchar> mask_vector(mask_len, 0); |
305 | 906 | + uchar *bitmask = mask_vector.data(); | 870 | + uchar *bitmask = mask_vector.data(); |
306 | 907 | + | 871 | + |
308 | 908 | + xieventmask.deviceid = XIAllDevices; | 872 | + xieventmask.deviceid = XIAllMasterDevices; |
309 | 909 | + xieventmask.mask = bitmask; | 873 | + xieventmask.mask = bitmask; |
310 | 910 | + xieventmask.mask_len = mask_len; | 874 | + xieventmask.mask_len = mask_len; |
311 | 911 | + | 875 | + |
I realized I had permissions to push this change directly to the packaging branch. No review needed.