Salome HOME
Update patch for Salome 4.9.13
[tools/install.git] / config_files / patches / qt-4.5.2.patch
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."
5
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.
14
15 This reverts commit 2ed015b8a0ffad63f0f59b0e2255057f416895fb.
16
17 Reviewed-By: Brad
18 ---
19  src/gui/kernel/qapplication_x11.cpp |   35 +++++++++++++++--------------------
20  1 files changed, 15 insertions(+), 20 deletions(-)
21
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)
27  #ifdef ALIEN_DEBUG
28      //qDebug() << "QApplication::x11ProcessEvent:" << event->type;
29  #endif
30 -    Time time = 0, userTime = 0;
31      switch (event->type) {
32      case ButtonPress:
33          pressed_window = event->xbutton.window;
34 -        userTime = event->xbutton.time;
35 +        X11->userTime = event->xbutton.time;
36          // fallthrough intended
37      case ButtonRelease:
38 -        time = event->xbutton.time;
39 +        X11->time = event->xbutton.time;
40          break;
41      case MotionNotify:
42 -        time = event->xmotion.time;
43 +        X11->time = event->xmotion.time;
44          break;
45      case XKeyPress:
46 -        userTime = event->xkey.time;
47 +        X11->userTime = event->xkey.time;
48          // fallthrough intended
49      case XKeyRelease:
50 -        time = event->xkey.time;
51 +        X11->time = event->xkey.time;
52          break;
53      case PropertyNotify:
54 -        time = event->xproperty.time;
55 +        X11->time = event->xproperty.time;
56          break;
57      case EnterNotify:
58      case LeaveNotify:
59 -        time = event->xcrossing.time;
60 +        X11->time = event->xcrossing.time;
61          break;
62      case SelectionClear:
63 -        time = event->xselectionclear.time;
64 +        X11->time = event->xselectionclear.time;
65          break;
66      default:
67 -#ifndef QT_NO_XFIXES
68 -        if (X11->use_xfixes && event->type == (X11->xfixes_eventbase + XFixesSelectionNotify)) {
69 -            XFixesSelectionNotifyEvent *req =
70 -                reinterpret_cast<XFixesSelectionNotifyEvent *>(event);
71 -            time = req->selection_timestamp;
72 -        }
73 -#endif
74          break;
75      }
76 -    if (time > X11->time)
77 -        X11->time = time;
78 -    if (userTime > X11->userTime)
79 -        X11->userTime = userTime;
80 +#ifndef QT_NO_XFIXES
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;
85 +    }
86 +#endif
87  
88      QETWidget *widget = (QETWidget*)QWidget::find((WId)event->xany.window);
89  
90 -- 
91 1.6.1
92