Magellan Linux

Contents of /trunk/qt4/patches/qt-4.5.3-kde-qt-063bded33b417cdf92fd51366fc7fdb06dea00ba.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 918 - (show annotations) (download)
Fri Oct 30 18:39:48 2009 UTC (14 years, 6 months ago) by niro
File size: 73315 byte(s)
more patches

1 diff --git a/README.kde-qt b/README.kde-qt
2 new file mode 100644
3 index 0000000..db3feb6
4 --- /dev/null
5 +++ b/README.kde-qt
6 @@ -0,0 +1,201 @@
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 Qt Software (and so will appear in the very next release of Qt),
142 +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.
145 +In this case, you 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 +Before creating a patch, it is recommended to contact Qt Software
152 +support via qt-bugs@trolltech.com and explain the situation. There may
153 +be a solution for the problem already or a new direction that should
154 +be accounted for.
155 +
156 +To create a patch, do the following:
157 + a) look at the listing of branches in
158 + http://qt.gitorious.org/+kde-developers/qt/kde-qt/commits/HEAD and
159 + select the next number.
160 +
161 + b) create a new branch out of a clean, released version of Qt, (for
162 + example, 4.5.1), using the number above and a brief description of
163 + your fix. For example:
164 + git checkout -b patches/0180-window-role v4.5.1
165 + You can see the available released versions of Qt with:
166 + git tag
167 +
168 + c) make your changes to the Qt source code and verify that it
169 + compiles, links and works (please run the respective unit tests).
170 +
171 + c) commit your changes to Git, using the "git commit" command. Please
172 + see http://qt.gitorious.org/qt/pages/GitIntroductionWithQt and
173 + http://qt.gitorious.org/qt/pages/QtCodingStyle for information on
174 + how to create commits
175 + Note that you can create multiple commits.
176 +
177 + e) merge the change to the main branch, for example, 4.5.1-patched:
178 + git checkout 4.5.1-patched
179 + git merge patches/0180-window-role
180 +
181 + f) push the changes you made to your branch and to the main server:
182 + git push git@gitorious.org:qt/kde-qt.git 4.5.1-patched patches/0180-window-role
183 + (Don't forget to list both branch names)
184 +
185 +Don't forget to submit your patch to using the Qt Contribution Model,
186 +along with the long description of the issue found. See
187 +http://qt.gitorious.org/qt/pages/QtContributionGuidelines for
188 +information how. You can submit the branch you've just sent to the
189 +server.
190 +
191 +9. Troubleshooting: Re-configuring and re-compiling
192 +==================================================
193 +
194 +For those updating the source in a directory where Qt has already
195 +been compiled, you may need to run the following commands from the
196 +top directory of your Qt sources:
197 +
198 + find . -name '*.moc' | xargs rm
199 +
200 +Sometimes ./configure will refuse to run. You may need to:
201 + rm .qmake.cache
202 +
203 +If you think you may have run "make install" on an install-less Qt
204 +(srcdir == $QTDIR), run:
205 +
206 + rm -rf include
207 + bin/syncqt
208 diff --git a/bin/syncqt b/bin/syncqt
209 index edabeca..e71d480 100755
210 --- a/bin/syncqt
211 +++ b/bin/syncqt
212 @@ -363,9 +363,13 @@ sub fixPaths {
213 $match_dir = $tmp;
214 $i = $slash;
215 }
216 + my $cnt_ofs = 0;
217 + if($match_dir =~ /^[a-zA-Z]:$/) {
218 + $cnt_ofs = 1;
219 + }
220 if($match_dir) {
221 my $after = substr($dir, length($match_dir));
222 - my $count = ($after =~ tr,/,,);
223 + my $count = ($after =~ tr,/,,) - $cnt_ofs;
224 my $dots = "";
225 for(my $i = 0; $i < $count; $i++) {
226 $dots .= "../";
227 diff --git a/configure b/configure
228 index 4ea1ad0..b28a1fa 100755
229 --- a/configure
230 +++ b/configure
231 @@ -960,6 +960,11 @@ while [ "$#" -gt 0 ]; do
232 VAL=`echo $1 | sed 's,-D,,'`
233 fi
234 ;;
235 + -isystem)
236 + VAR="add_isystempath"
237 + shift
238 + VAL="$1"
239 + ;;
240 -I?*|-I)
241 VAR="add_ipath"
242 if [ "$1" = "-I" ]; then
243 @@ -1930,6 +1935,9 @@ while [ "$#" -gt 0 ]; do
244 add_ipath)
245 I_FLAGS="$I_FLAGS -I\"${VAL}\""
246 ;;
247 + add_isystempath)
248 + I_FLAGS="$I_FLAGS -isystem \"${VAL}\""
249 + ;;
250 add_lpath)
251 L_FLAGS="$L_FLAGS -L\"${VAL}\""
252 ;;
253 diff --git a/projects.pro b/projects.pro
254 index f6c596d..79420d2 100644
255 --- a/projects.pro
256 +++ b/projects.pro
257 @@ -131,6 +131,9 @@ unix {
258 DEFAULT_QMAKESPEC ~= s,^.*mkspecs/,,g
259 mkspecs.commands += $(DEL_FILE) $(INSTALL_ROOT)$$mkspecs.path/default; $(SYMLINK) $$DEFAULT_QMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default
260 }
261 +win32 {
262 + mkspecs.files += $$QT_BUILD_TREE/mkspecs/default
263 +}
264 INSTALLS += mkspecs
265
266 false:macx { #mac install location
267 diff --git a/qmake/property.cpp b/qmake/property.cpp
268 index ea4842a..ac54854 100644
269 --- a/qmake/property.cpp
270 +++ b/qmake/property.cpp
271 @@ -81,29 +81,32 @@ QMakeProperty::keyBase(bool version) const
272 QString
273 QMakeProperty::value(QString v, bool just_check)
274 {
275 + QString ret;
276 if(v == "QT_INSTALL_PREFIX")
277 - return QLibraryInfo::location(QLibraryInfo::PrefixPath);
278 + ret = QLibraryInfo::location(QLibraryInfo::PrefixPath);
279 else if(v == "QT_INSTALL_DATA")
280 - return QLibraryInfo::location(QLibraryInfo::DataPath);
281 + ret = QLibraryInfo::location(QLibraryInfo::DataPath);
282 else if(v == "QT_INSTALL_DOCS")
283 - return QLibraryInfo::location(QLibraryInfo::DocumentationPath);
284 + ret = QLibraryInfo::location(QLibraryInfo::DocumentationPath);
285 else if(v == "QT_INSTALL_HEADERS")
286 - return QLibraryInfo::location(QLibraryInfo::HeadersPath);
287 + ret = QLibraryInfo::location(QLibraryInfo::HeadersPath);
288 else if(v == "QT_INSTALL_LIBS")
289 - return QLibraryInfo::location(QLibraryInfo::LibrariesPath);
290 + ret = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
291 else if(v == "QT_INSTALL_BINS")
292 - return QLibraryInfo::location(QLibraryInfo::BinariesPath);
293 + ret = QLibraryInfo::location(QLibraryInfo::BinariesPath);
294 else if(v == "QT_INSTALL_PLUGINS")
295 - return QLibraryInfo::location(QLibraryInfo::PluginsPath);
296 + ret = QLibraryInfo::location(QLibraryInfo::PluginsPath);
297 else if(v == "QT_INSTALL_TRANSLATIONS")
298 - return QLibraryInfo::location(QLibraryInfo::TranslationsPath);
299 + ret = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
300 else if(v == "QT_INSTALL_CONFIGURATION")
301 - return QLibraryInfo::location(QLibraryInfo::SettingsPath);
302 + ret = QLibraryInfo::location(QLibraryInfo::SettingsPath);
303 else if(v == "QT_INSTALL_EXAMPLES")
304 - return QLibraryInfo::location(QLibraryInfo::ExamplesPath);
305 + ret = QLibraryInfo::location(QLibraryInfo::ExamplesPath);
306 else if(v == "QT_INSTALL_DEMOS")
307 - return QLibraryInfo::location(QLibraryInfo::DemosPath);
308 - else if(v == "QMAKE_MKSPECS")
309 + ret = QLibraryInfo::location(QLibraryInfo::DemosPath);
310 + if(!ret.isEmpty())
311 + return QDir::toNativeSeparators(ret);
312 + if(v == "QMAKE_MKSPECS")
313 return qmake_mkspec_paths().join(Option::target_mode == Option::TARG_WIN_MODE ? ";" : ":");
314 else if(v == "QMAKE_VERSION")
315 return qmake_version();
316 @@ -116,7 +119,7 @@ QMakeProperty::value(QString v, bool just_check)
317 int slash = v.lastIndexOf('/');
318 QVariant var = settings->value(keyBase(slash == -1) + v);
319 bool ok = var.isValid();
320 - QString ret = var.toString();
321 + ret = var.toString();
322 if(!ok) {
323 QString version = qmake_version();
324 if(slash != -1) {
325 diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
326 index ac2ad34..58d7df0 100644
327 --- a/src/corelib/global/qnamespace.h
328 +++ b/src/corelib/global/qnamespace.h
329 @@ -895,12 +895,10 @@ public:
330 Key_Dead_Horn = 0x01001262,
331
332 // multimedia/internet keys - ignored by default - see QKeyEvent c'tor
333 -
334 Key_Back = 0x01000061,
335 Key_Forward = 0x01000062,
336 Key_Stop = 0x01000063,
337 Key_Refresh = 0x01000064,
338 -
339 Key_VolumeDown = 0x01000070,
340 Key_VolumeMute = 0x01000071,
341 Key_VolumeUp = 0x01000072,
342 @@ -909,7 +907,6 @@ public:
343 Key_BassDown = 0x01000075,
344 Key_TrebleUp = 0x01000076,
345 Key_TrebleDown = 0x01000077,
346 -
347 Key_MediaPlay = 0x01000080,
348 Key_MediaStop = 0x01000081,
349 Key_MediaPrevious = 0x01000082,
350 @@ -918,13 +915,11 @@ public:
351 #endif
352 Key_MediaNext = 0x01000083,
353 Key_MediaRecord = 0x01000084,
354 -
355 Key_HomePage = 0x01000090,
356 Key_Favorites = 0x01000091,
357 Key_Search = 0x01000092,
358 Key_Standby = 0x01000093,
359 Key_OpenUrl = 0x01000094,
360 -
361 Key_LaunchMail = 0x010000a0,
362 Key_LaunchMedia = 0x010000a1,
363 Key_Launch0 = 0x010000a2,
364 @@ -943,6 +938,98 @@ public:
365 Key_LaunchD = 0x010000af,
366 Key_LaunchE = 0x010000b0,
367 Key_LaunchF = 0x010000b1,
368 + Key_MonBrightnessUp = 0x010000b2,
369 + Key_MonBrightnessDown = 0x010000b3,
370 + Key_KeyboardLightOnOff = 0x010000b4,
371 + Key_KeyboardBrightnessUp = 0x010000b5,
372 + Key_KeyboardBrightnessDown = 0x010000b6,
373 + Key_PowerOff = 0x010000b7,
374 + Key_WakeUp = 0x010000b8,
375 + Key_Eject = 0x010000b9,
376 + Key_ScreenSaver = 0x010000ba,
377 + Key_WWW = 0x010000bb,
378 + Key_Memo = 0x010000bc,
379 + Key_LightBulb = 0x010000bd,
380 + Key_Shop = 0x010000be,
381 + Key_History = 0x010000bf,
382 + Key_AddFavorite = 0x010000c0,
383 + Key_HotLinks = 0x010000c1,
384 + Key_BrightnessAdjust = 0x010000c2,
385 + Key_Finance = 0x010000c3,
386 + Key_Community = 0x010000c4,
387 + Key_AudioRewind = 0x010000c5,
388 + Key_BackForward = 0x010000c6,
389 + Key_ApplicationLeft = 0x010000c7,
390 + Key_ApplicationRight = 0x010000c8,
391 + Key_Book = 0x010000c9,
392 + Key_CD = 0x010000ca,
393 + Key_Calculator = 0x010000cb,
394 + Key_ToDoList = 0x010000cc,
395 + Key_ClearGrab = 0x010000cd,
396 + Key_Close = 0x010000ce,
397 + Key_Copy = 0x010000cf,
398 + Key_Cut = 0x010000d0,
399 + Key_Display = 0x010000d1,
400 + Key_DOS = 0x010000d2,
401 + Key_Documents = 0x010000d3,
402 + Key_Excel = 0x010000d4,
403 + Key_Explorer = 0x010000d5,
404 + Key_Game = 0x010000d6,
405 + Key_Go = 0x010000d7,
406 + Key_iTouch = 0x010000d8,
407 + Key_LogOff = 0x010000d9,
408 + Key_Market = 0x010000da,
409 + Key_Meeting = 0x010000db,
410 + Key_MenuKB = 0x010000dc,
411 + Key_MenuPB = 0x010000dd,
412 + Key_MySites = 0x010000de,
413 + Key_News = 0x010000df,
414 + Key_OfficeHome = 0x010000e0,
415 + Key_Option = 0x010000e1,
416 + Key_Paste = 0x010000e2,
417 + Key_Phone = 0x010000e3,
418 + Key_Calendar = 0x010000e4,
419 + Key_Reply = 0x010000e5,
420 + Key_Reload = 0x010000e6,
421 + Key_RotateWindows = 0x010000e7,
422 + Key_RotationPB = 0x010000e8,
423 + Key_RotationKB = 0x010000e9,
424 + Key_Save = 0x010000ea,
425 + Key_Send = 0x010000eb,
426 + Key_Spell = 0x010000ec,
427 + Key_SplitScreen = 0x010000ed,
428 + Key_Support = 0x010000ee,
429 + Key_TaskPane = 0x010000ef,
430 + Key_Terminal = 0x010000f0,
431 + Key_Tools = 0x010000f1,
432 + Key_Travel = 0x010000f2,
433 + Key_Video = 0x010000f3,
434 + Key_Word = 0x010000f4,
435 + Key_Xfer = 0x010000f5,
436 + Key_ZoomIn = 0x010000f6,
437 + Key_ZoomOut = 0x010000f7,
438 + Key_Away = 0x010000f8,
439 + Key_Messenger = 0x010000f9,
440 + Key_WebCam = 0x010000fa,
441 + Key_MailForward = 0x010000fb,
442 + Key_Pictures = 0x010000fc,
443 + Key_Music = 0x010000fd,
444 + Key_Battery = 0x010000fe,
445 + Key_Bluetooth = 0x010000ff,
446 + Key_WLAN = 0x01000100,
447 + Key_UWB = 0x01000101,
448 + Key_AudioForward = 0x01000102,
449 + Key_AudioRepeat = 0x01000103,
450 + Key_AudioRandomPlay = 0x01000104,
451 + Key_Subtitle = 0x01000105,
452 + Key_AudioCycleTrack = 0x01000106,
453 + Key_Time = 0x01000107,
454 + Key_Hibernate = 0x01000108,
455 + Key_View = 0x01000109,
456 + Key_TopMenu = 0x0100010a,
457 + Key_PowerDown = 0x0100010b,
458 + Key_Suspend = 0x0100010c,
459 + Key_ContrastAdjust = 0x0100010d,
460
461 Key_MediaLast = 0x0100ffff,
462
463 diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
464 index 87e9728..7f6dbb6 100644
465 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp
466 +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
467 @@ -127,16 +127,11 @@ struct GTimerSource
468 GSource source;
469 QTimerInfoList timerList;
470 QEventLoop::ProcessEventsFlags processEventsFlags;
471 + bool runWithIdlePriority;
472 };
473
474 -static gboolean timerSourcePrepare(GSource *source, gint *timeout)
475 +static gboolean timerSourcePrepareHelper(GTimerSource *src, gint *timeout)
476 {
477 - gint dummy;
478 - if (!timeout)
479 - timeout = &dummy;
480 -
481 - GTimerSource *src = reinterpret_cast<GTimerSource *>(source);
482 -
483 timeval tv = { 0l, 0l };
484 if (!(src->processEventsFlags & QEventLoop::X11ExcludeTimers) && src->timerList.timerWait(tv))
485 *timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
486 @@ -146,10 +141,8 @@ static gboolean timerSourcePrepare(GSource *source, gint *timeout)
487 return (*timeout == 0);
488 }
489
490 -static gboolean timerSourceCheck(GSource *source)
491 +static gboolean timerSourceCheckHelper(GTimerSource *src)
492 {
493 - GTimerSource *src = reinterpret_cast<GTimerSource *>(source);
494 -
495 if (src->timerList.isEmpty()
496 || (src->processEventsFlags & QEventLoop::X11ExcludeTimers))
497 return false;
498 @@ -160,9 +153,35 @@ static gboolean timerSourceCheck(GSource *source)
499 return true;
500 }
501
502 +static gboolean timerSourcePrepare(GSource *source, gint *timeout)
503 +{
504 + gint dummy;
505 + if (!timeout)
506 + timeout = &dummy;
507 +
508 + GTimerSource *src = reinterpret_cast<GTimerSource *>(source);
509 + if (src->runWithIdlePriority) {
510 + if (timeout)
511 + *timeout = -1;
512 + return false;
513 + }
514 +
515 + return timerSourcePrepareHelper(src, timeout);
516 +}
517 +
518 +static gboolean timerSourceCheck(GSource *source)
519 +{
520 + GTimerSource *src = reinterpret_cast<GTimerSource *>(source);
521 + if (src->runWithIdlePriority)
522 + return false;
523 + return timerSourceCheckHelper(src);
524 +}
525 +
526 static gboolean timerSourceDispatch(GSource *source, GSourceFunc, gpointer)
527 {
528 - (void) reinterpret_cast<GTimerSource *>(source)->timerList.activateTimers();
529 + GTimerSource *timerSource = reinterpret_cast<GTimerSource *>(source);
530 + timerSource->runWithIdlePriority = true;
531 + (void) timerSource->timerList.activateTimers();
532 return true; // ??? don't remove, right again?
533 }
534
535 @@ -175,6 +194,53 @@ static GSourceFuncs timerSourceFuncs = {
536 NULL
537 };
538
539 +struct GIdleTimerSource
540 +{
541 + GSource source;
542 + GTimerSource *timerSource;
543 +};
544 +
545 +static gboolean idleTimerSourcePrepare(GSource *source, gint *timeout)
546 +{
547 + GIdleTimerSource *idleTimerSource = reinterpret_cast<GIdleTimerSource *>(source);
548 + GTimerSource *timerSource = idleTimerSource->timerSource;
549 + if (!timerSource->runWithIdlePriority) {
550 + // Yield to the normal priority timer source
551 + if (timeout)
552 + *timeout = -1;
553 + return false;
554 + }
555 +
556 + return timerSourcePrepareHelper(timerSource, timeout);
557 +}
558 +
559 +static gboolean idleTimerSourceCheck(GSource *source)
560 +{
561 + GIdleTimerSource *idleTimerSource = reinterpret_cast<GIdleTimerSource *>(source);
562 + GTimerSource *timerSource = idleTimerSource->timerSource;
563 + if (!timerSource->runWithIdlePriority) {
564 + // Yield to the normal priority timer source
565 + return false;
566 + }
567 + return timerSourceCheckHelper(timerSource);
568 +}
569 +
570 +static gboolean idleTimerSourceDispatch(GSource *source, GSourceFunc, gpointer)
571 +{
572 + GTimerSource *timerSource = reinterpret_cast<GIdleTimerSource *>(source)->timerSource;
573 + (void) timerSourceDispatch(&timerSource->source, 0, 0);
574 + return true;
575 +}
576 +
577 +static GSourceFuncs idleTimerSourceFuncs = {
578 + idleTimerSourcePrepare,
579 + idleTimerSourceCheck,
580 + idleTimerSourceDispatch,
581 + NULL,
582 + NULL,
583 + NULL
584 +};
585 +
586 struct GPostEventSource
587 {
588 GSource source;
589 @@ -235,14 +301,15 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
590 g_main_context_ref(mainContext);
591 } else {
592 QCoreApplication *app = QCoreApplication::instance();
593 - if (app && QThread::currentThread() == app->thread()) {
594 - mainContext = g_main_context_default();
595 - g_main_context_ref(mainContext);
596 - } else {
597 - mainContext = g_main_context_new();
598 - }
599 + if (app && QThread::currentThread() == app->thread()) {
600 + mainContext = g_main_context_default();
601 + g_main_context_ref(mainContext);
602 + } else {
603 + mainContext = g_main_context_new();
604 + }
605 }
606
607 + // setup post event source
608 postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
609 sizeof(GPostEventSource)));
610 postEventSource->serialNumber = 1;
611 @@ -257,14 +324,21 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
612 g_source_set_can_recurse(&socketNotifierSource->source, true);
613 g_source_attach(&socketNotifierSource->source, mainContext);
614
615 - // setup timerSource
616 + // setup normal and idle timer sources
617 timerSource = reinterpret_cast<GTimerSource *>(g_source_new(&timerSourceFuncs,
618 sizeof(GTimerSource)));
619 (void) new (&timerSource->timerList) QTimerInfoList();
620 timerSource->processEventsFlags = QEventLoop::AllEvents;
621 + timerSource->runWithIdlePriority = false;
622 g_source_set_can_recurse(&timerSource->source, true);
623 - g_source_set_priority(&timerSource->source, G_PRIORITY_DEFAULT_IDLE);
624 g_source_attach(&timerSource->source, mainContext);
625 +
626 + idleTimerSource = reinterpret_cast<GIdleTimerSource *>(g_source_new(&idleTimerSourceFuncs,
627 + sizeof(GIdleTimerSource)));
628 + idleTimerSource->timerSource = timerSource;
629 + g_source_set_can_recurse(&idleTimerSource->source, true);
630 + g_source_set_priority(&idleTimerSource->source, G_PRIORITY_DEFAULT_IDLE);
631 + g_source_attach(&idleTimerSource->source, mainContext);
632 }
633
634 QEventDispatcherGlib::QEventDispatcherGlib(QObject *parent)
635 @@ -272,12 +346,9 @@ QEventDispatcherGlib::QEventDispatcherGlib(QObject *parent)
636 {
637 }
638
639 -QEventDispatcherGlib::QEventDispatcherGlib(GMainContext *mainContext,
640 - QObject *parent)
641 - : QAbstractEventDispatcher(*(new QEventDispatcherGlibPrivate(mainContext)),
642 - parent)
643 -{
644 -}
645 +QEventDispatcherGlib::QEventDispatcherGlib(GMainContext *mainContext, QObject *parent)
646 + : QAbstractEventDispatcher(*(new QEventDispatcherGlibPrivate(mainContext)), parent)
647 +{ }
648
649 QEventDispatcherGlib::~QEventDispatcherGlib()
650 {
651 @@ -289,6 +360,9 @@ QEventDispatcherGlib::~QEventDispatcherGlib()
652 g_source_destroy(&d->timerSource->source);
653 g_source_unref(&d->timerSource->source);
654 d->timerSource = 0;
655 + g_source_destroy(&d->idleTimerSource->source);
656 + g_source_unref(&d->idleTimerSource->source);
657 + d->idleTimerSource = 0;
658
659 // destroy socket notifier source
660 for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) {
661 @@ -324,11 +398,16 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
662 // tell postEventSourcePrepare() and timerSource about any new flags
663 QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags;
664 d->timerSource->processEventsFlags = flags;
665 -
666 +
667 + if (!(flags & QEventLoop::EventLoopExec)) {
668 + // force timers to be sent at normal priority
669 + d->timerSource->runWithIdlePriority = false;
670 + }
671 +
672 bool result = g_main_context_iteration(d->mainContext, canWait);
673 while (!result && canWait)
674 result = g_main_context_iteration(d->mainContext, canWait);
675 -
676 +
677 d->timerSource->processEventsFlags = savedFlags;
678
679 if (canWait)
680 diff --git a/src/corelib/kernel/qeventdispatcher_glib_p.h b/src/corelib/kernel/qeventdispatcher_glib_p.h
681 index eb7fb75..4103aa3 100644
682 --- a/src/corelib/kernel/qeventdispatcher_glib_p.h
683 +++ b/src/corelib/kernel/qeventdispatcher_glib_p.h
684 @@ -98,6 +98,7 @@ protected:
685 struct GPostEventSource;
686 struct GSocketNotifierSource;
687 struct GTimerSource;
688 +struct GIdleTimerSource;
689
690 class Q_CORE_EXPORT QEventDispatcherGlibPrivate : public QAbstractEventDispatcherPrivate
691 {
692 @@ -108,6 +109,7 @@ public:
693 GPostEventSource *postEventSource;
694 GSocketNotifierSource *socketNotifierSource;
695 GTimerSource *timerSource;
696 + GIdleTimerSource *idleTimerSource;
697 };
698
699 QT_END_NAMESPACE
700 diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
701 index 897bb49..903b0eb 100644
702 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp
703 +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
704 @@ -423,10 +423,10 @@ bool QTimerInfoList::timerWait(timeval &tm)
705 // Find first waiting timer not already active
706 QTimerInfo *t = 0;
707 for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
708 - if (!(*it)->inTimerEvent) {
709 - t = *it;
710 - break;
711 - }
712 + if (!(*it)->inTimerEvent) {
713 + t = *it;
714 + break;
715 + }
716 }
717
718 if (!t)
719 diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
720 index 1ed0332..089ddfc 100644
721 --- a/src/corelib/kernel/qobject.cpp
722 +++ b/src/corelib/kernel/qobject.cpp
723 @@ -986,8 +986,16 @@ void QObject::setObjectName(const QString &name)
724 {
725 Q_D(QObject);
726 d->objectName = name;
727 +#if defined(Q_WS_X11)
728 + d->checkWindowRole();
729 +#endif
730 }
731
732 +#if defined(Q_WS_X11)
733 +void QObjectPrivate::checkWindowRole()
734 +{
735 +}
736 +#endif
737
738 #ifdef QT3_SUPPORT
739 /*! \internal
740 diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
741 index 6ca4dc8..1551472 100644
742 --- a/src/corelib/kernel/qobject_p.h
743 +++ b/src/corelib/kernel/qobject_p.h
744 @@ -83,7 +83,9 @@ extern QSignalSpyCallbackSet Q_CORE_EXPORT qt_signal_spy_callback_set;
745
746 inline QObjectData::~QObjectData() {}
747
748 -enum { QObjectPrivateVersion = QT_VERSION };
749 +// add 0x1000000 to mark it as qt-copy version, with possible modifications
750 +// in some Q*Private class
751 +enum { QObjectPrivateVersion = QT_VERSION + 0x1000000 };
752
753 class Q_CORE_EXPORT QObjectPrivate : public QObjectData
754 {
755 @@ -144,6 +146,9 @@ public:
756 mutable quint32 connectedSignals;
757
758 QString objectName;
759 +#if defined(Q_WS_X11)
760 + virtual void checkWindowRole();
761 +#endif
762
763 // Note: you must hold the signalSlotLock() before accessing the lists below or calling the functions
764 struct Connection
765 diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp
766 index 828e427..8bbdd7b 100644
767 --- a/src/dbus/qdbusinternalfilters.cpp
768 +++ b/src/dbus/qdbusinternalfilters.cpp
769 @@ -274,9 +274,23 @@ QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node
770 QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
771 it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
772 interface_name);
773 - if (it != connector->adaptors.end() && interface_name == QLatin1String(it->interface))
774 + if (it != connector->adaptors.end() && interface_name == QLatin1String(it->interface)) {
775 + if (value.userType() == qMetaTypeId<QDBusArgument>()) {
776 + QDBusArgument valueArg = qvariant_cast<QDBusArgument>(value);
777 + if (valueArg.currentType() != -1) {
778 + int mid = it->adaptor->metaObject()->property(it->adaptor->metaObject()->indexOfProperty(property_name)).userType();
779 + void *null = 0;
780 + QVariant valueStore(mid, null);
781 + QDBusMetaType::demarshall(valueArg, mid, valueStore.data());
782 +
783 + if (it->adaptor->setProperty(property_name, valueStore))
784 + return msg.createReply();
785 + }
786 + }
787 +
788 if (it->adaptor->setProperty(property_name, value))
789 return msg.createReply();
790 + }
791 }
792 }
793
794 diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
795 index 50088df..c1bc794 100644
796 --- a/src/gui/image/qnativeimage.cpp
797 +++ b/src/gui/image/qnativeimage.cpp
798 @@ -144,7 +144,7 @@ QImage::Format QNativeImage::systemFormat()
799 #elif defined(Q_WS_X11) && !defined(QT_NO_MITSHM)
800
801 QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* isTextBuffer */, QWidget *widget)
802 - : xshmimg(0), xshmpm(0)
803 + : xshmimg(0)
804 {
805 if (!X11->use_mitshm) {
806 image = QImage(width, height, format);
807 @@ -195,11 +195,6 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /*
808 shmctl(xshminfo.shmid, IPC_RMID, 0);
809 return;
810 }
811 - xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data,
812 - &xshminfo, width, height, dd);
813 - if (!xshmpm) {
814 - qWarning() << "QNativeImage: Unable to create shared Pixmap.";
815 - }
816 }
817
818
819 @@ -208,10 +203,6 @@ QNativeImage::~QNativeImage()
820 if (!xshmimg)
821 return;
822
823 - if (xshmpm) {
824 - XFreePixmap(X11->display, xshmpm);
825 - xshmpm = 0;
826 - }
827 XShmDetach(X11->display, &xshminfo);
828 xshmimg->data = 0;
829 XDestroyImage(xshmimg);
830 diff --git a/src/gui/image/qnativeimage_p.h b/src/gui/image/qnativeimage_p.h
831 index 0f5dc8b..cd3cc3b 100644
832 --- a/src/gui/image/qnativeimage_p.h
833 +++ b/src/gui/image/qnativeimage_p.h
834 @@ -90,7 +90,6 @@ public:
835
836 #elif defined(Q_WS_X11) && !defined(QT_NO_MITSHM)
837 XImage *xshmimg;
838 - Pixmap xshmpm;
839 XShmSegmentInfo xshminfo;
840
841 #elif defined(Q_WS_MAC)
842 diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
843 index a69ab6a..93f4fd8 100644
844 --- a/src/gui/itemviews/qtreeview.cpp
845 +++ b/src/gui/itemviews/qtreeview.cpp
846 @@ -3577,7 +3577,7 @@ QList<QPair<int, int> > QTreeViewPrivate::columnRanges(const QModelIndex &topInd
847 current.first = -2; // -1 is not enough because -1+1 = 0
848 current.second = -2;
849 foreach (int logicalColumn, logicalIndexes) {
850 - if (current.second + 1 != logicalColumn) {
851 + if (current.second + 1 != logicalColumn && !header->isSectionHidden(current.second + 1)) {
852 if (current.first != -2) {
853 //let's save the current one
854 ret += current;
855 diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
856 index 343c71b..45e2b49 100644
857 --- a/src/gui/kernel/qapplication_x11.cpp
858 +++ b/src/gui/kernel/qapplication_x11.cpp
859 @@ -1959,7 +1959,7 @@ void qt_init(QApplicationPrivate *priv, int,
860 bool local = displayName.isEmpty() || displayName.lastIndexOf(QLatin1Char(':')) == 0;
861 if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0)) {
862 Visual *defaultVisual = DefaultVisual(X11->display, DefaultScreen(X11->display));
863 - X11->use_mitshm = mitshm_pixmaps && ((defaultVisual->red_mask == 0xff0000
864 + X11->use_mitshm = ((defaultVisual->red_mask == 0xff0000
865 || defaultVisual->red_mask == 0xf800)
866 && (defaultVisual->green_mask == 0xff00
867 || defaultVisual->green_mask == 0x7e0)
868 diff --git a/src/gui/kernel/qkeymapper_x11.cpp b/src/gui/kernel/qkeymapper_x11.cpp
869 index 8daa881..37d12c2 100644
870 --- a/src/gui/kernel/qkeymapper_x11.cpp
871 +++ b/src/gui/kernel/qkeymapper_x11.cpp
872 @@ -714,47 +714,144 @@ extern bool qt_sm_blockUserInput;
873 #define XK_KP_Delete 0xFF9F
874 #endif
875
876 -// the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special
877 +// the next lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special
878 // multimedia keys. They are included here as not every system has them.
879 -#define XF86XK_Standby 0x1008FF10
880 -#define XF86XK_AudioLowerVolume 0x1008FF11
881 -#define XF86XK_AudioMute 0x1008FF12
882 -#define XF86XK_AudioRaiseVolume 0x1008FF13
883 -#define XF86XK_AudioPlay 0x1008FF14
884 -#define XF86XK_AudioStop 0x1008FF15
885 -#define XF86XK_AudioPrev 0x1008FF16
886 -#define XF86XK_AudioNext 0x1008FF17
887 -#define XF86XK_HomePage 0x1008FF18
888 -#define XF86XK_Calculator 0x1008FF1D
889 -#define XF86XK_Mail 0x1008FF19
890 -#define XF86XK_Start 0x1008FF1A
891 -#define XF86XK_Search 0x1008FF1B
892 -#define XF86XK_AudioRecord 0x1008FF1C
893 -#define XF86XK_Back 0x1008FF26
894 -#define XF86XK_Forward 0x1008FF27
895 -#define XF86XK_Stop 0x1008FF28
896 -#define XF86XK_Refresh 0x1008FF29
897 -#define XF86XK_Favorites 0x1008FF30
898 -#define XF86XK_AudioPause 0x1008FF31
899 -#define XF86XK_AudioMedia 0x1008FF32
900 -#define XF86XK_MyComputer 0x1008FF33
901 -#define XF86XK_OpenURL 0x1008FF38
902 -#define XF86XK_Launch0 0x1008FF40
903 -#define XF86XK_Launch1 0x1008FF41
904 -#define XF86XK_Launch2 0x1008FF42
905 -#define XF86XK_Launch3 0x1008FF43
906 -#define XF86XK_Launch4 0x1008FF44
907 -#define XF86XK_Launch5 0x1008FF45
908 -#define XF86XK_Launch6 0x1008FF46
909 -#define XF86XK_Launch7 0x1008FF47
910 -#define XF86XK_Launch8 0x1008FF48
911 -#define XF86XK_Launch9 0x1008FF49
912 -#define XF86XK_LaunchA 0x1008FF4A
913 -#define XF86XK_LaunchB 0x1008FF4B
914 -#define XF86XK_LaunchC 0x1008FF4C
915 -#define XF86XK_LaunchD 0x1008FF4D
916 -#define XF86XK_LaunchE 0x1008FF4E
917 -#define XF86XK_LaunchF 0x1008FF4F
918 +#define XF86XK_MonBrightnessUp 0x1008FF02
919 +#define XF86XK_MonBrightnessDown 0x1008FF03
920 +#define XF86XK_KbdLightOnOff 0x1008FF04
921 +#define XF86XK_KbdBrightnessUp 0x1008FF05
922 +#define XF86XK_KbdBrightnessDown 0x1008FF06
923 +#define XF86XK_Standby 0x1008FF10
924 +#define XF86XK_AudioLowerVolume 0x1008FF11
925 +#define XF86XK_AudioMute 0x1008FF12
926 +#define XF86XK_AudioRaiseVolume 0x1008FF13
927 +#define XF86XK_AudioPlay 0x1008FF14
928 +#define XF86XK_AudioStop 0x1008FF15
929 +#define XF86XK_AudioPrev 0x1008FF16
930 +#define XF86XK_AudioNext 0x1008FF17
931 +#define XF86XK_HomePage 0x1008FF18
932 +#define XF86XK_Mail 0x1008FF19
933 +#define XF86XK_Start 0x1008FF1A
934 +#define XF86XK_Search 0x1008FF1B
935 +#define XF86XK_AudioRecord 0x1008FF1C
936 +#define XF86XK_Calculator 0x1008FF1D
937 +#define XF86XK_Memo 0x1008FF1E
938 +#define XF86XK_ToDoList 0x1008FF1F
939 +#define XF86XK_Calendar 0x1008FF20
940 +#define XF86XK_PowerDown 0x1008FF21
941 +#define XF86XK_ContrastAdjust 0x1008FF22
942 +#define XF86XK_Back 0x1008FF26
943 +#define XF86XK_Forward 0x1008FF27
944 +#define XF86XK_Stop 0x1008FF28
945 +#define XF86XK_Refresh 0x1008FF29
946 +#define XF86XK_PowerOff 0x1008FF2A
947 +#define XF86XK_WakeUp 0x1008FF2B
948 +#define XF86XK_Eject 0x1008FF2C
949 +#define XF86XK_ScreenSaver 0x1008FF2D
950 +#define XF86XK_WWW 0x1008FF2E
951 +#define XF86XK_Sleep 0x1008FF2F
952 +#define XF86XK_Favorites 0x1008FF30
953 +#define XF86XK_AudioPause 0x1008FF31
954 +#define XF86XK_AudioMedia 0x1008FF32
955 +#define XF86XK_MyComputer 0x1008FF33
956 +#define XF86XK_LightBulb 0x1008FF35
957 +#define XF86XK_Shop 0x1008FF36
958 +#define XF86XK_History 0x1008FF37
959 +#define XF86XK_OpenURL 0x1008FF38
960 +#define XF86XK_AddFavorite 0x1008FF39
961 +#define XF86XK_HotLinks 0x1008FF3A
962 +#define XF86XK_BrightnessAdjust 0x1008FF3B
963 +#define XF86XK_Finance 0x1008FF3C
964 +#define XF86XK_Community 0x1008FF3D
965 +#define XF86XK_AudioRewind 0x1008FF3E
966 +#define XF86XK_BackForward 0x1008FF3F
967 +#define XF86XK_Launch0 0x1008FF40
968 +#define XF86XK_Launch1 0x1008FF41
969 +#define XF86XK_Launch2 0x1008FF42
970 +#define XF86XK_Launch3 0x1008FF43
971 +#define XF86XK_Launch4 0x1008FF44
972 +#define XF86XK_Launch5 0x1008FF45
973 +#define XF86XK_Launch6 0x1008FF46
974 +#define XF86XK_Launch7 0x1008FF47
975 +#define XF86XK_Launch8 0x1008FF48
976 +#define XF86XK_Launch9 0x1008FF49
977 +#define XF86XK_LaunchA 0x1008FF4A
978 +#define XF86XK_LaunchB 0x1008FF4B
979 +#define XF86XK_LaunchC 0x1008FF4C
980 +#define XF86XK_LaunchD 0x1008FF4D
981 +#define XF86XK_LaunchE 0x1008FF4E
982 +#define XF86XK_LaunchF 0x1008FF4F
983 +#define XF86XK_ApplicationLeft 0x1008FF50
984 +#define XF86XK_ApplicationRight 0x1008FF51
985 +#define XF86XK_Book 0x1008FF52
986 +#define XF86XK_CD 0x1008FF53
987 +#define XF86XK_Calculater 0x1008FF54
988 +#define XF86XK_Clear 0x1008FF55
989 +#define XF86XK_ClearGrab 0x1008FE21
990 +#define XF86XK_Close 0x1008FF56
991 +#define XF86XK_Copy 0x1008FF57
992 +#define XF86XK_Cut 0x1008FF58
993 +#define XF86XK_Display 0x1008FF59
994 +#define XF86XK_DOS 0x1008FF5A
995 +#define XF86XK_Documents 0x1008FF5B
996 +#define XF86XK_Excel 0x1008FF5C
997 +#define XF86XK_Explorer 0x1008FF5D
998 +#define XF86XK_Game 0x1008FF5E
999 +#define XF86XK_Go 0x1008FF5F
1000 +#define XF86XK_iTouch 0x1008FF60
1001 +#define XF86XK_LogOff 0x1008FF61
1002 +#define XF86XK_Market 0x1008FF62
1003 +#define XF86XK_Meeting 0x1008FF63
1004 +#define XF86XK_MenuKB 0x1008FF65
1005 +#define XF86XK_MenuPB 0x1008FF66
1006 +#define XF86XK_MySites 0x1008FF67
1007 +#define XF86XK_News 0x1008FF69
1008 +#define XF86XK_OfficeHome 0x1008FF6A
1009 +#define XF86XK_Option 0x1008FF6C
1010 +#define XF86XK_Paste 0x1008FF6D
1011 +#define XF86XK_Phone 0x1008FF6E
1012 +#define XF86XK_Reply 0x1008FF72
1013 +#define XF86XK_Reload 0x1008FF73
1014 +#define XF86XK_RotateWindows 0x1008FF74
1015 +#define XF86XK_RotationPB 0x1008FF75
1016 +#define XF86XK_RotationKB 0x1008FF76
1017 +#define XF86XK_Save 0x1008FF77
1018 +#define XF86XK_Send 0x1008FF7B
1019 +#define XF86XK_Spell 0x1008FF7C
1020 +#define XF86XK_SplitScreen 0x1008FF7D
1021 +#define XF86XK_Support 0x1008FF7E
1022 +#define XF86XK_TaskPane 0x1008FF7F
1023 +#define XF86XK_Terminal 0x1008FF80
1024 +#define XF86XK_Tools 0x1008FF81
1025 +#define XF86XK_Travel 0x1008FF82
1026 +#define XF86XK_Video 0x1008FF87
1027 +#define XF86XK_Word 0x1008FF89
1028 +#define XF86XK_Xfer 0x1008FF8A
1029 +#define XF86XK_ZoomIn 0x1008FF8B
1030 +#define XF86XK_ZoomOut 0x1008FF8C
1031 +#define XF86XK_Away 0x1008FF8D
1032 +#define XF86XK_Messenger 0x1008FF8E
1033 +#define XF86XK_WebCam 0x1008FF8F
1034 +#define XF86XK_MailForward 0x1008FF90
1035 +#define XF86XK_Pictures 0x1008FF91
1036 +#define XF86XK_Music 0x1008FF92
1037 +#define XF86XK_Battery 0x1008FF93
1038 +#define XF86XK_Bluetooth 0x1008FF94
1039 +#define XF86XK_WLAN 0x1008FF95
1040 +#define XF86XK_UWB 0x1008FF96
1041 +#define XF86XK_AudioForward 0x1008FF97
1042 +#define XF86XK_AudioRepeat 0x1008FF98
1043 +#define XF86XK_AudioRandomPlay 0x1008FF99
1044 +#define XF86XK_Subtitle 0x1008FF9A
1045 +#define XF86XK_AudioCycleTrack 0x1008FF9B
1046 +#define XF86XK_Time 0x1008FF9F
1047 +#define XF86XK_Select 0x1008FFA0
1048 +#define XF86XK_View 0x1008FFA1
1049 +#define XF86XK_TopMenu 0x1008FFA2
1050 +#define XF86XK_Suspend 0x1008FFA7
1051 +#define XF86XK_Hibernate 0x1008FFA8
1052 +
1053 +
1054 // end of XF86keysyms.h
1055
1056 // Special keys used by Qtopia, mapped into the X11 private keypad range.
1057 @@ -942,10 +1039,8 @@ static const unsigned int KeyTbl[] = {
1058 XK_dead_hook, Qt::Key_Dead_Hook,
1059 XK_dead_horn, Qt::Key_Dead_Horn,
1060
1061 - // Special multimedia keys
1062 - // currently only tested with MS internet keyboard
1063 -
1064 - // browsing keys
1065 + // Special keys from X.org - This include multimedia keys,
1066 + // wireless/bluetooth/uwb keys, special launcher keys, etc.
1067 XF86XK_Back, Qt::Key_Back,
1068 XF86XK_Forward, Qt::Key_Forward,
1069 XF86XK_Stop, Qt::Key_Stop,
1070 @@ -955,8 +1050,6 @@ static const unsigned int KeyTbl[] = {
1071 XF86XK_OpenURL, Qt::Key_OpenUrl,
1072 XF86XK_HomePage, Qt::Key_HomePage,
1073 XF86XK_Search, Qt::Key_Search,
1074 -
1075 - // media keys
1076 XF86XK_AudioLowerVolume, Qt::Key_VolumeDown,
1077 XF86XK_AudioMute, Qt::Key_VolumeMute,
1078 XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp,
1079 @@ -965,13 +1058,106 @@ static const unsigned int KeyTbl[] = {
1080 XF86XK_AudioPrev, Qt::Key_MediaPrevious,
1081 XF86XK_AudioNext, Qt::Key_MediaNext,
1082 XF86XK_AudioRecord, Qt::Key_MediaRecord,
1083 -
1084 - // launch keys
1085 XF86XK_Mail, Qt::Key_LaunchMail,
1086 XF86XK_MyComputer, Qt::Key_Launch0,
1087 - XF86XK_Calculator, Qt::Key_Launch1,
1088 + XF86XK_Calculator, Qt::Key_Calculator,
1089 + XF86XK_Memo, Qt::Key_Memo,
1090 + XF86XK_ToDoList, Qt::Key_ToDoList,
1091 + XF86XK_Calendar, Qt::Key_Calendar,
1092 + XF86XK_PowerDown, Qt::Key_PowerDown,
1093 + XF86XK_ContrastAdjust, Qt::Key_ContrastAdjust,
1094 XF86XK_Standby, Qt::Key_Standby,
1095 -
1096 + XF86XK_MonBrightnessUp, Qt::Key_MonBrightnessUp,
1097 + XF86XK_MonBrightnessDown, Qt::Key_MonBrightnessDown,
1098 + XF86XK_KbdLightOnOff, Qt::Key_KeyboardLightOnOff,
1099 + XF86XK_KbdBrightnessUp, Qt::Key_KeyboardBrightnessUp,
1100 + XF86XK_KbdBrightnessDown, Qt::Key_KeyboardBrightnessDown,
1101 + XF86XK_PowerOff, Qt::Key_PowerOff,
1102 + XF86XK_WakeUp, Qt::Key_WakeUp,
1103 + XF86XK_Eject, Qt::Key_Eject,
1104 + XF86XK_ScreenSaver, Qt::Key_ScreenSaver,
1105 + XF86XK_WWW, Qt::Key_WWW,
1106 + XF86XK_Sleep, Qt::Key_Sleep,
1107 + XF86XK_LightBulb, Qt::Key_LightBulb,
1108 + XF86XK_Shop, Qt::Key_Shop,
1109 + XF86XK_History, Qt::Key_History,
1110 + XF86XK_AddFavorite, Qt::Key_AddFavorite,
1111 + XF86XK_HotLinks, Qt::Key_HotLinks,
1112 + XF86XK_BrightnessAdjust, Qt::Key_BrightnessAdjust,
1113 + XF86XK_Finance, Qt::Key_Finance,
1114 + XF86XK_Community, Qt::Key_Community,
1115 + XF86XK_AudioRewind, Qt::Key_AudioRewind,
1116 + XF86XK_BackForward, Qt::Key_BackForward,
1117 + XF86XK_ApplicationLeft, Qt::Key_ApplicationLeft,
1118 + XF86XK_ApplicationRight, Qt::Key_ApplicationRight,
1119 + XF86XK_Book, Qt::Key_Book,
1120 + XF86XK_CD, Qt::Key_CD,
1121 + XF86XK_Calculater, Qt::Key_Calculator,
1122 + XF86XK_Clear, Qt::Key_Clear,
1123 + XF86XK_ClearGrab, Qt::Key_ClearGrab,
1124 + XF86XK_Close, Qt::Key_Close,
1125 + XF86XK_Copy, Qt::Key_Copy,
1126 + XF86XK_Cut, Qt::Key_Cut,
1127 + XF86XK_Display, Qt::Key_Display,
1128 + XF86XK_DOS, Qt::Key_DOS,
1129 + XF86XK_Documents, Qt::Key_Documents,
1130 + XF86XK_Excel, Qt::Key_Excel,
1131 + XF86XK_Explorer, Qt::Key_Explorer,
1132 + XF86XK_Game, Qt::Key_Game,
1133 + XF86XK_Go, Qt::Key_Go,
1134 + XF86XK_iTouch, Qt::Key_iTouch,
1135 + XF86XK_LogOff, Qt::Key_LogOff,
1136 + XF86XK_Market, Qt::Key_Market,
1137 + XF86XK_Meeting, Qt::Key_Meeting,
1138 + XF86XK_MenuKB, Qt::Key_MenuKB,
1139 + XF86XK_MenuPB, Qt::Key_MenuPB,
1140 + XF86XK_MySites, Qt::Key_MySites,
1141 + XF86XK_News, Qt::Key_News,
1142 + XF86XK_OfficeHome, Qt::Key_OfficeHome,
1143 + XF86XK_Option, Qt::Key_Option,
1144 + XF86XK_Paste, Qt::Key_Paste,
1145 + XF86XK_Phone, Qt::Key_Phone,
1146 + XF86XK_Reply, Qt::Key_Reply,
1147 + XF86XK_Reload, Qt::Key_Reload,
1148 + XF86XK_RotateWindows, Qt::Key_RotateWindows,
1149 + XF86XK_RotationPB, Qt::Key_RotationPB,
1150 + XF86XK_RotationKB, Qt::Key_RotationKB,
1151 + XF86XK_Save, Qt::Key_Save,
1152 + XF86XK_Send, Qt::Key_Send,
1153 + XF86XK_Spell, Qt::Key_Spell,
1154 + XF86XK_SplitScreen, Qt::Key_SplitScreen,
1155 + XF86XK_Support, Qt::Key_Support,
1156 + XF86XK_TaskPane, Qt::Key_TaskPane,
1157 + XF86XK_Terminal, Qt::Key_Terminal,
1158 + XF86XK_Tools, Qt::Key_Tools,
1159 + XF86XK_Travel, Qt::Key_Travel,
1160 + XF86XK_Video, Qt::Key_Video,
1161 + XF86XK_Word, Qt::Key_Word,
1162 + XF86XK_Xfer, Qt::Key_Xfer,
1163 + XF86XK_ZoomIn, Qt::Key_ZoomIn,
1164 + XF86XK_ZoomOut, Qt::Key_ZoomOut,
1165 + XF86XK_Away, Qt::Key_Away,
1166 + XF86XK_Messenger, Qt::Key_Messenger,
1167 + XF86XK_WebCam, Qt::Key_WebCam,
1168 + XF86XK_MailForward, Qt::Key_MailForward,
1169 + XF86XK_Pictures, Qt::Key_Pictures,
1170 + XF86XK_Music, Qt::Key_Music,
1171 + XF86XK_Battery, Qt::Key_Battery,
1172 + XF86XK_Bluetooth, Qt::Key_Bluetooth,
1173 + XF86XK_WLAN, Qt::Key_WLAN,
1174 + XF86XK_UWB, Qt::Key_UWB,
1175 + XF86XK_AudioForward, Qt::Key_AudioForward,
1176 + XF86XK_AudioRepeat, Qt::Key_AudioRepeat,
1177 + XF86XK_AudioRandomPlay, Qt::Key_AudioRandomPlay,
1178 + XF86XK_Subtitle, Qt::Key_Subtitle,
1179 + XF86XK_AudioCycleTrack, Qt::Key_AudioCycleTrack,
1180 + XF86XK_Time, Qt::Key_Time,
1181 + XF86XK_Select, Qt::Key_Select,
1182 + XF86XK_View, Qt::Key_View,
1183 + XF86XK_TopMenu, Qt::Key_TopMenu,
1184 + XF86XK_Bluetooth, Qt::Key_Bluetooth,
1185 + XF86XK_Suspend, Qt::Key_Suspend,
1186 + XF86XK_Hibernate, Qt::Key_Hibernate,
1187 XF86XK_Launch0, Qt::Key_Launch2,
1188 XF86XK_Launch1, Qt::Key_Launch3,
1189 XF86XK_Launch2, Qt::Key_Launch4,
1190 diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
1191 index 03de530..97591a4 100644
1192 --- a/src/gui/kernel/qkeysequence.cpp
1193 +++ b/src/gui/kernel/qkeysequence.cpp
1194 @@ -396,47 +396,139 @@ static const struct {
1195 { Qt::Key_Menu, QT_TRANSLATE_NOOP("QShortcut", "Menu") },
1196 { Qt::Key_Help, QT_TRANSLATE_NOOP("QShortcut", "Help") },
1197
1198 - // Multimedia keys
1199 - { Qt::Key_Back, QT_TRANSLATE_NOOP("QShortcut", "Back") },
1200 - { Qt::Key_Forward, QT_TRANSLATE_NOOP("QShortcut", "Forward") },
1201 - { Qt::Key_Stop, QT_TRANSLATE_NOOP("QShortcut", "Stop") },
1202 - { Qt::Key_Refresh, QT_TRANSLATE_NOOP("QShortcut", "Refresh") },
1203 - { Qt::Key_VolumeDown, QT_TRANSLATE_NOOP("QShortcut", "Volume Down") },
1204 - { Qt::Key_VolumeMute, QT_TRANSLATE_NOOP("QShortcut", "Volume Mute") },
1205 - { Qt::Key_VolumeUp, QT_TRANSLATE_NOOP("QShortcut", "Volume Up") },
1206 - { Qt::Key_BassBoost, QT_TRANSLATE_NOOP("QShortcut", "Bass Boost") },
1207 - { Qt::Key_BassUp, QT_TRANSLATE_NOOP("QShortcut", "Bass Up") },
1208 - { Qt::Key_BassDown, QT_TRANSLATE_NOOP("QShortcut", "Bass Down") },
1209 - { Qt::Key_TrebleUp, QT_TRANSLATE_NOOP("QShortcut", "Treble Up") },
1210 - { Qt::Key_TrebleDown, QT_TRANSLATE_NOOP("QShortcut", "Treble Down") },
1211 - { Qt::Key_MediaPlay, QT_TRANSLATE_NOOP("QShortcut", "Media Play") },
1212 - { Qt::Key_MediaStop, QT_TRANSLATE_NOOP("QShortcut", "Media Stop") },
1213 - { Qt::Key_MediaPrevious,QT_TRANSLATE_NOOP("QShortcut", "Media Previous") },
1214 - { Qt::Key_MediaNext, QT_TRANSLATE_NOOP("QShortcut", "Media Next") },
1215 - { Qt::Key_MediaRecord, QT_TRANSLATE_NOOP("QShortcut", "Media Record") },
1216 - { Qt::Key_HomePage, QT_TRANSLATE_NOOP("QShortcut", "Home Page") },
1217 - { Qt::Key_Favorites, QT_TRANSLATE_NOOP("QShortcut", "Favorites") },
1218 - { Qt::Key_Search, QT_TRANSLATE_NOOP("QShortcut", "Search") },
1219 - { Qt::Key_Standby, QT_TRANSLATE_NOOP("QShortcut", "Standby") },
1220 - { Qt::Key_OpenUrl, QT_TRANSLATE_NOOP("QShortcut", "Open URL") },
1221 - { Qt::Key_LaunchMail, QT_TRANSLATE_NOOP("QShortcut", "Launch Mail") },
1222 - { Qt::Key_LaunchMedia, QT_TRANSLATE_NOOP("QShortcut", "Launch Media") },
1223 - { Qt::Key_Launch0, QT_TRANSLATE_NOOP("QShortcut", "Launch (0)") },
1224 - { Qt::Key_Launch1, QT_TRANSLATE_NOOP("QShortcut", "Launch (1)") },
1225 - { Qt::Key_Launch2, QT_TRANSLATE_NOOP("QShortcut", "Launch (2)") },
1226 - { Qt::Key_Launch3, QT_TRANSLATE_NOOP("QShortcut", "Launch (3)") },
1227 - { Qt::Key_Launch4, QT_TRANSLATE_NOOP("QShortcut", "Launch (4)") },
1228 - { Qt::Key_Launch5, QT_TRANSLATE_NOOP("QShortcut", "Launch (5)") },
1229 - { Qt::Key_Launch6, QT_TRANSLATE_NOOP("QShortcut", "Launch (6)") },
1230 - { Qt::Key_Launch7, QT_TRANSLATE_NOOP("QShortcut", "Launch (7)") },
1231 - { Qt::Key_Launch8, QT_TRANSLATE_NOOP("QShortcut", "Launch (8)") },
1232 - { Qt::Key_Launch9, QT_TRANSLATE_NOOP("QShortcut", "Launch (9)") },
1233 - { Qt::Key_LaunchA, QT_TRANSLATE_NOOP("QShortcut", "Launch (A)") },
1234 - { Qt::Key_LaunchB, QT_TRANSLATE_NOOP("QShortcut", "Launch (B)") },
1235 - { Qt::Key_LaunchC, QT_TRANSLATE_NOOP("QShortcut", "Launch (C)") },
1236 - { Qt::Key_LaunchD, QT_TRANSLATE_NOOP("QShortcut", "Launch (D)") },
1237 - { Qt::Key_LaunchE, QT_TRANSLATE_NOOP("QShortcut", "Launch (E)") },
1238 - { Qt::Key_LaunchF, QT_TRANSLATE_NOOP("QShortcut", "Launch (F)") },
1239 + // Special keys
1240 + // Includes multimedia, launcher, lan keys ( bluetooth, wireless )
1241 + // window navigation
1242 + { Qt::Key_Back, QT_TRANSLATE_NOOP("QShortcut", "Back") },
1243 + { Qt::Key_Forward, QT_TRANSLATE_NOOP("QShortcut", "Forward") },
1244 + { Qt::Key_Stop, QT_TRANSLATE_NOOP("QShortcut", "Stop") },
1245 + { Qt::Key_Refresh, QT_TRANSLATE_NOOP("QShortcut", "Refresh") },
1246 + { Qt::Key_VolumeDown, QT_TRANSLATE_NOOP("QShortcut", "Volume Down") },
1247 + { Qt::Key_VolumeMute, QT_TRANSLATE_NOOP("QShortcut", "Volume Mute") },
1248 + { Qt::Key_VolumeUp, QT_TRANSLATE_NOOP("QShortcut", "Volume Up") },
1249 + { Qt::Key_BassBoost, QT_TRANSLATE_NOOP("QShortcut", "Bass Boost") },
1250 + { Qt::Key_BassUp, QT_TRANSLATE_NOOP("QShortcut", "Bass Up") },
1251 + { Qt::Key_BassDown, QT_TRANSLATE_NOOP("QShortcut", "Bass Down") },
1252 + { Qt::Key_TrebleUp, QT_TRANSLATE_NOOP("QShortcut", "Treble Up") },
1253 + { Qt::Key_TrebleDown, QT_TRANSLATE_NOOP("QShortcut", "Treble Down") },
1254 + { Qt::Key_MediaPlay, QT_TRANSLATE_NOOP("QShortcut", "Media Play") },
1255 + { Qt::Key_MediaStop, QT_TRANSLATE_NOOP("QShortcut", "Media Stop") },
1256 + { Qt::Key_MediaPrevious, QT_TRANSLATE_NOOP("QShortcut", "Media Previous") },
1257 + { Qt::Key_MediaNext, QT_TRANSLATE_NOOP("QShortcut", "Media Next") },
1258 + { Qt::Key_MediaRecord, QT_TRANSLATE_NOOP("QShortcut", "Media Record") },
1259 + { Qt::Key_HomePage, QT_TRANSLATE_NOOP("QShortcut", "Home Page") },
1260 + { Qt::Key_Favorites, QT_TRANSLATE_NOOP("QShortcut", "Favorites") },
1261 + { Qt::Key_Search, QT_TRANSLATE_NOOP("QShortcut", "Search") },
1262 + { Qt::Key_Standby, QT_TRANSLATE_NOOP("QShortcut", "Standby") },
1263 + { Qt::Key_OpenUrl, QT_TRANSLATE_NOOP("QShortcut", "Open URL") },
1264 + { Qt::Key_LaunchMail, QT_TRANSLATE_NOOP("QShortcut", "Launch Mail") },
1265 + { Qt::Key_LaunchMedia, QT_TRANSLATE_NOOP("QShortcut", "Launch Media") },
1266 + { Qt::Key_Launch0, QT_TRANSLATE_NOOP("QShortcut", "Launch (0)") },
1267 + { Qt::Key_Launch1, QT_TRANSLATE_NOOP("QShortcut", "Launch (1)") },
1268 + { Qt::Key_Launch2, QT_TRANSLATE_NOOP("QShortcut", "Launch (2)") },
1269 + { Qt::Key_Launch3, QT_TRANSLATE_NOOP("QShortcut", "Launch (3)") },
1270 + { Qt::Key_Launch4, QT_TRANSLATE_NOOP("QShortcut", "Launch (4)") },
1271 + { Qt::Key_Launch5, QT_TRANSLATE_NOOP("QShortcut", "Launch (5)") },
1272 + { Qt::Key_Launch6, QT_TRANSLATE_NOOP("QShortcut", "Launch (6)") },
1273 + { Qt::Key_Launch7, QT_TRANSLATE_NOOP("QShortcut", "Launch (7)") },
1274 + { Qt::Key_Launch8, QT_TRANSLATE_NOOP("QShortcut", "Launch (8)") },
1275 + { Qt::Key_Launch9, QT_TRANSLATE_NOOP("QShortcut", "Launch (9)") },
1276 + { Qt::Key_LaunchA, QT_TRANSLATE_NOOP("QShortcut", "Launch (A)") },
1277 + { Qt::Key_LaunchB, QT_TRANSLATE_NOOP("QShortcut", "Launch (B)") },
1278 + { Qt::Key_LaunchC, QT_TRANSLATE_NOOP("QShortcut", "Launch (C)") },
1279 + { Qt::Key_LaunchD, QT_TRANSLATE_NOOP("QShortcut", "Launch (D)") },
1280 + { Qt::Key_LaunchE, QT_TRANSLATE_NOOP("QShortcut", "Launch (E)") },
1281 + { Qt::Key_LaunchF, QT_TRANSLATE_NOOP("QShortcut", "Launch (F)") },
1282 + { Qt::Key_MonBrightnessUp, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Up") },
1283 + { Qt::Key_MonBrightnessDown, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Down") },
1284 + { Qt::Key_KeyboardLightOnOff, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Light On/Off") },
1285 + { Qt::Key_KeyboardBrightnessUp, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Brightness Up") },
1286 + { Qt::Key_KeyboardBrightnessDown, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Brightness Down") },
1287 + { Qt::Key_PowerOff, QT_TRANSLATE_NOOP("QShortcut", "Power Off") },
1288 + { Qt::Key_WakeUp, QT_TRANSLATE_NOOP("QShortcut", "Wake Up") },
1289 + { Qt::Key_Eject, QT_TRANSLATE_NOOP("QShortcut", "Eject") },
1290 + { Qt::Key_ScreenSaver, QT_TRANSLATE_NOOP("QShortcut", "Screensaver") },
1291 + { Qt::Key_WWW, QT_TRANSLATE_NOOP("QShortcut", "WWW") },
1292 + { Qt::Key_Sleep, QT_TRANSLATE_NOOP("QShortcut", "Sleep") },
1293 + { Qt::Key_LightBulb, QT_TRANSLATE_NOOP("QShortcut", "LightBulb") },
1294 + { Qt::Key_Shop, QT_TRANSLATE_NOOP("QShortcut", "Shop") },
1295 + { Qt::Key_History, QT_TRANSLATE_NOOP("QShortcut", "History") },
1296 + { Qt::Key_AddFavorite, QT_TRANSLATE_NOOP("QShortcut", "Add Favorite") },
1297 + { Qt::Key_HotLinks, QT_TRANSLATE_NOOP("QShortcut", "Hot Links") },
1298 + { Qt::Key_BrightnessAdjust, QT_TRANSLATE_NOOP("QShortcut", "Adjust Brightness") },
1299 + { Qt::Key_Finance, QT_TRANSLATE_NOOP("QShortcut", "Finance") },
1300 + { Qt::Key_Community, QT_TRANSLATE_NOOP("QShortcut", "Community") },
1301 + { Qt::Key_AudioRewind, QT_TRANSLATE_NOOP("QShortcut", "Audio Rewind") },
1302 + { Qt::Key_BackForward, QT_TRANSLATE_NOOP("QShortcut", "Back Forward") },
1303 + { Qt::Key_ApplicationLeft, QT_TRANSLATE_NOOP("QShortcut", "Application Left") },
1304 + { Qt::Key_ApplicationRight, QT_TRANSLATE_NOOP("QShortcut", "Application Right") },
1305 + { Qt::Key_Book, QT_TRANSLATE_NOOP("QShortcut", "Book") },
1306 + { Qt::Key_CD, QT_TRANSLATE_NOOP("QShortcut", "CD") },
1307 + { Qt::Key_Calculator, QT_TRANSLATE_NOOP("QShortcut", "Calculator") },
1308 + { Qt::Key_Clear, QT_TRANSLATE_NOOP("QShortcut", "Clear") },
1309 + { Qt::Key_ClearGrab, QT_TRANSLATE_NOOP("QShortcut", "Clear Grab") },
1310 + { Qt::Key_Close, QT_TRANSLATE_NOOP("QShortcut", "Close") },
1311 + { Qt::Key_Copy, QT_TRANSLATE_NOOP("QShortcut", "Copy") },
1312 + { Qt::Key_Cut, QT_TRANSLATE_NOOP("QShortcut", "Cut") },
1313 + { Qt::Key_Display, QT_TRANSLATE_NOOP("QShortcut", "Display") },
1314 + { Qt::Key_DOS, QT_TRANSLATE_NOOP("QShortcut", "DOS") },
1315 + { Qt::Key_Documents, QT_TRANSLATE_NOOP("QShortcut", "Documents") },
1316 + { Qt::Key_Excel, QT_TRANSLATE_NOOP("QShortcut", "Spreadsheet") },
1317 + { Qt::Key_Explorer, QT_TRANSLATE_NOOP("QShortcut", "Browser") },
1318 + { Qt::Key_Game, QT_TRANSLATE_NOOP("QShortcut", "Game") },
1319 + { Qt::Key_Go, QT_TRANSLATE_NOOP("QShortcut", "Go") },
1320 + { Qt::Key_iTouch, QT_TRANSLATE_NOOP("QShortcut", "iTouch") },
1321 + { Qt::Key_LogOff, QT_TRANSLATE_NOOP("QShortcut", "Logoff") },
1322 + { Qt::Key_Market, QT_TRANSLATE_NOOP("QShortcut", "Market") },
1323 + { Qt::Key_Meeting, QT_TRANSLATE_NOOP("QShortcut", "Meeting") },
1324 + { Qt::Key_MenuKB, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Menu") },
1325 + { Qt::Key_MenuPB, QT_TRANSLATE_NOOP("QShortcut", "Menu PB") },
1326 + { Qt::Key_MySites, QT_TRANSLATE_NOOP("QShortcut", "My Sites") },
1327 + { Qt::Key_News, QT_TRANSLATE_NOOP("QShortcut", "News") },
1328 + { Qt::Key_OfficeHome, QT_TRANSLATE_NOOP("QShortcut", "Home Office") },
1329 + { Qt::Key_Option, QT_TRANSLATE_NOOP("QShortcut", "Option") },
1330 + { Qt::Key_Paste, QT_TRANSLATE_NOOP("QShortcut", "Paste") },
1331 + { Qt::Key_Phone, QT_TRANSLATE_NOOP("QShortcut", "Phone") },
1332 + { Qt::Key_Reply, QT_TRANSLATE_NOOP("QShortcut", "Reply") },
1333 + { Qt::Key_Reload, QT_TRANSLATE_NOOP("QShortcut", "Reload") },
1334 + { Qt::Key_RotateWindows, QT_TRANSLATE_NOOP("QShortcut", "Rotate Windows") },
1335 + { Qt::Key_RotationPB, QT_TRANSLATE_NOOP("QShortcut", "Rotation PB") },
1336 + { Qt::Key_RotationKB, QT_TRANSLATE_NOOP("QShortcut", "Rotation KB") },
1337 + { Qt::Key_Save, QT_TRANSLATE_NOOP("QShortcut", "Save") },
1338 + { Qt::Key_Send, QT_TRANSLATE_NOOP("QShortcut", "Send") },
1339 + { Qt::Key_Spell, QT_TRANSLATE_NOOP("QShortcut", "Spellchecker") },
1340 + { Qt::Key_SplitScreen, QT_TRANSLATE_NOOP("QShortcut", "Split Screen") },
1341 + { Qt::Key_Support, QT_TRANSLATE_NOOP("QShortcut", "Support") },
1342 + { Qt::Key_TaskPane, QT_TRANSLATE_NOOP("QShortcut", "Task Panel") },
1343 + { Qt::Key_Terminal, QT_TRANSLATE_NOOP("QShortcut", "Terminal") },
1344 + { Qt::Key_Tools, QT_TRANSLATE_NOOP("QShortcut", "Tools") },
1345 + { Qt::Key_Travel, QT_TRANSLATE_NOOP("QShortcut", "Travel") },
1346 + { Qt::Key_Video, QT_TRANSLATE_NOOP("QShortcut", "Video") },
1347 + { Qt::Key_Word, QT_TRANSLATE_NOOP("QShortcut", "Word Processor") },
1348 + { Qt::Key_Xfer, QT_TRANSLATE_NOOP("QShortcut", "XFer") },
1349 + { Qt::Key_ZoomIn, QT_TRANSLATE_NOOP("QShortcut", "Zoom In") },
1350 + { Qt::Key_ZoomOut, QT_TRANSLATE_NOOP("QShortcut", "Zoom Out") },
1351 + { Qt::Key_Away, QT_TRANSLATE_NOOP("QShortcut", "Away") },
1352 + { Qt::Key_Messenger, QT_TRANSLATE_NOOP("QShortcut", "Messenger") },
1353 + { Qt::Key_WebCam, QT_TRANSLATE_NOOP("QShortcut", "WebCam") },
1354 + { Qt::Key_MailForward, QT_TRANSLATE_NOOP("QShortcut", "Mail Forward") },
1355 + { Qt::Key_Pictures, QT_TRANSLATE_NOOP("QShortcut", "Pictures") },
1356 + { Qt::Key_Music, QT_TRANSLATE_NOOP("QShortcut", "Music") },
1357 + { Qt::Key_Battery, QT_TRANSLATE_NOOP("QShortcut", "Battery") },
1358 + { Qt::Key_Bluetooth, QT_TRANSLATE_NOOP("QShortcut", "Bluetooth") },
1359 + { Qt::Key_WLAN, QT_TRANSLATE_NOOP("QShortcut", "Wireless") },
1360 + { Qt::Key_UWB, QT_TRANSLATE_NOOP("QShortcut", "Ultra Wide Band") },
1361 + { Qt::Key_AudioForward, QT_TRANSLATE_NOOP("QShortcut", "Audio Forward") },
1362 + { Qt::Key_AudioRepeat, QT_TRANSLATE_NOOP("QShortcut", "Audio Repeat") },
1363 + { Qt::Key_AudioRandomPlay, QT_TRANSLATE_NOOP("QShortcut", "Audio Random Play") },
1364 + { Qt::Key_Subtitle, QT_TRANSLATE_NOOP("QShortcut", "Subtitle") },
1365 + { Qt::Key_AudioCycleTrack, QT_TRANSLATE_NOOP("QShortcut", "Audio Cycle Track") },
1366 + { Qt::Key_Time, QT_TRANSLATE_NOOP("QShortcut", "Time") },
1367 + { Qt::Key_Select, QT_TRANSLATE_NOOP("QShortcut", "Select") },
1368 + { Qt::Key_View, QT_TRANSLATE_NOOP("QShortcut", "View") },
1369 + { Qt::Key_TopMenu, QT_TRANSLATE_NOOP("QShortcut", "Top Menu") },
1370 + { Qt::Key_Suspend, QT_TRANSLATE_NOOP("QShortcut", "Suspend") },
1371 + { Qt::Key_Hibernate, QT_TRANSLATE_NOOP("QShortcut", "Hibernate") },
1372
1373 // --------------------------------------------------------------
1374 // More consistent namings
1375 @@ -991,10 +1083,10 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
1376
1377 QList<QModifKeyName> modifs;
1378 if (nativeText) {
1379 - modifs << QModifKeyName(Qt::CTRL, QShortcut::tr("Ctrl").toLower().append(QLatin1Char('+')))
1380 - << QModifKeyName(Qt::SHIFT, QShortcut::tr("Shift").toLower().append(QLatin1Char('+')))
1381 - << QModifKeyName(Qt::ALT, QShortcut::tr("Alt").toLower().append(QLatin1Char('+')))
1382 - << QModifKeyName(Qt::META, QShortcut::tr("Meta").toLower().append(QLatin1Char('+')));
1383 + modifs << QModifKeyName(Qt::CTRL, QShortcut::tr("Ctrl", "Ctrl key, used for shortcuts").toLower().append(QLatin1Char('+')))
1384 + << QModifKeyName(Qt::SHIFT, QShortcut::tr("Shift", "Shift key, used for shortcuts").toLower().append(QLatin1Char('+')))
1385 + << QModifKeyName(Qt::ALT, QShortcut::tr("Alt", "Alt key, used for shortcuts").toLower().append(QLatin1Char('+')))
1386 + << QModifKeyName(Qt::META, QShortcut::tr("Meta", "Meta key, used for shortcuts").toLower().append(QLatin1Char('+')));
1387 }
1388 modifs += *gmodifs; // Test non-translated ones last
1389
1390 @@ -1086,7 +1178,7 @@ QString QKeySequence::encodeString(int key)
1391 static inline void addKey(QString &str, const QString &theKey, QKeySequence::SequenceFormat format)
1392 {
1393 if (!str.isEmpty())
1394 - str += (format == QKeySequence::NativeText) ? QShortcut::tr("+")
1395 + str += (format == QKeySequence::NativeText) ? QShortcut::tr("+", "Symbol used to concatenate keys in shortcuts")
1396 : QString::fromLatin1("+");
1397 str += theKey;
1398 }
1399 @@ -1111,13 +1203,13 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
1400 {
1401 // On other systems the order is Meta, Control, Alt, Shift
1402 if ((key & Qt::META) == Qt::META)
1403 - s = nativeText ? QShortcut::tr("Meta") : QString::fromLatin1("Meta");
1404 + s = nativeText ? QShortcut::tr("Meta", "Meta key, used for shortcuts") : QString::fromLatin1("Meta");
1405 if ((key & Qt::CTRL) == Qt::CTRL)
1406 - addKey(s, nativeText ? QShortcut::tr("Ctrl") : QString::fromLatin1("Ctrl"), format);
1407 + addKey(s, nativeText ? QShortcut::tr("Ctrl", "Ctrl key, used for shortcuts") : QString::fromLatin1("Ctrl"), format);
1408 if ((key & Qt::ALT) == Qt::ALT)
1409 - addKey(s, nativeText ? QShortcut::tr("Alt") : QString::fromLatin1("Alt"), format);
1410 + addKey(s, nativeText ? QShortcut::tr("Alt", "Alt key, used for shortcuts") : QString::fromLatin1("Alt"), format);
1411 if ((key & Qt::SHIFT) == Qt::SHIFT)
1412 - addKey(s, nativeText ? QShortcut::tr("Shift") : QString::fromLatin1("Shift"), format);
1413 + addKey(s, nativeText ? QShortcut::tr("Shift", "Shift key, used for shortcuts") : QString::fromLatin1("Shift"), format);
1414 }
1415
1416
1417 @@ -1132,7 +1224,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
1418 p += QChar((key-0x10000)%400+0xdc00);
1419 }
1420 } else if (key >= Qt::Key_F1 && key <= Qt::Key_F35) {
1421 - p = nativeText ? QShortcut::tr("F%1").arg(key - Qt::Key_F1 + 1)
1422 + p = nativeText ? QShortcut::tr("F%1", "Fx key, used for shortcuts").arg(key - Qt::Key_F1 + 1)
1423 : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1);
1424 } else if (key) {
1425 int i=0;
1426 diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
1427 index 145d7bb..db943fc 100644
1428 --- a/src/gui/kernel/qwidget_p.h
1429 +++ b/src/gui/kernel/qwidget_p.h
1430 @@ -360,6 +360,7 @@ public:
1431
1432 #if defined(Q_WS_X11)
1433 void setWindowRole();
1434 + virtual void checkWindowRole();
1435 void sendStartupMessage(const char *message) const;
1436 void setNetWmWindowTypes();
1437 void x11UpdateIsOpaque();
1438 diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
1439 index 4cc255d..927d739 100644
1440 --- a/src/gui/kernel/qwidget_x11.cpp
1441 +++ b/src/gui/kernel/qwidget_x11.cpp
1442 @@ -719,6 +719,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
1443 Q_ASSERT(id);
1444 XChangeWindowAttributes(dpy, id, CWOverrideRedirect | CWSaveUnder,
1445 &wsa);
1446 + XClassHint class_hint;
1447 + QByteArray appName = qAppName().toLatin1();
1448 + class_hint.res_name = appName.data(); // application name
1449 + class_hint.res_class = const_cast<char *>(QX11Info::appClass()); // application class
1450 + XSetWMProperties(dpy, id, 0, 0, 0, 0, 0, 0, &class_hint);
1451 } else if (topLevel && !desktop) { // top-level widget
1452 if (!X11->wm_client_leader)
1453 create_wm_client_leader();
1454 @@ -769,32 +774,40 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
1455 // set EWMH window types
1456 setNetWmWindowTypes();
1457
1458 + // when we create a toplevel widget, the frame strut should be dirty
1459 + data.fstrut_dirty = 1;
1460 +
1461 + } else {
1462 + // non-toplevel widgets don't have a frame, so no need to
1463 + // update the strut
1464 + data.fstrut_dirty = 0;
1465 + }
1466 +
1467 + if (initializeWindow && (popup || (topLevel && !desktop))) { // properties set on all toplevel windows
1468 // set _NET_WM_PID
1469 long curr_pid = getpid();
1470 XChangeProperty(dpy, id, ATOM(_NET_WM_PID), XA_CARDINAL, 32, PropModeReplace,
1471 (unsigned char *) &curr_pid, 1);
1472
1473 - // when we create a toplevel widget, the frame strut should be dirty
1474 - data.fstrut_dirty = 1;
1475
1476 // declare the widget's window role
1477 + QByteArray windowRole;
1478 if (QTLWExtra *topData = maybeTopData()) {
1479 - if (!topData->role.isEmpty()) {
1480 - QByteArray windowRole = topData->role.toUtf8();
1481 - XChangeProperty(dpy, id,
1482 - ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace,
1483 - (unsigned char *)windowRole.constData(), windowRole.length());
1484 - }
1485 + if (!topData->role.isEmpty())
1486 + windowRole = topData->role.toUtf8();
1487 + }
1488 + if (windowRole.isEmpty()) // use object name as a fallback
1489 + windowRole = objectName.toUtf8();
1490 + if (!windowRole.isEmpty()) {
1491 + XChangeProperty(dpy, id,
1492 + ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace,
1493 + (unsigned char *)windowRole.constData(), windowRole.length());
1494 }
1495
1496 // set client leader property
1497 XChangeProperty(dpy, id, ATOM(WM_CLIENT_LEADER),
1498 XA_WINDOW, 32, PropModeReplace,
1499 (unsigned char *)&X11->wm_client_leader, 1);
1500 - } else {
1501 - // non-toplevel widgets don't have a frame, so no need to
1502 - // update the strut
1503 - data.fstrut_dirty = 0;
1504 }
1505
1506 if (initializeWindow && q->internalWinId()) {
1507 @@ -2765,6 +2778,17 @@ void QWidgetPrivate::setWindowRole()
1508 (unsigned char *)windowRole.constData(), windowRole.length());
1509 }
1510
1511 +void QWidgetPrivate::checkWindowRole()
1512 +{
1513 + Q_Q(QWidget);
1514 + if( !q->windowRole().isEmpty() || !q->internalWinId())
1515 + return;
1516 + QByteArray windowRole = objectName.toUtf8(); // use as a fallback
1517 + XChangeProperty(X11->display, q->internalWinId(),
1518 + ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace,
1519 + (unsigned char *)windowRole.constData(), windowRole.length());
1520 +}
1521 +
1522 Q_GLOBAL_STATIC(QX11PaintEngine, qt_widget_paintengine)
1523 QPaintEngine *QWidget::paintEngine() const
1524 {
1525 diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
1526 index e077d0d..424e525 100644
1527 --- a/src/gui/painting/qwindowsurface_raster.cpp
1528 +++ b/src/gui/painting/qwindowsurface_raster.cpp
1529 @@ -220,9 +220,16 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
1530
1531 QRect br = rgn.boundingRect().translated(offset);
1532 #ifndef QT_NO_MITSHM
1533 - if (d_ptr->image->xshmpm) {
1534 - XCopyArea(X11->display, d_ptr->image->xshmpm, widget->handle(), d_ptr->gc,
1535 - br.x(), br.y(), br.width(), br.height(), wbr.x(), wbr.y());
1536 + if (d_ptr->image->xshmimg && (br.width() * br.height() > 65536)) {
1537 + const QImage &src = d->image->image;
1538 + br = br.intersected(src.rect());
1539 + // Hack to make sure we satisify the PutImage() constraints in the X server,
1540 + // since the doShmPutImage() route currently forces a migration to system ram.
1541 + wbr.setX(wbr.x() - br.x());
1542 + br.setX(0);
1543 + br.setWidth(src.width());
1544 + XShmPutImage(X11->display, widget->handle(), d_ptr->gc, d_ptr->image->xshmimg,
1545 + br.x(), br.y(), wbr.x(), wbr.y(), br.width(), br.height(), False);
1546 XSync(X11->display, False);
1547 } else
1548 #endif
1549 diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
1550 index 7793b80..5e5c7cf 100644
1551 --- a/src/gui/widgets/qmenu.cpp
1552 +++ b/src/gui/widgets/qmenu.cpp
1553 @@ -280,7 +280,7 @@ void QMenuPrivate::calcActionRects(QMap<QAction*, QRect> &actionRects, QList<QAc
1554
1555
1556 if (!sz.isEmpty()) {
1557 - max_column_width = qMax(max_column_width, sz.width());
1558 + max_column_width = qMax(q->minimumWidth(), qMax(max_column_width, sz.width()));
1559 //wrapping
1560 if (!scroll &&
1561 y+sz.height()+vmargin > dh - (q->style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, q) * 2)) {
1562 diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
1563 index 8a87b75..0fbc116 100644
1564 --- a/src/gui/widgets/qtabbar.cpp
1565 +++ b/src/gui/widgets/qtabbar.cpp
1566 @@ -675,8 +675,8 @@ void QTabBarPrivate::refresh()
1567 layoutTabs();
1568 makeVisible(currentIndex);
1569 q->update();
1570 - q->updateGeometry();
1571 }
1572 + q->updateGeometry();
1573 }
1574
1575 /*!
1576 diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
1577 index d1cb82c..54537e5 100644
1578 --- a/src/tools/moc/main.cpp
1579 +++ b/src/tools/moc/main.cpp
1580 @@ -94,7 +94,13 @@ static QByteArray combinePath(const char *infile, const char *outfile)
1581 inSplitted.prepend(QLatin1String(".."));
1582 }
1583 inSplitted.append(inFileInfo.fileName());
1584 +#ifdef Q_WS_WIN
1585 + const QString rel = inSplitted.join(QLatin1String("/"));
1586 + const QString abs = inFileInfo.absoluteFilePath();
1587 + return QFile::encodeName(rel.length() < abs.length() ? rel : abs);
1588 +#else
1589 return QFile::encodeName(inSplitted.join(QLatin1String("/")));
1590 +#endif
1591 }
1592
1593