Changeset View
Changeset View
Standalone View
Standalone View
utils.cpp
Show All 29 Lines | |||||
30 | #include <QWidget> | 30 | #include <QWidget> | ||
31 | #include <kkeyserver.h> | 31 | #include <kkeyserver.h> | ||
32 | 32 | | |||
33 | #ifndef KCMRULES | 33 | #ifndef KCMRULES | ||
34 | #include <assert.h> | 34 | #include <assert.h> | ||
35 | #include <QApplication> | 35 | #include <QApplication> | ||
36 | #include <QDebug> | 36 | #include <QDebug> | ||
37 | 37 | | |||
38 | #include <QX11Info> | | |||
39 | #include <X11/Xlib.h> | 38 | #include <X11/Xlib.h> | ||
40 | 39 | | |||
41 | #include <stdio.h> | 40 | #include <stdio.h> | ||
42 | 41 | | |||
43 | #include "atoms.h" | 42 | #include "atoms.h" | ||
43 | #include "platform.h" | ||||
44 | #include "workspace.h" | 44 | #include "workspace.h" | ||
45 | 45 | | |||
46 | #include <signal.h> | 46 | #include <signal.h> | ||
47 | 47 | | |||
48 | #endif | 48 | #endif | ||
49 | 49 | | |||
50 | Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg) | 50 | Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg) | ||
51 | namespace KWin | 51 | namespace KWin | ||
Show All 15 Lines | 66 | StrutRect::StrutRect(const StrutRect& other) | |||
67 | : QRect(other) | 67 | : QRect(other) | ||
68 | , m_area(other.area()) | 68 | , m_area(other.area()) | ||
69 | { | 69 | { | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | #endif | 72 | #endif | ||
73 | 73 | | |||
74 | #ifndef KCMRULES | 74 | #ifndef KCMRULES | ||
75 | /* | | |||
76 | Updates xTime(). This used to simply fetch current timestamp from the server, | | |||
77 | but that can cause xTime() to be newer than timestamp of events that are | | |||
78 | still in our events queue, thus e.g. making XSetInputFocus() caused by such | | |||
79 | event to be ignored. Therefore events queue is searched for first | | |||
80 | event with timestamp, and extra PropertyNotify is generated in order to make | | |||
81 | sure such event is found. | | |||
82 | */ | | |||
83 | void updateXTime() | 75 | void updateXTime() | ||
84 | { | 76 | { | ||
85 | // NOTE: QX11Info::getTimestamp does not yet search the event queue as the old | 77 | kwinApp()->platform()->updateXTime(); | ||
86 | // solution did. This means there might be regressions currently. See the | | |||
87 | // documentation above on how it should be done properly. | | |||
88 | kwinApp()->setX11Time(QX11Info::getTimestamp(), Application::TimestampUpdate::Always); | | |||
89 | } | 78 | } | ||
90 | 79 | | |||
91 | static int server_grab_count = 0; | 80 | static int server_grab_count = 0; | ||
92 | 81 | | |||
93 | void grabXServer() | 82 | void grabXServer() | ||
94 | { | 83 | { | ||
95 | if (++server_grab_count == 1) | 84 | if (++server_grab_count == 1) | ||
96 | xcb_grab_server(connection()); | 85 | xcb_grab_server(connection()); | ||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |