Changeset View
Changeset View
Standalone View
Standalone View
moving_client_x11_filter.cpp
Show All 12 Lines | |||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
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 "moving_client_x11_filter.h" | 20 | #include "moving_client_x11_filter.h" | ||
21 | #include "client.h" | 21 | #include "x11client.h" | ||
22 | #include "workspace.h" | 22 | #include "workspace.h" | ||
23 | #include <KKeyServer> | 23 | #include <KKeyServer> | ||
24 | #include <xcb/xcb.h> | 24 | #include <xcb/xcb.h> | ||
25 | 25 | | |||
26 | namespace KWin | 26 | namespace KWin | ||
27 | { | 27 | { | ||
28 | 28 | | |||
29 | MovingClientX11Filter::MovingClientX11Filter() | 29 | MovingClientX11Filter::MovingClientX11Filter() | ||
30 | : X11EventFilter(QVector<int>{XCB_KEY_PRESS, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE}) | 30 | : X11EventFilter(QVector<int>{XCB_KEY_PRESS, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE}) | ||
31 | { | 31 | { | ||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | bool MovingClientX11Filter::event(xcb_generic_event_t *event) | 34 | bool MovingClientX11Filter::event(xcb_generic_event_t *event) | ||
35 | { | 35 | { | ||
36 | auto client = dynamic_cast<Client*>(workspace()->moveResizeClient()); | 36 | auto client = dynamic_cast<X11Client *>(workspace()->moveResizeClient()); | ||
37 | if (!client) { | 37 | if (!client) { | ||
38 | return false; | 38 | return false; | ||
39 | } | 39 | } | ||
40 | auto testWindow = [client, event] (xcb_window_t window) { | 40 | auto testWindow = [client, event] (xcb_window_t window) { | ||
41 | return client->moveResizeGrabWindow() == window && client->windowEvent(event); | 41 | return client->moveResizeGrabWindow() == window && client->windowEvent(event); | ||
42 | }; | 42 | }; | ||
43 | 43 | | |||
44 | const uint8_t eventType = event->response_type & ~0x80; | 44 | const uint8_t eventType = event->response_type & ~0x80; | ||
Show All 18 Lines |