18#include "virtualdesktops.h"
23#include <KWayland/Client/surface.h>
25#include <linux/input.h>
29static const QString s_socketName = QStringLiteral(
"wayland_test_kwin_xdgshellwindow_rules-0");
37 ClientShouldBeInactive = 1 << 0,
39 ReturnAfterSurfaceConfiguration = 1 << 2,
41 Q_DECLARE_FLAGS(ClientFlags, ClientFlag)
48 void testPositionDontAffect();
49 void testPositionApply();
50 void testPositionRemember();
51 void testPositionForce();
52 void testPositionApplyNow();
53 void testPositionForceTemporarily();
55 void testSizeDontAffect();
57 void testSizeRemember();
59 void testSizeApplyNow();
60 void testSizeForceTemporarily();
62 void testMaximizeDontAffect();
63 void testMaximizeApply();
64 void testMaximizeRemember();
65 void testMaximizeForce();
66 void testMaximizeApplyNow();
67 void testMaximizeForceTemporarily();
69 void testDesktopsDontAffect();
70 void testDesktopsApply();
71 void testDesktopsRemember();
72 void testDesktopsForce();
73 void testDesktopsApplyNow();
74 void testDesktopsForceTemporarily();
76 void testMinimizeDontAffect();
77 void testMinimizeApply();
78 void testMinimizeRemember();
79 void testMinimizeForce();
80 void testMinimizeApplyNow();
81 void testMinimizeForceTemporarily();
83 void testSkipTaskbarDontAffect();
84 void testSkipTaskbarApply();
85 void testSkipTaskbarRemember();
86 void testSkipTaskbarForce();
87 void testSkipTaskbarApplyNow();
88 void testSkipTaskbarForceTemporarily();
90 void testSkipPagerDontAffect();
91 void testSkipPagerApply();
92 void testSkipPagerRemember();
93 void testSkipPagerForce();
94 void testSkipPagerApplyNow();
95 void testSkipPagerForceTemporarily();
97 void testSkipSwitcherDontAffect();
98 void testSkipSwitcherApply();
99 void testSkipSwitcherRemember();
100 void testSkipSwitcherForce();
101 void testSkipSwitcherApplyNow();
102 void testSkipSwitcherForceTemporarily();
104 void testKeepAboveDontAffect();
105 void testKeepAboveApply();
106 void testKeepAboveRemember();
107 void testKeepAboveForce();
108 void testKeepAboveApplyNow();
109 void testKeepAboveForceTemporarily();
111 void testKeepBelowDontAffect();
112 void testKeepBelowApply();
113 void testKeepBelowRemember();
114 void testKeepBelowForce();
115 void testKeepBelowApplyNow();
116 void testKeepBelowForceTemporarily();
118 void testShortcutDontAffect();
119 void testShortcutApply();
120 void testShortcutRemember();
121 void testShortcutForce();
122 void testShortcutApplyNow();
123 void testShortcutForceTemporarily();
125 void testDesktopFileDontAffect();
126 void testDesktopFileApply();
127 void testDesktopFileRemember();
128 void testDesktopFileForce();
129 void testDesktopFileApplyNow();
130 void testDesktopFileForceTemporarily();
132 void testActiveOpacityDontAffect();
133 void testActiveOpacityForce();
134 void testActiveOpacityForceTemporarily();
136 void testInactiveOpacityDontAffect();
137 void testInactiveOpacityForce();
138 void testInactiveOpacityForceTemporarily();
140 void testNoBorderDontAffect();
141 void testNoBorderApply();
142 void testNoBorderRemember();
143 void testNoBorderForce();
144 void testNoBorderApplyNow();
145 void testNoBorderForceTemporarily();
147 void testScreenDontAffect();
148 void testScreenApply();
149 void testScreenRemember();
150 void testScreenForce();
151 void testScreenApplyNow();
152 void testScreenForceTemporarily();
154 void testLayerDontAffect();
155 void testLayerForce();
156 void testLayerForceTemporarily();
158 void testCloseableDontAffect();
159 void testCloseableForce();
160 void testCloseableForceTemporarily();
162 void testMatchAfterNameChange();
165 void createTestWindow(ClientFlags flags = None);
166 void mapClientToSurface(QSize clientSize, ClientFlags flags = None);
167 void destroyTestWindow();
170 void setWindowRule(
const QString &property,
const T &value,
int policy);
173 KSharedConfig::Ptr m_config;
176 std::unique_ptr<KWayland::Client::Surface> m_surface;
177 std::unique_ptr<Test::XdgToplevel> m_shellSurface;
179 std::unique_ptr<QSignalSpy> m_toplevelConfigureRequestedSpy;
180 std::unique_ptr<QSignalSpy> m_surfaceConfigureRequestedSpy;
183void TestXdgShellWindowRules::initTestCase()
185 qRegisterMetaType<KWin::Window *>();
190 QRect(0, 0, 1280, 1024),
191 QRect(1280, 0, 1280, 1024),
195 QVERIFY(applicationStartedSpy.wait());
198 QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024));
199 QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024));
201 m_config = KSharedConfig::openConfig(QStringLiteral(
"kwinrulesrc"), KConfig::SimpleConfig);
205void TestXdgShellWindowRules::init()
207 VirtualDesktopManager::self()->setCurrent(VirtualDesktopManager::self()->desktops().first());
213void TestXdgShellWindowRules::cleanup()
215 if (m_shellSurface) {
222 for (
const QString &group : m_config->groupList()) {
223 m_config->deleteGroup(group);
228 VirtualDesktopManager::self()->setCount(1);
229 QCOMPARE(VirtualDesktopManager::self()->count(), 1u);
232void TestXdgShellWindowRules::createTestWindow(ClientFlags flags)
235 const bool createClient = !(flags & ReturnAfterSurfaceConfiguration);
236 const auto decorationMode = (flags &
ServerSideDecoration) ? Test::XdgToplevelDecorationV1::mode_server_side
237 : Test::XdgToplevelDecorationV1::mode_client_side;
247 m_shellSurface->set_app_id(QStringLiteral(
"org.kde.foo"));
248 decoration->set_mode(decorationMode);
251 m_surface->commit(KWayland::Client::Surface::CommitFlag::None);
252 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
255 mapClientToSurface(QSize(100, 50), flags);
259void TestXdgShellWindowRules::mapClientToSurface(QSize clientSize, ClientFlags flags)
261 const bool clientShouldBeActive = !(flags & ClientShouldBeInactive);
263 QVERIFY(m_surface !=
nullptr);
264 QVERIFY(m_shellSurface !=
nullptr);
265 QVERIFY(m_surfaceConfigureRequestedSpy !=
nullptr);
268 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
273 QCOMPARE(m_window->
isActive(), clientShouldBeActive);
276void TestXdgShellWindowRules::destroyTestWindow()
278 m_surfaceConfigureRequestedSpy.reset();
279 m_toplevelConfigureRequestedSpy.reset();
280 m_shellSurface.reset();
286void TestXdgShellWindowRules::setWindowRule(
const QString &property,
const T &value,
int policy)
289 m_config->group(QStringLiteral(
"General")).writeEntry(
"count", 1);
290 KConfigGroup group = m_config->group(QStringLiteral(
"1"));
292 group.writeEntry(property, value);
293 group.writeEntry(QStringLiteral(
"%1rule").arg(property), policy);
295 group.writeEntry(
"wmclass",
"org.kde.foo");
296 group.writeEntry(
"wmclasscomplete",
false);
303void TestXdgShellWindowRules::testPositionDontAffect()
313 QCOMPARE(m_window->
pos(), QPoint(0, 0));
318void TestXdgShellWindowRules::testPositionApply()
320 setWindowRule(
"position", QPoint(42, 42),
int(
Rules::Apply));
327 QCOMPARE(m_window->
pos(), QPoint(42, 42));
330 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
331 QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
332 QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
334 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
338 QCOMPARE(
workspace()->moveResizeWindow(), m_window);
339 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
347 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
348 QCOMPARE(m_window->
pos(), QPoint(50, 42));
351 QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
352 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
355 QCOMPARE(m_window->
pos(), QPoint(50, 42));
363 QCOMPARE(m_window->
pos(), QPoint(42, 42));
368void TestXdgShellWindowRules::testPositionRemember()
376 QCOMPARE(m_window->
pos(), QPoint(42, 42));
379 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
380 QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
381 QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
383 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
387 QCOMPARE(
workspace()->moveResizeWindow(), m_window);
388 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
396 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
397 QCOMPARE(m_window->
pos(), QPoint(50, 42));
400 QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
401 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
404 QCOMPARE(m_window->
pos(), QPoint(50, 42));
412 QCOMPARE(m_window->
pos(), QPoint(50, 42));
417void TestXdgShellWindowRules::testPositionForce()
419 setWindowRule(
"position", QPoint(42, 42),
int(
Rules::Force));
426 QCOMPARE(m_window->
pos(), QPoint(42, 42));
429 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
430 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
434 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
435 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
445 QCOMPARE(m_window->
pos(), QPoint(42, 42));
450void TestXdgShellWindowRules::testPositionApplyNow()
458 QCOMPARE(m_window->
pos(), QPoint(0, 0));
460 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
465 QCOMPARE(frameGeometryChangedSpy.count(), 1);
466 QCOMPARE(m_window->
pos(), QPoint(42, 42));
471 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
472 QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
473 QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
475 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
479 QCOMPARE(
workspace()->moveResizeWindow(), m_window);
480 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
488 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
489 QCOMPARE(m_window->
pos(), QPoint(50, 42));
492 QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
493 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
496 QCOMPARE(m_window->
pos(), QPoint(50, 42));
500 QCOMPARE(m_window->
pos(), QPoint(50, 42));
505void TestXdgShellWindowRules::testPositionForceTemporarily()
514 QCOMPARE(m_window->
pos(), QPoint(42, 42));
517 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
518 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
522 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
523 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
533 QCOMPARE(m_window->
pos(), QPoint(0, 0));
538void TestXdgShellWindowRules::testSizeDontAffect()
542 createTestWindow(ReturnAfterSurfaceConfiguration);
545 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
546 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
547 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
550 mapClientToSurface(QSize(100, 50));
552 QCOMPARE(m_window->
size(), QSize(100, 50));
555 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
556 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
557 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
562void TestXdgShellWindowRules::testSizeApply()
564 setWindowRule(
"size", QSize(480, 640),
int(
Rules::Apply));
566 createTestWindow(ReturnAfterSurfaceConfiguration);
569 Test::XdgToplevel::States states;
570 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
571 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
572 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(480, 640));
573 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
574 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
575 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
578 mapClientToSurface(QSize(480, 640));
580 QCOMPARE(m_window->
size(), QSize(480, 640));
583 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
584 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
585 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
586 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
587 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
588 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
591 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
592 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
593 QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
594 QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
596 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
600 QCOMPARE(
workspace()->moveResizeWindow(), m_window);
601 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
604 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
605 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
606 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
607 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
608 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
609 QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
610 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
616 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
617 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
618 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
619 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
620 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
621 QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
622 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(488, 640));
623 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
624 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
625 Test::render(m_surface.get(), QSize(488, 640), Qt::blue);
626 QVERIFY(frameGeometryChangedSpy.wait());
627 QCOMPARE(m_window->
size(), QSize(488, 640));
628 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
631 QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
632 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
636 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
637 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 5);
638 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 5);
642 createTestWindow(ReturnAfterSurfaceConfiguration);
644 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
645 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
646 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
648 mapClientToSurface(QSize(480, 640));
650 QCOMPARE(m_window->
size(), QSize(480, 640));
652 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
653 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
654 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
659void TestXdgShellWindowRules::testSizeRemember()
663 createTestWindow(ReturnAfterSurfaceConfiguration);
666 Test::XdgToplevel::States states;
667 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
668 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
669 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
670 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
671 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
672 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
675 mapClientToSurface(QSize(480, 640));
677 QCOMPARE(m_window->
size(), QSize(480, 640));
680 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
681 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
682 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
683 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
684 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
685 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
688 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
689 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
690 QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
691 QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
693 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
697 QCOMPARE(
workspace()->moveResizeWindow(), m_window);
698 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
701 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
702 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
703 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
704 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
705 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
706 QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
707 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
713 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
714 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
715 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
716 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
717 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
718 QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
719 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(488, 640));
720 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
721 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
722 Test::render(m_surface.get(), QSize(488, 640), Qt::blue);
723 QVERIFY(frameGeometryChangedSpy.wait());
724 QCOMPARE(m_window->
size(), QSize(488, 640));
725 QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
728 QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
729 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
733 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
734 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 5);
735 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 5);
739 createTestWindow(ReturnAfterSurfaceConfiguration);
741 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
742 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
743 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(488, 640));
745 mapClientToSurface(QSize(488, 640));
747 QCOMPARE(m_window->
size(), QSize(488, 640));
749 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
750 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
751 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
756void TestXdgShellWindowRules::testSizeForce()
758 setWindowRule(
"size", QSize(480, 640),
int(
Rules::Force));
760 createTestWindow(ReturnAfterSurfaceConfiguration);
763 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
764 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
765 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
768 mapClientToSurface(QSize(480, 640));
770 QCOMPARE(m_window->
size(), QSize(480, 640));
773 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
774 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
775 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
778 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
779 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
783 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
784 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
787 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
791 createTestWindow(ReturnAfterSurfaceConfiguration);
793 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
794 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
795 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
797 mapClientToSurface(QSize(480, 640));
799 QCOMPARE(m_window->
size(), QSize(480, 640));
801 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
802 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
803 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
808void TestXdgShellWindowRules::testSizeApplyNow()
810 createTestWindow(ReturnAfterSurfaceConfiguration);
813 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
814 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
815 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
818 mapClientToSurface(QSize(100, 50));
820 QCOMPARE(m_window->
size(), QSize(100, 50));
823 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
824 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
825 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
830 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
831 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
832 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
833 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
836 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
837 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
838 Test::render(m_surface.get(), QSize(480, 640), Qt::blue);
839 QVERIFY(frameGeometryChangedSpy.wait());
840 QCOMPARE(m_window->
size(), QSize(480, 640));
841 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
845 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
850void TestXdgShellWindowRules::testSizeForceTemporarily()
854 createTestWindow(ReturnAfterSurfaceConfiguration);
857 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
858 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
859 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
862 mapClientToSurface(QSize(480, 640));
864 QCOMPARE(m_window->
size(), QSize(480, 640));
867 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
868 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
869 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
872 QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
873 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
877 QCOMPARE(
workspace()->moveResizeWindow(),
nullptr);
878 QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
881 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
885 createTestWindow(ReturnAfterSurfaceConfiguration);
887 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
888 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
889 QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
891 mapClientToSurface(QSize(100, 50));
893 QCOMPARE(m_window->
size(), QSize(100, 50));
895 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
896 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
897 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
902void TestXdgShellWindowRules::testMaximizeDontAffect()
907 createTestWindow(ReturnAfterSurfaceConfiguration);
910 Test::XdgToplevel::States states;
911 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
912 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
913 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
914 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
915 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
916 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
919 mapClientToSurface(QSize(100, 50));
922 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
924 QCOMPARE(m_window->
size(), QSize(100, 50));
927 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
928 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
929 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
930 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
931 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
932 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
937void TestXdgShellWindowRules::testMaximizeApply()
939 setWindowRule(
"maximizehoriz",
true,
int(
Rules::Apply));
942 createTestWindow(ReturnAfterSurfaceConfiguration);
945 Test::XdgToplevel::States states;
946 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
947 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
948 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
949 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
950 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
951 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
954 mapClientToSurface(QSize(1280, 1024));
957 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
959 QCOMPARE(m_window->
size(), QSize(1280, 1024));
962 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
963 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
964 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
965 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
966 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
967 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
971 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
972 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
973 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
974 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
975 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
976 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
977 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
979 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
980 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
981 Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
982 QVERIFY(frameGeometryChangedSpy.wait());
983 QCOMPARE(m_window->
size(), QSize(100, 50));
984 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
989 createTestWindow(ReturnAfterSurfaceConfiguration);
991 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
992 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
993 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
994 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
995 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
996 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
998 mapClientToSurface(QSize(1280, 1024));
1000 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1002 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1004 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1005 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1006 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1007 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1008 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1009 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1011 destroyTestWindow();
1014void TestXdgShellWindowRules::testMaximizeRemember()
1019 createTestWindow(ReturnAfterSurfaceConfiguration);
1022 Test::XdgToplevel::States states;
1023 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1024 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1025 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
1026 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1027 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1028 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1031 mapClientToSurface(QSize(1280, 1024));
1034 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1036 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1039 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1040 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1041 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1042 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1043 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1044 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1048 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1049 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
1050 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
1051 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
1052 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1053 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1054 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1056 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
1057 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
1058 Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
1059 QVERIFY(frameGeometryChangedSpy.wait());
1060 QCOMPARE(m_window->
size(), QSize(100, 50));
1061 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1065 destroyTestWindow();
1066 createTestWindow(ReturnAfterSurfaceConfiguration);
1068 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1069 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1070 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
1071 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1072 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1073 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1075 mapClientToSurface(QSize(100, 50));
1078 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1080 QCOMPARE(m_window->
size(), QSize(100, 50));
1082 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1083 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1084 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1085 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1086 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1087 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1089 destroyTestWindow();
1092void TestXdgShellWindowRules::testMaximizeForce()
1094 setWindowRule(
"maximizehoriz",
true,
int(
Rules::Force));
1095 setWindowRule(
"maximizevert",
true,
int(
Rules::Force));
1097 createTestWindow(ReturnAfterSurfaceConfiguration);
1100 Test::XdgToplevel::States states;
1101 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1102 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1103 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
1104 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1105 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1106 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1109 mapClientToSurface(QSize(1280, 1024));
1112 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1114 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1117 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1118 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1119 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1120 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1121 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1122 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1127 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
1128 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1133 destroyTestWindow();
1134 createTestWindow(ReturnAfterSurfaceConfiguration);
1136 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1137 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1138 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
1139 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1140 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1141 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1143 mapClientToSurface(QSize(1280, 1024));
1146 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1148 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1150 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1151 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1152 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1153 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1154 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1155 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1157 destroyTestWindow();
1160void TestXdgShellWindowRules::testMaximizeApplyNow()
1162 createTestWindow(ReturnAfterSurfaceConfiguration);
1165 Test::XdgToplevel::States states;
1166 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1167 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1168 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
1169 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1170 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1171 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1174 mapClientToSurface(QSize(100, 50));
1177 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1179 QCOMPARE(m_window->
size(), QSize(100, 50));
1182 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1183 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1184 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1185 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1186 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1187 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1193 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1194 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
1195 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
1196 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
1197 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1198 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1199 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1202 QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
1203 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
1204 Test::render(m_surface.get(), QSize(1280, 1024), Qt::blue);
1205 QVERIFY(frameGeometryChangedSpy.wait());
1206 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1207 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1215 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1216 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
1217 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
1218 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(100, 50));
1219 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1220 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1221 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1223 m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
1224 Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
1225 QVERIFY(frameGeometryChangedSpy.wait());
1226 QCOMPARE(m_window->
size(), QSize(100, 50));
1227 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1233 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
1234 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1238 destroyTestWindow();
1241void TestXdgShellWindowRules::testMaximizeForceTemporarily()
1246 createTestWindow(ReturnAfterSurfaceConfiguration);
1249 Test::XdgToplevel::States states;
1250 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1251 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1252 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
1253 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1254 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1255 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1258 mapClientToSurface(QSize(1280, 1024));
1261 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1263 QCOMPARE(m_window->
size(), QSize(1280, 1024));
1266 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1267 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1268 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1269 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1270 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1271 QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
1276 QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
1277 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeFull);
1282 destroyTestWindow();
1283 createTestWindow(ReturnAfterSurfaceConfiguration);
1285 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
1286 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
1287 QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
1288 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1289 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
1290 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1292 mapClientToSurface(QSize(100, 50));
1295 QCOMPARE(m_window->
maximizeMode(), MaximizeMode::MaximizeRestore);
1297 QCOMPARE(m_window->
size(), QSize(100, 50));
1299 QVERIFY(m_surfaceConfigureRequestedSpy->wait());
1300 QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
1301 QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
1302 states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
1303 QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
1304 QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
1306 destroyTestWindow();
1309void TestXdgShellWindowRules::testDesktopsDontAffect()
1312 VirtualDesktopManager::self()->setCount(2);
1313 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1314 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1315 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1317 VirtualDesktopManager::self()->setCurrent(vd1);
1318 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1325 QCOMPARE(m_window->
desktops(), {vd1});
1326 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1328 destroyTestWindow();
1331void TestXdgShellWindowRules::testDesktopsApply()
1334 VirtualDesktopManager::self()->setCount(2);
1335 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1336 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1337 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1339 VirtualDesktopManager::self()->setCurrent(vd1);
1340 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1342 setWindowRule(
"desktops", QStringList{vd2->
id()}, int(
Rules::Apply));
1347 QCOMPARE(m_window->
desktops(), {vd2});
1348 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1352 QCOMPARE(m_window->
desktops(), {vd1});
1353 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1356 destroyTestWindow();
1357 VirtualDesktopManager::self()->setCurrent(vd1);
1358 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1361 QCOMPARE(m_window->
desktops(), {vd2});
1362 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1364 destroyTestWindow();
1367void TestXdgShellWindowRules::testDesktopsRemember()
1370 VirtualDesktopManager::self()->setCount(2);
1371 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1372 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1373 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1375 VirtualDesktopManager::self()->setCurrent(vd1);
1376 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1382 QCOMPARE(m_window->
desktops(), {vd2});
1383 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1387 QCOMPARE(m_window->
desktops(), {vd1});
1388 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1391 destroyTestWindow();
1394 QCOMPARE(m_window->
desktops(), {vd1});
1395 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1397 destroyTestWindow();
1400void TestXdgShellWindowRules::testDesktopsForce()
1403 VirtualDesktopManager::self()->setCount(2);
1404 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1405 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1406 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1408 VirtualDesktopManager::self()->setCurrent(vd1);
1409 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1411 setWindowRule(
"desktops", QStringList{vd2->
id()}, int(
Rules::Force));
1416 QCOMPARE(m_window->
desktops(), {vd2});
1417 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1421 QCOMPARE(m_window->
desktops(), {vd2});
1422 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1425 destroyTestWindow();
1426 VirtualDesktopManager::self()->setCurrent(vd1);
1427 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1430 QCOMPARE(m_window->
desktops(), {vd2});
1431 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1433 destroyTestWindow();
1436void TestXdgShellWindowRules::testDesktopsApplyNow()
1439 VirtualDesktopManager::self()->setCount(2);
1440 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1441 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1442 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1444 VirtualDesktopManager::self()->setCurrent(vd1);
1445 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1449 QCOMPARE(m_window->
desktops(), {vd1});
1450 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1455 QCOMPARE(m_window->
desktops(), {vd2});
1456 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1460 QCOMPARE(m_window->
desktops(), {vd1});
1461 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1465 QCOMPARE(m_window->
desktops(), {vd1});
1466 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1468 destroyTestWindow();
1471void TestXdgShellWindowRules::testDesktopsForceTemporarily()
1474 VirtualDesktopManager::self()->setCount(2);
1475 QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
1476 VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
1477 VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
1479 VirtualDesktopManager::self()->setCurrent(vd1);
1480 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1487 QCOMPARE(m_window->
desktops(), {vd2});
1488 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1492 QCOMPARE(m_window->
desktops(), {vd2});
1493 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
1496 destroyTestWindow();
1497 VirtualDesktopManager::self()->setCurrent(vd1);
1498 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1501 QCOMPARE(m_window->
desktops(), {vd1});
1502 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1506 QCOMPARE(m_window->
desktops(), {vd2});
1507 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1510 QCOMPARE(m_window->
desktops(), {vd1});
1511 QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
1513 destroyTestWindow();
1516void TestXdgShellWindowRules::testMinimizeDontAffect()
1526 destroyTestWindow();
1529void TestXdgShellWindowRules::testMinimizeApply()
1533 createTestWindow(ClientShouldBeInactive);
1544 destroyTestWindow();
1545 createTestWindow(ClientShouldBeInactive);
1549 destroyTestWindow();
1552void TestXdgShellWindowRules::testMinimizeRemember()
1565 destroyTestWindow();
1566 createTestWindow(ClientShouldBeInactive);
1570 destroyTestWindow();
1573void TestXdgShellWindowRules::testMinimizeForce()
1586 destroyTestWindow();
1593 destroyTestWindow();
1596void TestXdgShellWindowRules::testMinimizeApplyNow()
1617 destroyTestWindow();
1620void TestXdgShellWindowRules::testMinimizeForceTemporarily()
1633 destroyTestWindow();
1640 destroyTestWindow();
1643void TestXdgShellWindowRules::testSkipTaskbarDontAffect()
1652 destroyTestWindow();
1655void TestXdgShellWindowRules::testSkipTaskbarApply()
1669 destroyTestWindow();
1673 destroyTestWindow();
1676void TestXdgShellWindowRules::testSkipTaskbarRemember()
1690 destroyTestWindow();
1696 destroyTestWindow();
1699void TestXdgShellWindowRules::testSkipTaskbarForce()
1713 destroyTestWindow();
1719 destroyTestWindow();
1722void TestXdgShellWindowRules::testSkipTaskbarApplyNow()
1740 destroyTestWindow();
1743void TestXdgShellWindowRules::testSkipTaskbarForceTemporarily()
1757 destroyTestWindow();
1765 destroyTestWindow();
1768void TestXdgShellWindowRules::testSkipPagerDontAffect()
1777 destroyTestWindow();
1780void TestXdgShellWindowRules::testSkipPagerApply()
1794 destroyTestWindow();
1798 destroyTestWindow();
1801void TestXdgShellWindowRules::testSkipPagerRemember()
1815 destroyTestWindow();
1821 destroyTestWindow();
1824void TestXdgShellWindowRules::testSkipPagerForce()
1838 destroyTestWindow();
1844 destroyTestWindow();
1847void TestXdgShellWindowRules::testSkipPagerApplyNow()
1865 destroyTestWindow();
1868void TestXdgShellWindowRules::testSkipPagerForceTemporarily()
1882 destroyTestWindow();
1890 destroyTestWindow();
1893void TestXdgShellWindowRules::testSkipSwitcherDontAffect()
1902 destroyTestWindow();
1905void TestXdgShellWindowRules::testSkipSwitcherApply()
1907 setWindowRule(
"skipswitcher",
true,
int(
Rules::Apply));
1919 destroyTestWindow();
1923 destroyTestWindow();
1926void TestXdgShellWindowRules::testSkipSwitcherRemember()
1940 destroyTestWindow();
1946 destroyTestWindow();
1949void TestXdgShellWindowRules::testSkipSwitcherForce()
1951 setWindowRule(
"skipswitcher",
true,
int(
Rules::Force));
1963 destroyTestWindow();
1969 destroyTestWindow();
1972void TestXdgShellWindowRules::testSkipSwitcherApplyNow()
1990 destroyTestWindow();
1993void TestXdgShellWindowRules::testSkipSwitcherForceTemporarily()
2007 destroyTestWindow();
2015 destroyTestWindow();
2018void TestXdgShellWindowRules::testKeepAboveDontAffect()
2027 destroyTestWindow();
2030void TestXdgShellWindowRules::testKeepAboveApply()
2044 destroyTestWindow();
2048 destroyTestWindow();
2051void TestXdgShellWindowRules::testKeepAboveRemember()
2063 destroyTestWindow();
2069 destroyTestWindow();
2072void TestXdgShellWindowRules::testKeepAboveForce()
2086 destroyTestWindow();
2090 destroyTestWindow();
2093void TestXdgShellWindowRules::testKeepAboveApplyNow()
2111 destroyTestWindow();
2114void TestXdgShellWindowRules::testKeepAboveForceTemporarily()
2128 destroyTestWindow();
2138 destroyTestWindow();
2141void TestXdgShellWindowRules::testKeepBelowDontAffect()
2150 destroyTestWindow();
2153void TestXdgShellWindowRules::testKeepBelowApply()
2167 destroyTestWindow();
2171 destroyTestWindow();
2174void TestXdgShellWindowRules::testKeepBelowRemember()
2186 destroyTestWindow();
2192 destroyTestWindow();
2195void TestXdgShellWindowRules::testKeepBelowForce()
2209 destroyTestWindow();
2213 destroyTestWindow();
2216void TestXdgShellWindowRules::testKeepBelowApplyNow()
2234 destroyTestWindow();
2237void TestXdgShellWindowRules::testKeepBelowForceTemporarily()
2251 destroyTestWindow();
2261 destroyTestWindow();
2264void TestXdgShellWindowRules::testShortcutDontAffect()
2266#if !KWIN_BUILD_GLOBALSHORTCUTS
2267 QSKIP(
"Can't test shortcuts without shortcuts");
2274 QCOMPARE(m_window->
shortcut(), QKeySequence());
2279 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2280 quint32 timestamp = 1;
2287 QVERIFY(!minimizedChangedSpy.wait(100));
2290 destroyTestWindow();
2293void TestXdgShellWindowRules::testShortcutApply()
2295#if !KWIN_BUILD_GLOBALSHORTCUTS
2296 QSKIP(
"Can't test shortcuts without shortcuts");
2299 setWindowRule(
"shortcut",
"Ctrl+Alt+1",
int(
Rules::Apply));
2304 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2305 quint32 timestamp = 1;
2306 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2315 QVERIFY(minimizedChangedSpy.wait());
2319 m_window->
setShortcut(QStringLiteral(
"Ctrl+Alt+2"));
2320 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
2329 QVERIFY(minimizedChangedSpy.wait());
2341 QVERIFY(!minimizedChangedSpy.wait(100));
2345 destroyTestWindow();
2349 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2351 destroyTestWindow();
2354void TestXdgShellWindowRules::testShortcutRemember()
2356 QSKIP(
"KWin core doesn't try to save the last used window shortcut");
2363 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2364 quint32 timestamp = 1;
2365 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2374 QVERIFY(minimizedChangedSpy.wait());
2378 m_window->
setShortcut(QStringLiteral(
"Ctrl+Alt+2"));
2379 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
2388 QVERIFY(minimizedChangedSpy.wait());
2392 destroyTestWindow();
2396 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
2398 destroyTestWindow();
2401void TestXdgShellWindowRules::testShortcutForce()
2403 QSKIP(
"KWin core can't release forced window shortcuts");
2405 setWindowRule(
"shortcut",
"Ctrl+Alt+1",
int(
Rules::Force));
2410 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2411 quint32 timestamp = 1;
2412 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2421 QVERIFY(minimizedChangedSpy.wait());
2425 m_window->
setShortcut(QStringLiteral(
"Ctrl+Alt+2"));
2426 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2435 QVERIFY(!minimizedChangedSpy.wait(100));
2439 destroyTestWindow();
2443 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2445 destroyTestWindow();
2448void TestXdgShellWindowRules::testShortcutApplyNow()
2450#if !KWIN_BUILD_GLOBALSHORTCUTS
2451 QSKIP(
"Can't test shortcuts without shortcuts");
2456 QVERIFY(m_window->
shortcut().isEmpty());
2461 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2462 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2463 quint32 timestamp = 1;
2472 QVERIFY(minimizedChangedSpy.wait());
2476 m_window->
setShortcut(QStringLiteral(
"Ctrl+Alt+2"));
2477 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
2486 QVERIFY(minimizedChangedSpy.wait());
2491 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
2493 destroyTestWindow();
2496void TestXdgShellWindowRules::testShortcutForceTemporarily()
2498 QSKIP(
"KWin core can't release forced window shortcuts");
2505 QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
2506 quint32 timestamp = 1;
2507 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2516 QVERIFY(minimizedChangedSpy.wait());
2520 m_window->
setShortcut(QStringLiteral(
"Ctrl+Alt+2"));
2521 QCOMPARE(m_window->
shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
2530 QVERIFY(!minimizedChangedSpy.wait(100));
2534 destroyTestWindow();
2536 QVERIFY(m_window->
shortcut().isEmpty());
2538 destroyTestWindow();
2541void TestXdgShellWindowRules::testDesktopFileDontAffect()
2546 QSKIP(
"Needs changes in KWin core to pass");
2549void TestXdgShellWindowRules::testDesktopFileApply()
2554 QSKIP(
"Needs changes in KWin core to pass");
2557void TestXdgShellWindowRules::testDesktopFileRemember()
2562 QSKIP(
"Needs changes in KWin core to pass");
2565void TestXdgShellWindowRules::testDesktopFileForce()
2570 QSKIP(
"Needs changes in KWin core to pass");
2573void TestXdgShellWindowRules::testDesktopFileApplyNow()
2578 QSKIP(
"Needs changes in KWin core to pass");
2581void TestXdgShellWindowRules::testDesktopFileForceTemporarily()
2586 QSKIP(
"Needs changes in KWin core to pass");
2589void TestXdgShellWindowRules::testActiveOpacityDontAffect()
2597 QCOMPARE(m_window->
opacity(), 1.0);
2599 destroyTestWindow();
2602void TestXdgShellWindowRules::testActiveOpacityForce()
2608 QCOMPARE(m_window->
opacity(), 0.9);
2610 destroyTestWindow();
2613void TestXdgShellWindowRules::testActiveOpacityForceTemporarily()
2619 QCOMPARE(m_window->
opacity(), 0.9);
2622 destroyTestWindow();
2625 QCOMPARE(m_window->
opacity(), 1.0);
2627 destroyTestWindow();
2630void TestXdgShellWindowRules::testInactiveOpacityDontAffect()
2642 QCOMPARE(m_window->
opacity(), 1.0);
2644 destroyTestWindow();
2647void TestXdgShellWindowRules::testInactiveOpacityForce()
2649 setWindowRule(
"opacityinactive", 80,
int(
Rules::Force));
2653 QCOMPARE(m_window->
opacity(), 1.0);
2660 QCOMPARE(m_window->
opacity(), 0.8);
2662 destroyTestWindow();
2665void TestXdgShellWindowRules::testInactiveOpacityForceTemporarily()
2671 QCOMPARE(m_window->
opacity(), 1.0);
2678 QCOMPARE(m_window->
opacity(), 0.8);
2681 destroyTestWindow();
2685 QCOMPARE(m_window->
opacity(), 1.0);
2688 QCOMPARE(m_window->
opacity(), 1.0);
2690 destroyTestWindow();
2693void TestXdgShellWindowRules::testNoBorderDontAffect()
2701 destroyTestWindow();
2704void TestXdgShellWindowRules::testNoBorderApply()
2719 destroyTestWindow();
2723 destroyTestWindow();
2726void TestXdgShellWindowRules::testNoBorderRemember()
2741 destroyTestWindow();
2746 destroyTestWindow();
2749void TestXdgShellWindowRules::testNoBorderForce()
2763 destroyTestWindow();
2769 destroyTestWindow();
2772void TestXdgShellWindowRules::testNoBorderApplyNow()
2791 destroyTestWindow();
2794void TestXdgShellWindowRules::testNoBorderForceTemporarily()
2807 destroyTestWindow();
2817 destroyTestWindow();
2820void TestXdgShellWindowRules::testScreenDontAffect()
2835 destroyTestWindow();
2838void TestXdgShellWindowRules::testScreenApply()
2847 QEXPECT_FAIL(
"",
"Applying a screen rule on a new client fails on Wayland", Continue);
2854 destroyTestWindow();
2857void TestXdgShellWindowRules::testScreenRemember()
2873 destroyTestWindow();
2876 QEXPECT_FAIL(
"",
"Applying a screen rule on a new client fails on Wayland", Continue);
2879 destroyTestWindow();
2882void TestXdgShellWindowRules::testScreenForce()
2901 changeSet->enabled =
false;
2904 QVERIFY(!
outputs.at(1)->isEnabled());
2908 changeSet->enabled =
true;
2911 QVERIFY(
outputs.at(1)->isEnabled());
2915 destroyTestWindow();
2918 QEXPECT_FAIL(
"",
"Applying a screen rule on a new client fails on Wayland", Continue);
2921 destroyTestWindow();
2924void TestXdgShellWindowRules::testScreenApplyNow()
2944 destroyTestWindow();
2947void TestXdgShellWindowRules::testScreenForceTemporarily()
2963 destroyTestWindow();
2969 destroyTestWindow();
2972void TestXdgShellWindowRules::testMatchAfterNameChange()
2981 QVERIFY(window->isActive());
2982 QCOMPARE(window->keepAbove(),
false);
2984 QSignalSpy desktopFileNameSpy(window, &Window::desktopFileNameChanged);
2986 shellSurface->set_app_id(QStringLiteral(
"org.kde.foo"));
2987 QVERIFY(desktopFileNameSpy.wait());
2988 QCOMPARE(window->keepAbove(),
true);
2991void TestXdgShellWindowRules::testLayerDontAffect()
3000 destroyTestWindow();
3003void TestXdgShellWindowRules::testLayerForce()
3005 setWindowRule(
"layer", QStringLiteral(
"overlay"),
int(
Rules::Force));
3010 destroyTestWindow();
3013void TestXdgShellWindowRules::testLayerForceTemporarily()
3021 destroyTestWindow();
3025 destroyTestWindow();
3028void TestXdgShellWindowRules::testCloseableDontAffect()
3036 destroyTestWindow();
3039void TestXdgShellWindowRules::testCloseableForce()
3046 destroyTestWindow();
3049void TestXdgShellWindowRules::testCloseableForceTemporarily()
3057 destroyTestWindow();
3061 destroyTestWindow();
3065#include "xdgshellwindow_rules_test.moc"
std::shared_ptr< OutputChangeSet > changeSet(Output *output)
void setConfig(const KSharedConfig::Ptr &config)
void configureRequested(quint32 serial)
void configureRequested(const QSize &size, KWin::Test::XdgToplevel::States states)
void setMinimized(bool set)
bool isInteractiveMove() const
virtual bool isMaximizable() const
void updateInteractiveMoveResize(const QPointF ¤tGlobalCursor)
void keyPressEvent(uint key_code)
virtual bool isMinimizable() const
virtual bool isMovableAcrossScreens() const =0
bool isInteractiveResize() const
void setDesktops(QList< VirtualDesktop * > desktops)
virtual MaximizeMode requestedMaximizeMode() const
void setOriginalSkipTaskbar(bool set)
QList< KWin::VirtualDesktop * > desktops
virtual bool isMovable() const =0
virtual bool isCloseable() const =0
void evaluateWindowRules()
void setSkipPager(bool set)
virtual void setNoBorder(bool set)
virtual bool isResizable() const =0
const QKeySequence & shortcut() const
virtual bool userCanSetNoBorder() const
virtual MaximizeMode maximizeMode() const
void setShortcut(const QString &cut)
void setSkipSwitcher(bool set)
bool applyOutputConfiguration(const OutputConfiguration &config, const QList< Output * > &outputOrder={})
void sendWindowToOutput(Window *window, Output *output)
void slotWindowMaximize()
RuleBook * rulebook() const
QList< Output * > outputs() const
void setActiveWindow(Window *window)
void setActiveOutput(Output *output)
#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())
void render(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format=QImage::Format_ARGB32_Premultiplied)
QList< KWayland::Client::Output * > outputs
std::unique_ptr< KWayland::Client::Surface > createSurface()
XdgToplevel * createXdgToplevelSurface(KWayland::Client::Surface *surface, QObject *parent=nullptr)
XdgToplevelDecorationV1 * createXdgToplevelDecorationV1(XdgToplevel *toplevel, QObject *parent=nullptr)
bool waitForWindowClosed(Window *window)
WaylandServer * waylandServer()