1 From 9e5fa633913ef952ca4ef5312fe396bcfc885321 Mon Sep 17 00:00:00 2001
2 From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
3 Date: Wed, 22 Jul 2009 17:12:17 +0200
4 Subject: [PATCH] Revert "Added a check that X11 timestamp goes forward only."
6 In some cases we might get an invalid timestamp that is far away in
7 the future, so remembering it will break all consequent X calls that
8 require a timestamp because it just contains junk (for example
9 clipboard will stop working). This happens with XIM+SCIM pair -
10 whenever we start input method and type something to the widget, we
11 get a XKeyPress event with a commited string, however the 'serial' and
12 'time' members of the XEvent structure are not initialized (according
13 to valgrind) and contain junk.
15 This reverts commit 2ed015b8a0ffad63f0f59b0e2255057f416895fb.
19 src/gui/kernel/qapplication_x11.cpp | 35 +++++++++++++++--------------------
20 1 files changed, 15 insertions(+), 20 deletions(-)
22 diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
23 index 163ceb6..abedfd6 100644
24 --- a/src/gui/kernel/qapplication_x11.cpp
25 +++ b/src/gui/kernel/qapplication_x11.cpp
26 @@ -3142,48 +3142,43 @@ int QApplication::x11ProcessEvent(XEvent* event)
28 //qDebug() << "QApplication::x11ProcessEvent:" << event->type;
30 - Time time = 0, userTime = 0;
31 switch (event->type) {
33 pressed_window = event->xbutton.window;
34 - userTime = event->xbutton.time;
35 + X11->userTime = event->xbutton.time;
36 // fallthrough intended
38 - time = event->xbutton.time;
39 + X11->time = event->xbutton.time;
42 - time = event->xmotion.time;
43 + X11->time = event->xmotion.time;
46 - userTime = event->xkey.time;
47 + X11->userTime = event->xkey.time;
48 // fallthrough intended
50 - time = event->xkey.time;
51 + X11->time = event->xkey.time;
54 - time = event->xproperty.time;
55 + X11->time = event->xproperty.time;
59 - time = event->xcrossing.time;
60 + X11->time = event->xcrossing.time;
63 - time = event->xselectionclear.time;
64 + X11->time = event->xselectionclear.time;
68 - if (X11->use_xfixes && event->type == (X11->xfixes_eventbase + XFixesSelectionNotify)) {
69 - XFixesSelectionNotifyEvent *req =
70 - reinterpret_cast<XFixesSelectionNotifyEvent *>(event);
71 - time = req->selection_timestamp;
76 - if (time > X11->time)
78 - if (userTime > X11->userTime)
79 - X11->userTime = userTime;
81 + if (X11->use_xfixes && event->type == (X11->xfixes_eventbase + XFixesSelectionNotify)) {
82 + XFixesSelectionNotifyEvent *req =
83 + reinterpret_cast<XFixesSelectionNotifyEvent *>(event);
84 + X11->time = req->selection_timestamp;
88 QETWidget *widget = (QETWidget*)QWidget::find((WId)event->xany.window);