Annotation of /trunk/qt4/patches/qt-4.6.3-kde-qt-85067d6afe3ec4899080fc17b9e1fd896ab54c8d.patch
Parent Directory | Revision Log
Revision 1061 -
(hide annotations)
(download)
Sat Jul 17 09:04:47 2010 UTC (14 years, 2 months ago) by niro
File size: 21407 byte(s)
Sat Jul 17 09:04:47 2010 UTC (14 years, 2 months ago) by niro
File size: 21407 byte(s)
kde-qt patch for qt-4.6.3
1 | niro | 1061 | diff --git a/README.kde-qt b/README.kde-qt |
2 | new file mode 100644 | ||
3 | index 0000000..cbbd970 | ||
4 | --- /dev/null | ||
5 | +++ b/README.kde-qt | ||
6 | @@ -0,0 +1,269 @@ | ||
7 | +This is a patched version of Qt. It may include changes made by KDE | ||
8 | +and Qt developers that have either not been accepted for inclusion | ||
9 | +into Qt, or have been accepted for a later version of Qt than this | ||
10 | +one. | ||
11 | + | ||
12 | +1. Configuring Qt | ||
13 | +================= | ||
14 | + | ||
15 | +The recommended compile line is: | ||
16 | + | ||
17 | +--default-config-begin-- | ||
18 | + | ||
19 | + ./configure -qt-gif -debug -fast -no-separate-debug-info \ | ||
20 | + -system-libpng -system-libjpeg -system-zlib \ | ||
21 | + -dbus -webkit -plugin-sql-mysql \ | ||
22 | + -nomake examples -nomake demos -prefix <installdir> | ||
23 | + | ||
24 | +--default-config-end-- | ||
25 | + | ||
26 | +It contains "-debug", which greatly improves the use for backtraces (but | ||
27 | +also needs a lot more disk space and makes things slower). To build in | ||
28 | +release mode, replace it with "-release". | ||
29 | + | ||
30 | +It also contains "-no-separate-debug-info", which disables separate .debug | ||
31 | +files. Instead, the debug information will be built into the libraries. | ||
32 | +This option is needed when you install Qt. | ||
33 | + | ||
34 | +If you don't install Qt, it can be useful to disable this option, | ||
35 | +thus having separate debug symbol files. With separate debug files, you can | ||
36 | +just move those debug files to another directory to remove Qt debug symbols. | ||
37 | +Moving the files back will enable Qt debug symbols again. | ||
38 | +This is useful if you rarely need to step into Qt functions during debugging, | ||
39 | +because GDB loads much faster and uses less memory without Qt debug symbols. | ||
40 | +In the rare case you need to step into Qt code, you can temporarily enable | ||
41 | +debug symbols again by moving the debug files back. You can even load the Qt | ||
42 | +debug symbols from within GDB on demand, using the "symbol-file" command. | ||
43 | + | ||
44 | +If you are planning to compile Qt using an Icecream cluster you have to | ||
45 | +pass the option -no-pch (no precompiled headers) to configure to make | ||
46 | +distributed compilation work. | ||
47 | + | ||
48 | +2. Compiling Qt | ||
49 | +=============== | ||
50 | + | ||
51 | +To compile Qt on a Unix platform, run: | ||
52 | + | ||
53 | + export MAKEFLAGS=-j2 | ||
54 | + make | ||
55 | + make install | ||
56 | + | ||
57 | +If your computer has more than one core or processor, you may consider | ||
58 | +increasing the "2" above. If you've got a compile farm available, you | ||
59 | +should adjust the -j argument to match the number of slots in that | ||
60 | +farm. | ||
61 | + | ||
62 | +3. Modifying & rebuilding Qt | ||
63 | +============================ | ||
64 | + | ||
65 | +If you make modifications to the Qt source code, you don't need to | ||
66 | +build everything again. Simply go to the directory containing the | ||
67 | +Makefile closest to the files you changed and run "make" again. | ||
68 | + | ||
69 | +For example, if you've modified src/corelib/io/qiodevice.cpp, do: | ||
70 | + | ||
71 | + cd src/corelib | ||
72 | + make | ||
73 | + | ||
74 | +If you make a change that is not temporary, you should create a Git | ||
75 | +commit out of it. However, you shouldn't push those changes to | ||
76 | +kde-qt.git. If you have a fix that benefit others, see the "Creating | ||
77 | +kde-qt.git modifications" section below. | ||
78 | + | ||
79 | +4. Building Qt examples and demos | ||
80 | +================================= | ||
81 | + | ||
82 | +The "-nomake examples -nomake demos" arguments to the configure script | ||
83 | +mean that those two sections will not be configured for building, | ||
84 | +which is unneeded for usage of the library. If you want to compile | ||
85 | +the examples or demos later, just enter either directory and type: | ||
86 | + | ||
87 | + qmake | ||
88 | + make | ||
89 | + | ||
90 | +5. Build Qt tests | ||
91 | +================= | ||
92 | + | ||
93 | +(Official information: http://qt.gitorious.org/qt/pages/QtAutotestsEnvironment) | ||
94 | + | ||
95 | +In order to run Qt tests, you must have a "developer build" of Qt. For | ||
96 | +that, you need to reconfigure Qt and add the "-developer-build" | ||
97 | +option. That option is technically equivalent to the options: | ||
98 | + | ||
99 | + -debug -prefix $PWD -DQT_BUILD_INTERNAL | ||
100 | + | ||
101 | +To run a test, go to its source dir in tests/auto/testname. Type | ||
102 | +"make" to build it, then run it (either ./tst_testname, or "make install"). | ||
103 | + | ||
104 | +6. Building Qt documentation | ||
105 | +============================ | ||
106 | + | ||
107 | +To build and install the documentation, run: | ||
108 | + | ||
109 | + make docs | ||
110 | + ./config.status | ||
111 | + make install | ||
112 | + | ||
113 | +It is necessary to do this once only, even if you rebuild Qt later. | ||
114 | + | ||
115 | +7. Using Qt uninstalled | ||
116 | +======================= | ||
117 | + | ||
118 | +To use without having to install it, configure it as follows: | ||
119 | + | ||
120 | + ./configure <other configure options> -prefix $PWD | ||
121 | + make sub-src | ||
122 | + make sub-tools | ||
123 | + | ||
124 | +Attention: DO NOT run | ||
125 | + | ||
126 | + make install | ||
127 | + | ||
128 | +If you do, Qt will overwrite your include/ directory with its | ||
129 | +installation. | ||
130 | + | ||
131 | +8. Creating kde-qt.git modifications | ||
132 | +==================================== | ||
133 | + | ||
134 | +If you have fixed a bug in Qt or modified it in any way that may | ||
135 | +benefit others, please share your change in the form of a patch. Do | ||
136 | +not commit your changes directly to the main branch because they | ||
137 | +may be lost in a future update if they have not been added to the | ||
138 | +official Qt release. | ||
139 | + | ||
140 | +The exception to the above rule is that if the fix has been accepted | ||
141 | +by the Qt developers (and so will appear in the very next release of | ||
142 | +Qt), then it should be simply cherry-picked from the Qt development | ||
143 | +branch. Note that you shouldn't do this for changes that have been | ||
144 | +accepted into a release which is not the very next. In this case, you | ||
145 | +should use the following command: | ||
146 | + | ||
147 | + git cherry-pick -x SHA1_OF_THE_FIX | ||
148 | +where SHA1_OF_THE_FIX is the SHA-1 of the commit that you want to | ||
149 | +introduce. Then push the change to the server. | ||
150 | + | ||
151 | +In all other cases, before creating a patch, it is recommended to | ||
152 | +contact the Qt developers via a new task in | ||
153 | +http://bugreports.qt.nokia.com and explain the situation. There may be | ||
154 | +a solution for the problem already or a new direction that should be | ||
155 | +accounted for. | ||
156 | + | ||
157 | +To create a patch, do the following: | ||
158 | + a) look at the listing of branches in | ||
159 | + http://qt.gitorious.org/+kde-developers/qt/kde-qt/commits/HEAD and | ||
160 | + select the next number. | ||
161 | + | ||
162 | + b) create a new branch out of a clean, released version of Qt, (for | ||
163 | + example, 4.5.1), using the number above and a brief description of | ||
164 | + your fix. For example: | ||
165 | + git checkout -b patches/0180-window-role v4.5.1 | ||
166 | + You can see the available released versions of Qt with: | ||
167 | + git tag | ||
168 | + | ||
169 | + c) make your changes to the Qt source code and verify that it | ||
170 | + compiles, links and works (please run the respective unit tests from | ||
171 | + tests/auto in the source tree). | ||
172 | + | ||
173 | + c) commit your changes to Git, using the "git commit" command. Please | ||
174 | + see http://qt.gitorious.org/qt/pages/GitIntroductionWithQt and | ||
175 | + http://qt.gitorious.org/qt/pages/QtCodingStyle for information on | ||
176 | + how to create commits | ||
177 | + | ||
178 | + Note that you are allowed to create as many commits as necessary to | ||
179 | + accomplish a working change that can be easily reviewed. | ||
180 | + | ||
181 | + e) merge the change to the patch branch, for example, 4.5.1-patched: | ||
182 | + git checkout 4.5.1-patched | ||
183 | + git merge patches/0180-window-role | ||
184 | + | ||
185 | + f) merge the patch branch to master: | ||
186 | + git checkout master | ||
187 | + git merge 4.5.1-patched | ||
188 | + | ||
189 | + g) push the changes you made to your branch and to the main server: | ||
190 | + git push git@gitorious.org:qt/kde-qt.git master 4.5.1-patched patches/0180-window-role | ||
191 | + (Don't forget to list all 3 branch names) | ||
192 | + | ||
193 | +Don't forget to submit your patch to using the Qt Contribution Model, | ||
194 | +along with the long description of the issue found. See | ||
195 | +http://qt.gitorious.org/qt/pages/QtContributionGuidelines for | ||
196 | +information how. You can submit the branch you've just sent to the | ||
197 | +server. | ||
198 | + | ||
199 | +9. Troubleshooting: Re-configuring and re-compiling | ||
200 | +=================================================== | ||
201 | + | ||
202 | +For those updating the source in a directory where Qt has already | ||
203 | +been compiled, you may need to run the following commands from the | ||
204 | +top directory of your Qt sources: | ||
205 | + | ||
206 | + find . -name '*.moc' | xargs rm | ||
207 | + | ||
208 | +Sometimes ./configure will refuse to run. You may need to: | ||
209 | + rm .qmake.cache | ||
210 | + | ||
211 | +If you think you may have run "make install" on an install-less Qt | ||
212 | +(srcdir == $QTDIR), run: | ||
213 | + | ||
214 | + rm -rf include | ||
215 | + bin/syncqt | ||
216 | + | ||
217 | +10. Maintenance: updating kde-qt to a newer Qt version | ||
218 | +====================================================== | ||
219 | + | ||
220 | +When a new version of Qt is released, do the following to update the | ||
221 | +repository (assuming Qt 4.6.1 is the release you're updating to): | ||
222 | + | ||
223 | + a) rebase each of the individual patches against this new version. | ||
224 | + for branch in patches/*; do | ||
225 | + git checkout -b $branch origin/$branch | ||
226 | + git rebase v4.6.1 | ||
227 | + resolve conflicts | ||
228 | + done # Note: pseudo-shell, don't try to run this | ||
229 | + | ||
230 | + If a given branch is no longer valid (it's been applied to this Qt | ||
231 | + version), then delete it on the server: | ||
232 | + git push origin :$branch | ||
233 | + | ||
234 | + b) create a new "patched" branch locally, starting on the release tag: | ||
235 | + git checkout -b 4.6.1-patched v4.6.1 | ||
236 | + | ||
237 | + c) merge the patch branches and the README branch, one by one. There | ||
238 | + should be no conflicts at this stage; if there are, it indicates | ||
239 | + one patch conflicts with another. | ||
240 | + git merge patches/0997-patch1 | ||
241 | + git merge patches/0998-patch2 | ||
242 | + git merge patches/0999-patch3 | ||
243 | + # etc. | ||
244 | + git merge README | ||
245 | + | ||
246 | + d) overwrite the master branch's contents with the new branch. If the | ||
247 | + Git merge strategy "theirs" exist (it doesn't as of Git 1.6), use | ||
248 | + it: | ||
249 | + git checkout master | ||
250 | + git merge -s theirs 4.6.1-patched | ||
251 | + | ||
252 | + If it doesn't exist, do the equivalent by inverting the point of | ||
253 | + view: | ||
254 | + git checkout -b tmp 4.6.1-patched | ||
255 | + git merge -s ours master | ||
256 | + git checkout master | ||
257 | + git merge tmp | ||
258 | + git branch -d tmp | ||
259 | + | ||
260 | + Also possible using Git plumbing: | ||
261 | + git checkout master | ||
262 | + git merge -s ours --no-commit 4.6.1-patched | ||
263 | + rm .git/index | ||
264 | + git read-tree 4.6.1-patched | ||
265 | + git commit | ||
266 | + | ||
267 | + e) push everything to kde-qt.git, including the new Qt. Note that | ||
268 | + the individiual patch branches will require force, because they | ||
269 | + have been rebased (that is, the new branch tip is no longer a | ||
270 | + direct descendant of the previous tip). | ||
271 | + | ||
272 | + # Push the individual patch branches with force | ||
273 | + git push -f origin patches/0997-patch1 patches/0998-patch2 patches/0999-patch3 etc | ||
274 | + # Push the tag, the new patched branch and master | ||
275 | + git push v4.6.1 4.6.1-patched master | ||
276 | diff --git a/bin/syncqt b/bin/syncqt | ||
277 | index db6dce6..3f88525 100755 | ||
278 | --- a/bin/syncqt | ||
279 | +++ b/bin/syncqt | ||
280 | @@ -378,9 +378,13 @@ sub fixPaths { | ||
281 | $match_dir = $tmp; | ||
282 | $i = $slash; | ||
283 | } | ||
284 | + my $cnt_ofs = 0; | ||
285 | + if($match_dir =~ /^[a-zA-Z]:$/) { | ||
286 | + $cnt_ofs = 1; | ||
287 | + } | ||
288 | if($match_dir) { | ||
289 | my $after = substr($dir, length($match_dir)); | ||
290 | - my $count = ($after =~ tr,/,,); | ||
291 | + my $count = ($after =~ tr,/,,) - $cnt_ofs; | ||
292 | my $dots = ""; | ||
293 | for(my $i = 0; $i < $count; $i++) { | ||
294 | $dots .= "../"; | ||
295 | diff --git a/configure b/configure | ||
296 | index ca14279..d70a076 100755 | ||
297 | --- a/configure | ||
298 | +++ b/configure | ||
299 | @@ -1031,6 +1031,11 @@ while [ "$#" -gt 0 ]; do | ||
300 | VAL=`echo $1 | sed 's,-D,,'` | ||
301 | fi | ||
302 | ;; | ||
303 | + -isystem) | ||
304 | + VAR="add_isystempath" | ||
305 | + shift | ||
306 | + VAL="$1" | ||
307 | + ;; | ||
308 | -I?*|-I) | ||
309 | VAR="add_ipath" | ||
310 | if [ "$1" = "-I" ]; then | ||
311 | @@ -2049,6 +2054,9 @@ while [ "$#" -gt 0 ]; do | ||
312 | add_ipath) | ||
313 | I_FLAGS="$I_FLAGS -I\"${VAL}\"" | ||
314 | ;; | ||
315 | + add_isystempath) | ||
316 | + I_FLAGS="$I_FLAGS -isystem \"${VAL}\"" | ||
317 | + ;; | ||
318 | add_lpath) | ||
319 | L_FLAGS="$L_FLAGS -L\"${VAL}\"" | ||
320 | ;; | ||
321 | diff --git a/qmake/property.cpp b/qmake/property.cpp | ||
322 | index 2a3351b..8f1de34 100644 | ||
323 | --- a/qmake/property.cpp | ||
324 | +++ b/qmake/property.cpp | ||
325 | @@ -81,29 +81,32 @@ QMakeProperty::keyBase(bool version) const | ||
326 | QString | ||
327 | QMakeProperty::value(QString v, bool just_check) | ||
328 | { | ||
329 | + QString ret; | ||
330 | if(v == "QT_INSTALL_PREFIX") | ||
331 | - return QLibraryInfo::location(QLibraryInfo::PrefixPath); | ||
332 | + ret = QLibraryInfo::location(QLibraryInfo::PrefixPath); | ||
333 | else if(v == "QT_INSTALL_DATA") | ||
334 | - return QLibraryInfo::location(QLibraryInfo::DataPath); | ||
335 | + ret = QLibraryInfo::location(QLibraryInfo::DataPath); | ||
336 | else if(v == "QT_INSTALL_DOCS") | ||
337 | - return QLibraryInfo::location(QLibraryInfo::DocumentationPath); | ||
338 | + ret = QLibraryInfo::location(QLibraryInfo::DocumentationPath); | ||
339 | else if(v == "QT_INSTALL_HEADERS") | ||
340 | - return QLibraryInfo::location(QLibraryInfo::HeadersPath); | ||
341 | + ret = QLibraryInfo::location(QLibraryInfo::HeadersPath); | ||
342 | else if(v == "QT_INSTALL_LIBS") | ||
343 | - return QLibraryInfo::location(QLibraryInfo::LibrariesPath); | ||
344 | + ret = QLibraryInfo::location(QLibraryInfo::LibrariesPath); | ||
345 | else if(v == "QT_INSTALL_BINS") | ||
346 | - return QLibraryInfo::location(QLibraryInfo::BinariesPath); | ||
347 | + ret = QLibraryInfo::location(QLibraryInfo::BinariesPath); | ||
348 | else if(v == "QT_INSTALL_PLUGINS") | ||
349 | - return QLibraryInfo::location(QLibraryInfo::PluginsPath); | ||
350 | + ret = QLibraryInfo::location(QLibraryInfo::PluginsPath); | ||
351 | else if(v == "QT_INSTALL_TRANSLATIONS") | ||
352 | - return QLibraryInfo::location(QLibraryInfo::TranslationsPath); | ||
353 | + ret = QLibraryInfo::location(QLibraryInfo::TranslationsPath); | ||
354 | else if(v == "QT_INSTALL_CONFIGURATION") | ||
355 | - return QLibraryInfo::location(QLibraryInfo::SettingsPath); | ||
356 | + ret = QLibraryInfo::location(QLibraryInfo::SettingsPath); | ||
357 | else if(v == "QT_INSTALL_EXAMPLES") | ||
358 | - return QLibraryInfo::location(QLibraryInfo::ExamplesPath); | ||
359 | + ret = QLibraryInfo::location(QLibraryInfo::ExamplesPath); | ||
360 | else if(v == "QT_INSTALL_DEMOS") | ||
361 | - return QLibraryInfo::location(QLibraryInfo::DemosPath); | ||
362 | - else if(v == "QMAKE_MKSPECS") | ||
363 | + ret = QLibraryInfo::location(QLibraryInfo::DemosPath); | ||
364 | + if(!ret.isEmpty()) | ||
365 | + return QDir::toNativeSeparators(ret); | ||
366 | + if(v == "QMAKE_MKSPECS") | ||
367 | return qmake_mkspec_paths().join(Option::target_mode == Option::TARG_WIN_MODE ? ";" : ":"); | ||
368 | else if(v == "QMAKE_VERSION") | ||
369 | return qmake_version(); | ||
370 | @@ -116,7 +119,7 @@ QMakeProperty::value(QString v, bool just_check) | ||
371 | int slash = v.lastIndexOf('/'); | ||
372 | QVariant var = settings->value(keyBase(slash == -1) + v); | ||
373 | bool ok = var.isValid(); | ||
374 | - QString ret = var.toString(); | ||
375 | + ret = var.toString(); | ||
376 | if(!ok) { | ||
377 | QString version = qmake_version(); | ||
378 | if(slash != -1) { | ||
379 | diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp | ||
380 | index 23a78ed..88e15ef 100644 | ||
381 | --- a/src/corelib/kernel/qobject.cpp | ||
382 | +++ b/src/corelib/kernel/qobject.cpp | ||
383 | @@ -1124,8 +1124,16 @@ void QObject::setObjectName(const QString &name) | ||
384 | { | ||
385 | Q_D(QObject); | ||
386 | d->objectName = name; | ||
387 | +#if defined(Q_WS_X11) | ||
388 | + d->checkWindowRole(); | ||
389 | +#endif | ||
390 | } | ||
391 | |||
392 | +#if defined(Q_WS_X11) | ||
393 | +void QObjectPrivate::checkWindowRole() | ||
394 | +{ | ||
395 | +} | ||
396 | +#endif | ||
397 | |||
398 | #ifdef QT3_SUPPORT | ||
399 | /*! \internal | ||
400 | diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h | ||
401 | index 363d24c..dd9e0e1 100644 | ||
402 | --- a/src/corelib/kernel/qobject_p.h | ||
403 | +++ b/src/corelib/kernel/qobject_p.h | ||
404 | @@ -83,7 +83,9 @@ void Q_CORE_EXPORT qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet | ||
405 | |||
406 | extern QSignalSpyCallbackSet Q_CORE_EXPORT qt_signal_spy_callback_set; | ||
407 | |||
408 | -enum { QObjectPrivateVersion = QT_VERSION }; | ||
409 | +// add 0x1000000 to mark it as qt-copy version, with possible modifications | ||
410 | +// in some Q*Private class | ||
411 | +enum { QObjectPrivateVersion = QT_VERSION + 0x1000000 }; | ||
412 | |||
413 | class Q_CORE_EXPORT QDeclarativeData | ||
414 | { | ||
415 | @@ -157,6 +159,9 @@ public: | ||
416 | void sendPendingChildInsertedEvents(); | ||
417 | void removePendingChildInsertedEvents(QObject *child); | ||
418 | #endif | ||
419 | +#if defined(Q_WS_X11) | ||
420 | + virtual void checkWindowRole(); | ||
421 | +#endif | ||
422 | |||
423 | static Sender *setCurrentSender(QObject *receiver, | ||
424 | Sender *sender); | ||
425 | diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp | ||
426 | index f4874b1..94df66e 100644 | ||
427 | --- a/src/gui/kernel/qapplication.cpp | ||
428 | +++ b/src/gui/kernel/qapplication.cpp | ||
429 | @@ -763,6 +763,10 @@ void QApplicationPrivate::construct( | ||
430 | |||
431 | qt_is_gui_used = (qt_appType != QApplication::Tty); | ||
432 | process_cmdline(); | ||
433 | + // the environment variable has the lowest precedence of runtime graphicssystem switches | ||
434 | + if (graphics_system_name.isEmpty()) { | ||
435 | + graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); | ||
436 | + } | ||
437 | // Must be called before initialize() | ||
438 | qt_init(this, qt_appType | ||
439 | #ifdef Q_WS_X11 | ||
440 | diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h | ||
441 | index 9d32a70..cdf9551 100644 | ||
442 | --- a/src/gui/kernel/qwidget_p.h | ||
443 | +++ b/src/gui/kernel/qwidget_p.h | ||
444 | @@ -696,6 +696,7 @@ public: | ||
445 | static QWidget *keyboardGrabber; | ||
446 | |||
447 | void setWindowRole(); | ||
448 | + virtual void checkWindowRole(); | ||
449 | void sendStartupMessage(const char *message) const; | ||
450 | void setNetWmWindowTypes(); | ||
451 | void x11UpdateIsOpaque(); | ||
452 | diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp | ||
453 | index 9c64fbc..391e489 100644 | ||
454 | --- a/src/gui/kernel/qwidget_x11.cpp | ||
455 | +++ b/src/gui/kernel/qwidget_x11.cpp | ||
456 | @@ -762,6 +762,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO | ||
457 | Q_ASSERT(id); | ||
458 | XChangeWindowAttributes(dpy, id, CWOverrideRedirect | CWSaveUnder, | ||
459 | &wsa); | ||
460 | + XClassHint class_hint; | ||
461 | + QByteArray appName = qAppName().toLatin1(); | ||
462 | + class_hint.res_name = appName.data(); // application name | ||
463 | + class_hint.res_class = const_cast<char *>(QX11Info::appClass()); // application class | ||
464 | + XSetWMProperties(dpy, id, 0, 0, 0, 0, 0, 0, &class_hint); | ||
465 | } else if (topLevel && !desktop) { // top-level widget | ||
466 | if (!X11->wm_client_leader) | ||
467 | create_wm_client_leader(); | ||
468 | @@ -815,32 +820,40 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO | ||
469 | // set EWMH window types | ||
470 | setNetWmWindowTypes(); | ||
471 | |||
472 | + // when we create a toplevel widget, the frame strut should be dirty | ||
473 | + data.fstrut_dirty = 1; | ||
474 | + | ||
475 | + } else { | ||
476 | + // non-toplevel widgets don't have a frame, so no need to | ||
477 | + // update the strut | ||
478 | + data.fstrut_dirty = 0; | ||
479 | + } | ||
480 | + | ||
481 | + if (initializeWindow && (popup || (topLevel && !desktop))) { // properties set on all toplevel windows | ||
482 | // set _NET_WM_PID | ||
483 | long curr_pid = getpid(); | ||
484 | XChangeProperty(dpy, id, ATOM(_NET_WM_PID), XA_CARDINAL, 32, PropModeReplace, | ||
485 | (unsigned char *) &curr_pid, 1); | ||
486 | |||
487 | - // when we create a toplevel widget, the frame strut should be dirty | ||
488 | - data.fstrut_dirty = 1; | ||
489 | |||
490 | // declare the widget's window role | ||
491 | + QByteArray windowRole; | ||
492 | if (QTLWExtra *topData = maybeTopData()) { | ||
493 | - if (!topData->role.isEmpty()) { | ||
494 | - QByteArray windowRole = topData->role.toUtf8(); | ||
495 | - XChangeProperty(dpy, id, | ||
496 | - ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace, | ||
497 | - (unsigned char *)windowRole.constData(), windowRole.length()); | ||
498 | - } | ||
499 | + if (!topData->role.isEmpty()) | ||
500 | + windowRole = topData->role.toUtf8(); | ||
501 | + } | ||
502 | + if (windowRole.isEmpty()) // use object name as a fallback | ||
503 | + windowRole = objectName.toUtf8(); | ||
504 | + if (!windowRole.isEmpty()) { | ||
505 | + XChangeProperty(dpy, id, | ||
506 | + ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace, | ||
507 | + (unsigned char *)windowRole.constData(), windowRole.length()); | ||
508 | } | ||
509 | |||
510 | // set client leader property | ||
511 | XChangeProperty(dpy, id, ATOM(WM_CLIENT_LEADER), | ||
512 | XA_WINDOW, 32, PropModeReplace, | ||
513 | (unsigned char *)&X11->wm_client_leader, 1); | ||
514 | - } else { | ||
515 | - // non-toplevel widgets don't have a frame, so no need to | ||
516 | - // update the strut | ||
517 | - data.fstrut_dirty = 0; | ||
518 | } | ||
519 | |||
520 | if (initializeWindow && q->internalWinId()) { | ||
521 | @@ -2918,6 +2931,17 @@ void QWidgetPrivate::setWindowRole() | ||
522 | (unsigned char *)windowRole.constData(), windowRole.length()); | ||
523 | } | ||
524 | |||
525 | +void QWidgetPrivate::checkWindowRole() | ||
526 | +{ | ||
527 | + Q_Q(QWidget); | ||
528 | + if( !q->windowRole().isEmpty() || !q->internalWinId()) | ||
529 | + return; | ||
530 | + QByteArray windowRole = objectName.toUtf8(); // use as a fallback | ||
531 | + XChangeProperty(X11->display, q->internalWinId(), | ||
532 | + ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace, | ||
533 | + (unsigned char *)windowRole.constData(), windowRole.length()); | ||
534 | +} | ||
535 | + | ||
536 | Q_GLOBAL_STATIC(QX11PaintEngine, qt_widget_paintengine) | ||
537 | QPaintEngine *QWidget::paintEngine() const | ||
538 | { | ||
539 | diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp | ||
540 | index 7933f10..9fff46e 100644 | ||
541 | --- a/src/gui/widgets/qtabbar.cpp | ||
542 | +++ b/src/gui/widgets/qtabbar.cpp | ||
543 | @@ -717,8 +717,8 @@ void QTabBarPrivate::refresh() | ||
544 | layoutTabs(); | ||
545 | makeVisible(currentIndex); | ||
546 | q->update(); | ||
547 | - q->updateGeometry(); | ||
548 | } | ||
549 | + q->updateGeometry(); | ||
550 | } | ||
551 | |||
552 | /*! | ||
553 | diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp | ||
554 | index df508c4..7715feb 100644 | ||
555 | --- a/src/tools/moc/main.cpp | ||
556 | +++ b/src/tools/moc/main.cpp | ||
557 | @@ -94,7 +94,13 @@ static QByteArray combinePath(const char *infile, const char *outfile) | ||
558 | inSplitted.prepend(QLatin1String("..")); | ||
559 | } | ||
560 | inSplitted.append(inFileInfo.fileName()); | ||
561 | +#ifdef Q_WS_WIN | ||
562 | + const QString rel = inSplitted.join(QLatin1String("/")); | ||
563 | + const QString abs = inFileInfo.absoluteFilePath(); | ||
564 | + return QFile::encodeName(rel.length() < abs.length() ? rel : abs); | ||
565 | +#else | ||
566 | return QFile::encodeName(inSplitted.join(QLatin1String("/"))); | ||
567 | +#endif | ||
568 | } | ||
569 | |||
570 |