Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/x11_platform.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "x11_platform.h" | 20 | #include "x11_platform.h" | ||
21 | #include "x11cursor.h" | 21 | #include "x11cursor.h" | ||
22 | #include "edge.h" | 22 | #include "edge.h" | ||
23 | #include "sync_filter.h" | | |||
24 | #include "windowselector.h" | 23 | #include "windowselector.h" | ||
25 | #include <config-kwin.h> | 24 | #include <config-kwin.h> | ||
26 | #include <kwinconfig.h> | 25 | #include <kwinconfig.h> | ||
27 | #if HAVE_EPOXY_GLX | 26 | #if HAVE_EPOXY_GLX | ||
28 | #include "glxbackend.h" | 27 | #include "glxbackend.h" | ||
29 | #endif | 28 | #endif | ||
30 | #if HAVE_X11_XINPUT | 29 | #if HAVE_X11_XINPUT | ||
31 | #include "xinputintegration.h" | 30 | #include "xinputintegration.h" | ||
Show All 37 Lines | 65 | if (!qEnvironmentVariableIsSet("KWIN_NO_XI2")) { | |||
69 | if (!m_xinputIntegration->hasXinput()) { | 68 | if (!m_xinputIntegration->hasXinput()) { | ||
70 | delete m_xinputIntegration; | 69 | delete m_xinputIntegration; | ||
71 | m_xinputIntegration = nullptr; | 70 | m_xinputIntegration = nullptr; | ||
72 | } else { | 71 | } else { | ||
73 | connect(kwinApp(), &Application::workspaceCreated, m_xinputIntegration, &XInputIntegration::startListening); | 72 | connect(kwinApp(), &Application::workspaceCreated, m_xinputIntegration, &XInputIntegration::startListening); | ||
74 | } | 73 | } | ||
75 | } | 74 | } | ||
76 | #endif | 75 | #endif | ||
77 | connect(kwinApp(), &Application::workspaceCreated, this, | | |||
78 | [this] { | | |||
79 | if (Xcb::Extensions::self()->isSyncAvailable()) { | | |||
80 | m_syncFilter = std::make_unique<SyncFilter>(); | | |||
81 | } | | |||
82 | } | | |||
83 | ); | | |||
84 | 76 | | |||
85 | setSupportsGammaControl(true); | 77 | setSupportsGammaControl(true); | ||
86 | } | 78 | } | ||
87 | 79 | | |||
88 | X11StandalonePlatform::~X11StandalonePlatform() | 80 | X11StandalonePlatform::~X11StandalonePlatform() | ||
89 | { | 81 | { | ||
90 | if (m_openGLFreezeProtectionThread) { | 82 | if (m_openGLFreezeProtectionThread) { | ||
91 | m_openGLFreezeProtectionThread->quit(); | 83 | m_openGLFreezeProtectionThread->quit(); | ||
▲ Show 20 Lines • Show All 251 Lines • ▼ Show 20 Line(s) | 327 | { | |||
343 | }); | 335 | }); | ||
344 | } | 336 | } | ||
345 | 337 | | |||
346 | OverlayWindow *X11StandalonePlatform::createOverlayWindow() | 338 | OverlayWindow *X11StandalonePlatform::createOverlayWindow() | ||
347 | { | 339 | { | ||
348 | return new OverlayWindowX11(); | 340 | return new OverlayWindowX11(); | ||
349 | } | 341 | } | ||
350 | 342 | | |||
351 | /* | | |||
352 | Updates xTime(). This used to simply fetch current timestamp from the server, | | |||
353 | but that can cause xTime() to be newer than timestamp of events that are | | |||
354 | still in our events queue, thus e.g. making XSetInputFocus() caused by such | | |||
355 | event to be ignored. Therefore events queue is searched for first | | |||
356 | event with timestamp, and extra PropertyNotify is generated in order to make | | |||
357 | sure such event is found. | | |||
358 | */ | | |||
359 | void X11StandalonePlatform::updateXTime() | | |||
360 | { | | |||
361 | // NOTE: QX11Info::getTimestamp does not yet search the event queue as the old | | |||
362 | // solution did. This means there might be regressions currently. See the | | |||
363 | // documentation above on how it should be done properly. | | |||
364 | kwinApp()->setX11Time(QX11Info::getTimestamp(), Application::TimestampUpdate::Always); | | |||
365 | } | | |||
366 | | ||||
367 | OutlineVisual *X11StandalonePlatform::createOutline(Outline *outline) | 343 | OutlineVisual *X11StandalonePlatform::createOutline(Outline *outline) | ||
368 | { | 344 | { | ||
369 | // first try composited Outline | 345 | // first try composited Outline | ||
370 | auto ret = Platform::createOutline(outline); | 346 | auto ret = Platform::createOutline(outline); | ||
371 | if (!ret) { | 347 | if (!ret) { | ||
372 | ret = new NonCompositedOutlineVisual(outline); | 348 | ret = new NonCompositedOutlineVisual(outline); | ||
373 | } | 349 | } | ||
374 | return ret; | 350 | return ret; | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |