KWin
Loading...
Searching...
No Matches
globalshortcuts_test.cpp
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#include "kwin_wayland_test.h"
10
11#include "input.h"
12#include "internalwindow.h"
13#include "keyboard_input.h"
14#include "pointer_input.h"
15#include "useractions.h"
16#include "wayland/keyboard.h"
17#include "wayland/seat.h"
18#include "wayland_server.h"
19#include "workspace.h"
20#include "x11window.h"
21#include "xkb.h"
22
23#include <KWayland/Client/surface.h>
24
25#include <KGlobalAccel>
26
27#include <QAction>
28
29#include <linux/input.h>
30#include <netwm.h>
31#include <xcb/xcb_icccm.h>
32
33using namespace KWin;
34
35static const QString s_socketName = QStringLiteral("wayland_test_kwin_globalshortcuts-0");
36
37class GlobalShortcutsTest : public QObject
38{
39 Q_OBJECT
40private Q_SLOTS:
41 void initTestCase();
42 void init();
43 void cleanup();
44
45 void testNonLatinLayout_data();
46 void testNonLatinLayout();
47 void testConsumedShift();
48 void testRepeatedTrigger();
49 void testUserActionsMenu();
50 void testMetaShiftW();
51 void testComponseKey();
52 void testKeypad();
53 void testX11WindowShortcut();
54 void testWaylandWindowShortcut();
55 void testSetupWindowShortcut();
56};
57
58void GlobalShortcutsTest::initTestCase()
59{
60 qRegisterMetaType<KWin::Window *>();
61 qRegisterMetaType<KWin::InternalWindow *>();
62 QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
63 QVERIFY(waylandServer()->init(s_socketName));
65 QRect(0, 0, 1280, 1024),
66 QRect(1280, 0, 1280, 1024),
67 });
68
69 kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig));
70 qputenv("KWIN_XKB_DEFAULT_KEYMAP", "1");
71 qputenv("XKB_DEFAULT_RULES", "evdev");
72 qputenv("XKB_DEFAULT_LAYOUT", "us,ru");
73
74 kwinApp()->start();
75 QVERIFY(applicationStartedSpy.wait());
76}
77
78void GlobalShortcutsTest::init()
79{
81 workspace()->setActiveOutput(QPoint(640, 512));
82 KWin::input()->pointer()->warp(QPoint(640, 512));
83
84 auto xkb = input()->keyboard()->xkb();
85 xkb->switchToLayout(0);
86}
87
88void GlobalShortcutsTest::cleanup()
89{
91}
92
93Q_DECLARE_METATYPE(Qt::Modifier)
94
95void GlobalShortcutsTest::testNonLatinLayout_data()
96{
97 QTest::addColumn<int>("modifierKey");
98 QTest::addColumn<Qt::Modifier>("qtModifier");
99 QTest::addColumn<int>("key");
100 QTest::addColumn<Qt::Key>("qtKey");
101
102 // KEY_W is "ц" in the RU layout and "w" in the US layout
103 // KEY_GRAVE is "ё" in the RU layout and "`" in the US layout
104 // TAB_KEY is the same both in the US and RU layout
105
106 QTest::newRow("Left Ctrl + Tab") << KEY_LEFTCTRL << Qt::CTRL << KEY_TAB << Qt::Key_Tab;
107 QTest::newRow("Left Ctrl + W") << KEY_LEFTCTRL << Qt::CTRL << KEY_W << Qt::Key_W;
108 QTest::newRow("Left Ctrl + `") << KEY_LEFTCTRL << Qt::CTRL << KEY_GRAVE << Qt::Key_QuoteLeft;
109
110 QTest::newRow("Left Alt + Tab") << KEY_LEFTALT << Qt::ALT << KEY_TAB << Qt::Key_Tab;
111 QTest::newRow("Left Alt + W") << KEY_LEFTALT << Qt::ALT << KEY_W << Qt::Key_W;
112 QTest::newRow("Left Alt + `") << KEY_LEFTALT << Qt::ALT << KEY_GRAVE << Qt::Key_QuoteLeft;
113
114 QTest::newRow("Left Shift + Tab") << KEY_LEFTSHIFT << Qt::SHIFT << KEY_TAB << Qt::Key_Tab;
115
116 QTest::newRow("Left Meta + Tab") << KEY_LEFTMETA << Qt::META << KEY_TAB << Qt::Key_Tab;
117 QTest::newRow("Left Meta + W") << KEY_LEFTMETA << Qt::META << KEY_W << Qt::Key_W;
118 QTest::newRow("Left Meta + `") << KEY_LEFTMETA << Qt::META << KEY_GRAVE << Qt::Key_QuoteLeft;
119}
120
121void GlobalShortcutsTest::testNonLatinLayout()
122{
123 // Shortcuts on non-Latin layouts should still work, see BUG 375518
124 auto xkb = input()->keyboard()->xkb();
125 xkb->switchToLayout(1);
126 QCOMPARE(xkb->layoutName(), QStringLiteral("Russian"));
127
128 QFETCH(int, modifierKey);
129 QFETCH(Qt::Modifier, qtModifier);
130 QFETCH(int, key);
131 QFETCH(Qt::Key, qtKey);
132
133 const QKeySequence seq(qtModifier + qtKey);
134
135 std::unique_ptr<QAction> action(new QAction(nullptr));
136 action->setProperty("componentName", QStringLiteral("kwin"));
137 action->setObjectName("globalshortcuts-test-non-latin-layout");
138
139 QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
140
141 KGlobalAccel::self()->stealShortcutSystemwide(seq);
142 KGlobalAccel::self()->setShortcut(action.get(), {seq}, KGlobalAccel::NoAutoloading);
143
144 quint32 timestamp = 0;
145 Test::keyboardKeyPressed(modifierKey, timestamp++);
146 QCOMPARE(input()->keyboardModifiers(), qtModifier);
147 Test::keyboardKeyPressed(key, timestamp++);
148
149 Test::keyboardKeyReleased(key, timestamp++);
150 Test::keyboardKeyReleased(modifierKey, timestamp++);
151
152 QTRY_COMPARE_WITH_TIMEOUT(triggeredSpy.count(), 1, 100);
153}
154
155void GlobalShortcutsTest::testConsumedShift()
156{
157 // this test verifies that a shortcut with a consumed shift modifier triggers
158 // create the action
159 std::unique_ptr<QAction> action(new QAction(nullptr));
160 action->setProperty("componentName", QStringLiteral("kwin"));
161 action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift"));
162 QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
163 KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading);
164
165 // press shift+5
166 quint32 timestamp = 0;
167 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
168 QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier);
169 Test::keyboardKeyPressed(KEY_5, timestamp++);
170 QTRY_COMPARE(triggeredSpy.count(), 1);
171 Test::keyboardKeyReleased(KEY_5, timestamp++);
172
173 // release shift
174 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
175}
176
177void GlobalShortcutsTest::testRepeatedTrigger()
178{
179 // this test verifies that holding a key, triggers repeated global shortcut
180 // in addition pressing another key should stop triggering the shortcut
181
182 std::unique_ptr<QAction> action(new QAction(nullptr));
183 action->setProperty("componentName", QStringLiteral("kwin"));
184 action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift"));
185 QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
186 KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading);
187
188 // we need to configure the key repeat first. It is only enabled on libinput
189 waylandServer()->seat()->keyboard()->setRepeatInfo(25, 300);
190
191 // press shift+5
192 quint32 timestamp = 0;
193 Test::keyboardKeyPressed(KEY_WAKEUP, timestamp++);
194 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
195 QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier);
196 Test::keyboardKeyPressed(KEY_5, timestamp++);
197 QTRY_COMPARE(triggeredSpy.count(), 1);
198 // and should repeat
199 QVERIFY(triggeredSpy.wait());
200 QVERIFY(triggeredSpy.wait());
201 // now release the key
202 Test::keyboardKeyReleased(KEY_5, timestamp++);
203 QVERIFY(!triggeredSpy.wait(50));
204
205 Test::keyboardKeyReleased(KEY_WAKEUP, timestamp++);
206 QVERIFY(!triggeredSpy.wait(50));
207
208 // release shift
209 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
210}
211
212void GlobalShortcutsTest::testUserActionsMenu()
213{
214 // this test tries to trigger the user actions menu with Alt+F3
215 // the problem here is that pressing F3 consumes modifiers as it's part of the
216 // Ctrl+alt+F3 keysym for vt switching. xkbcommon considers all modifiers as consumed
217 // which a transformation to any keysym would cause
218 // for more information see:
219 // https://bugs.freedesktop.org/show_bug.cgi?id=92818
220 // https://github.com/xkbcommon/libxkbcommon/issues/17
221
222 // first create a window
223 std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
224 std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
225 auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
226 QVERIFY(window);
227 QVERIFY(window->isActive());
228
229 quint32 timestamp = 0;
230 QVERIFY(!workspace()->userActionsMenu()->isShown());
231 Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
232 Test::keyboardKeyPressed(KEY_F3, timestamp++);
233 Test::keyboardKeyReleased(KEY_F3, timestamp++);
234 QTRY_VERIFY(workspace()->userActionsMenu()->isShown());
235 Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
236}
237
238void GlobalShortcutsTest::testMetaShiftW()
239{
240 // BUG 370341
241 std::unique_ptr<QAction> action(new QAction(nullptr));
242 action->setProperty("componentName", QStringLiteral("kwin"));
243 action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w"));
244 QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
245 KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::META | Qt::SHIFT | Qt::Key_W}, KGlobalAccel::NoAutoloading);
246
247 // press meta+shift+w
248 quint32 timestamp = 0;
249 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
250 QCOMPARE(input()->keyboardModifiers(), Qt::MetaModifier);
251 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
252 QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier | Qt::MetaModifier);
253 Test::keyboardKeyPressed(KEY_W, timestamp++);
254 QTRY_COMPARE(triggeredSpy.count(), 1);
255 Test::keyboardKeyReleased(KEY_W, timestamp++);
256
257 // release meta+shift
258 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
259 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
260}
261
262void GlobalShortcutsTest::testComponseKey()
263{
264 // BUG 390110
265 std::unique_ptr<QAction> action(new QAction(nullptr));
266 action->setProperty("componentName", QStringLiteral("kwin"));
267 action->setObjectName(QStringLiteral("globalshortcuts-accent"));
268 QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
269 KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::NoModifier}, KGlobalAccel::NoAutoloading);
270
271 // press & release `
272 quint32 timestamp = 0;
273 Test::keyboardKeyPressed(KEY_RESERVED, timestamp++);
274 Test::keyboardKeyReleased(KEY_RESERVED, timestamp++);
275
276 QTRY_COMPARE(triggeredSpy.count(), 0);
277}
278
279void GlobalShortcutsTest::testKeypad()
280{
281 auto zeroAction = std::make_unique<QAction>();
282 zeroAction->setProperty("componentName", QStringLiteral("kwin"));
283 zeroAction->setObjectName(QStringLiteral("globalshortcuts-test-keypad-0"));
284 QSignalSpy zeroActionTriggeredSpy(zeroAction.get(), &QAction::triggered);
285 KGlobalAccel::self()->setShortcut(zeroAction.get(), QList<QKeySequence>{Qt::MetaModifier | Qt::KeypadModifier | Qt::Key_0}, KGlobalAccel::NoAutoloading);
286
287 auto insertAction = std::make_unique<QAction>();
288 insertAction->setProperty("componentName", QStringLiteral("kwin"));
289 insertAction->setObjectName(QStringLiteral("globalshortcuts-test-keypad-ins"));
290 QSignalSpy insertActionTriggeredSpy(insertAction.get(), &QAction::triggered);
291 KGlobalAccel::self()->setShortcut(insertAction.get(), QList<QKeySequence>{Qt::MetaModifier | Qt::KeypadModifier | Qt::Key_Insert}, KGlobalAccel::NoAutoloading);
292
293 // Turn on numlock
294 quint32 timestamp = 0;
295 Test::keyboardKeyPressed(KEY_NUMLOCK, timestamp++);
296 Test::keyboardKeyReleased(KEY_NUMLOCK, timestamp++);
297
298 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
299 Test::keyboardKeyPressed(KEY_KP0, timestamp++);
300 Test::keyboardKeyReleased(KEY_KP0, timestamp++);
301 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
302 QTRY_COMPARE(zeroActionTriggeredSpy.count(), 1);
303 QCOMPARE(insertActionTriggeredSpy.count(), 0);
304
305 // Turn off numlock
306 Test::keyboardKeyPressed(KEY_NUMLOCK, timestamp++);
307 Test::keyboardKeyReleased(KEY_NUMLOCK, timestamp++);
308
309 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
310 Test::keyboardKeyPressed(KEY_KP0, timestamp++);
311 Test::keyboardKeyReleased(KEY_KP0, timestamp++);
312 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
313 QTRY_COMPARE(insertActionTriggeredSpy.count(), 1);
314 QCOMPARE(zeroActionTriggeredSpy.count(), 1);
315}
316
317void GlobalShortcutsTest::testX11WindowShortcut()
318{
319 // create an X11 window
321 QVERIFY(!xcb_connection_has_error(c.get()));
322 xcb_window_t windowId = xcb_generate_id(c.get());
323 const QRect windowGeometry = QRect(0, 0, 10, 20);
324 const uint32_t values[] = {
325 XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW};
326 xcb_create_window(c.get(), XCB_COPY_FROM_PARENT, windowId, rootWindow(),
327 windowGeometry.x(),
328 windowGeometry.y(),
329 windowGeometry.width(),
330 windowGeometry.height(),
331 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, XCB_CW_EVENT_MASK, values);
332 xcb_size_hints_t hints;
333 memset(&hints, 0, sizeof(hints));
334 xcb_icccm_size_hints_set_position(&hints, 1, windowGeometry.x(), windowGeometry.y());
335 xcb_icccm_size_hints_set_size(&hints, 1, windowGeometry.width(), windowGeometry.height());
336 xcb_icccm_set_wm_normal_hints(c.get(), windowId, &hints);
337 NETWinInfo info(c.get(), windowId, rootWindow(), NET::WMAllProperties, NET::WM2AllProperties);
338 info.setWindowType(NET::Normal);
339 xcb_map_window(c.get(), windowId);
340 xcb_flush(c.get());
341
342 QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
343 QVERIFY(windowCreatedSpy.wait());
344 X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
345 QVERIFY(window);
346
347 QCOMPARE(workspace()->activeWindow(), window);
348 QVERIFY(window->isActive());
349 QCOMPARE(window->shortcut(), QKeySequence());
350 const QKeySequence seq(Qt::META | Qt::SHIFT | Qt::Key_Y);
351 QVERIFY(workspace()->shortcutAvailable(seq));
352 window->setShortcut(seq.toString());
353 QCOMPARE(window->shortcut(), seq);
354 QVERIFY(!workspace()->shortcutAvailable(seq));
355 QCOMPARE(window->caption(), QStringLiteral(" {Meta+Shift+Y}"));
356
357 // it's delayed
358 QCoreApplication::processEvents();
359
360 workspace()->activateWindow(nullptr);
361 QVERIFY(!workspace()->activeWindow());
362 QVERIFY(!window->isActive());
363
364 // now let's trigger the shortcut
365 quint32 timestamp = 0;
366 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
367 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
368 Test::keyboardKeyPressed(KEY_Y, timestamp++);
369 QTRY_COMPARE(workspace()->activeWindow(), window);
370 Test::keyboardKeyReleased(KEY_Y, timestamp++);
371 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
372 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
373
374 // destroy window again
375 QSignalSpy windowClosedSpy(window, &X11Window::closed);
376 xcb_unmap_window(c.get(), windowId);
377 xcb_destroy_window(c.get(), windowId);
378 xcb_flush(c.get());
379 QVERIFY(windowClosedSpy.wait());
380}
381
382void GlobalShortcutsTest::testWaylandWindowShortcut()
383{
384 std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
385 std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
386 auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
387
388 QCOMPARE(workspace()->activeWindow(), window);
389 QVERIFY(window->isActive());
390 QCOMPARE(window->shortcut(), QKeySequence());
391 const QKeySequence seq(Qt::META | Qt::SHIFT | Qt::Key_Y);
392 QVERIFY(workspace()->shortcutAvailable(seq));
393 window->setShortcut(seq.toString());
394 QCOMPARE(window->shortcut(), seq);
395 QVERIFY(!workspace()->shortcutAvailable(seq));
396 QCOMPARE(window->caption(), QStringLiteral(" {Meta+Shift+Y}"));
397
398 workspace()->activateWindow(nullptr);
399 QVERIFY(!workspace()->activeWindow());
400 QVERIFY(!window->isActive());
401
402 // now let's trigger the shortcut
403 quint32 timestamp = 0;
404 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
405 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
406 Test::keyboardKeyPressed(KEY_Y, timestamp++);
407 QTRY_COMPARE(workspace()->activeWindow(), window);
408 Test::keyboardKeyReleased(KEY_Y, timestamp++);
409 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
410 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
411
412 shellSurface.reset();
413 surface.reset();
414 QVERIFY(Test::waitForWindowClosed(window));
415 QTRY_VERIFY_WITH_TIMEOUT(workspace()->shortcutAvailable(seq), 500); // we need the try since KGlobalAccelPrivate::unregister is async
416}
417
418void GlobalShortcutsTest::testSetupWindowShortcut()
419{
420 // QTBUG-62102
421
422 std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
423 std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
424 auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
425
426 QCOMPARE(workspace()->activeWindow(), window);
427 QVERIFY(window->isActive());
428 QCOMPARE(window->shortcut(), QKeySequence());
429
430 QSignalSpy shortcutDialogAddedSpy(workspace(), &Workspace::windowAdded);
432 QTRY_COMPARE(shortcutDialogAddedSpy.count(), 1);
433 auto dialog = shortcutDialogAddedSpy.first().first().value<InternalWindow *>();
434 QVERIFY(dialog);
435 QVERIFY(dialog->isInternal());
436 auto sequenceEdit = workspace()->shortcutDialog()->findChild<QKeySequenceEdit *>();
437 QVERIFY(sequenceEdit);
438 QTRY_VERIFY(sequenceEdit->hasFocus());
439
440 quint32 timestamp = 0;
441 Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
442 Test::keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++);
443 Test::keyboardKeyPressed(KEY_Y, timestamp++);
444 Test::keyboardKeyReleased(KEY_Y, timestamp++);
445 Test::keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
446 Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
447
448 // the sequence gets accepted after one second, so wait a bit longer
449 QTest::qWait(2000);
450 // now send in enter
451 Test::keyboardKeyPressed(KEY_ENTER, timestamp++);
452 Test::keyboardKeyReleased(KEY_ENTER, timestamp++);
453 QTRY_COMPARE(window->shortcut(), QKeySequence(Qt::META | Qt::SHIFT | Qt::Key_Y));
454}
455
457#include "globalshortcuts_test.moc"
KeyboardInputRedirection * keyboard() const
Definition input.h:216
PointerInputRedirection * pointer() const
Definition input.h:220
void setRepeatInfo(qint32 charactersPerSecond, qint32 delay)
Definition keyboard.cpp:240
void warp(const QPointF &pos)
KeyboardInterface * keyboard() const
Definition seat.cpp:963
SeatInterface * seat() const
bool isActive() const
Definition window.h:882
QString caption
Definition window.h:392
const QKeySequence & shortcut() const
Definition window.h:979
void setShortcut(const QString &cut)
void activateWindow(Window *window, bool force=false)
void windowAdded(KWin::Window *)
ShortcutDialog * shortcutDialog() const
Definition workspace.h:404
void setActiveOutput(Output *output)
void slotSetupWindowShortcut()
bool switchToLayout(xkb_layout_index_t layout)
Definition xkb.cpp:629
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)
#define WAYLANDTEST_MAIN(TestObject)
Window * renderAndWaitForShown(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format=QImage::Format_ARGB32, int timeout=5000)
void keyboardKeyReleased(quint32 key, quint32 time)
void destroyWaylandConnection()
void setOutputConfig(const QList< QRect > &geometries)
void keyboardKeyPressed(quint32 key, quint32 time)
bool setupWaylandConnection(AdditionalWaylandInterfaces flags=AdditionalWaylandInterfaces())
XcbConnectionPtr createX11Connection()
std::unique_ptr< KWayland::Client::Surface > createSurface()
XdgToplevel * createXdgToplevelSurface(KWayland::Client::Surface *surface, QObject *parent=nullptr)
std::unique_ptr< xcb_connection_t, XcbConnectionDeleter > XcbConnectionPtr
bool waitForWindowClosed(Window *window)
KWIN_EXPORT xcb_window_t rootWindow()
Definition xcb.h:24
WaylandServer * waylandServer()
Workspace * workspace()
Definition workspace.h:830
InputRedirection * input()
Definition input.h:549