Changeset View
Changeset View
Standalone View
Standalone View
sync_filter.cpp
- This file was moved from plugins/platforms/x11/standalone/sync_filter.cpp.
Show All 19 Lines | |||||
20 | #include "sync_filter.h" | 20 | #include "sync_filter.h" | ||
21 | #include "x11client.h" | 21 | #include "x11client.h" | ||
22 | #include "workspace.h" | 22 | #include "workspace.h" | ||
23 | #include "xcbutils.h" | 23 | #include "xcbutils.h" | ||
24 | 24 | | |||
25 | namespace KWin | 25 | namespace KWin | ||
26 | { | 26 | { | ||
27 | 27 | | |||
28 | SyncFilter::SyncFilter() | 28 | SyncAlarmNotifyX11Filter::SyncAlarmNotifyX11Filter() | ||
29 | : X11EventFilter(QVector<int>{Xcb::Extensions::self()->syncAlarmNotifyEvent()}) | 29 | : X11EventFilter(QVector<int>{Xcb::Extensions::self()->syncAlarmNotifyEvent()}) | ||
30 | { | 30 | { | ||
31 | } | 31 | } | ||
32 | 32 | | |||
33 | bool SyncFilter::event(xcb_generic_event_t *event) | 33 | bool SyncAlarmNotifyX11Filter::event(xcb_generic_event_t *event) | ||
34 | { | 34 | { | ||
35 | auto e = reinterpret_cast< xcb_sync_alarm_notify_event_t* >(event); | 35 | auto e = reinterpret_cast< xcb_sync_alarm_notify_event_t* >(event); | ||
36 | auto client = workspace()->findClient( | 36 | auto client = workspace()->findClient( | ||
37 | [e] (const X11Client *c) { | 37 | [e] (const X11Client *c) { | ||
38 | const auto syncRequest = c->syncRequest(); | 38 | const auto syncRequest = c->syncRequest(); | ||
39 | return e->alarm == syncRequest.alarm && e->counter_value.hi == syncRequest.value.hi && e->counter_value.lo == syncRequest.value.lo; | 39 | return e->alarm == syncRequest.alarm && e->counter_value.hi == syncRequest.value.hi && e->counter_value.lo == syncRequest.value.lo; | ||
40 | } | 40 | } | ||
41 | ); | 41 | ); | ||
42 | if (client) { | 42 | if (client) { | ||
43 | client->handleSync(); | 43 | client->handleSync(); | ||
44 | } | 44 | } | ||
45 | return false; | 45 | return false; | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | } | 48 | } |