Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/stacking_order_test.cpp
Show All 20 Lines | |||||
21 | #include "kwin_wayland_test.h" | 21 | #include "kwin_wayland_test.h" | ||
22 | 22 | | |||
23 | #include "abstract_client.h" | 23 | #include "abstract_client.h" | ||
24 | #include "atoms.h" | 24 | #include "atoms.h" | ||
25 | #include "client.h" | 25 | #include "client.h" | ||
26 | #include "deleted.h" | 26 | #include "deleted.h" | ||
27 | #include "main.h" | 27 | #include "main.h" | ||
28 | #include "platform.h" | 28 | #include "platform.h" | ||
29 | #include "shell_client.h" | 29 | #include "xdgshellclient.h" | ||
30 | #include "wayland_server.h" | 30 | #include "wayland_server.h" | ||
31 | #include "workspace.h" | 31 | #include "workspace.h" | ||
32 | 32 | | |||
33 | #include <KWayland/Client/compositor.h> | 33 | #include <KWayland/Client/compositor.h> | ||
34 | #include <KWayland/Client/surface.h> | 34 | #include <KWayland/Client/surface.h> | ||
35 | 35 | | |||
36 | #include <xcb/xcb.h> | 36 | #include <xcb/xcb.h> | ||
37 | #include <xcb/xcb_icccm.h> | 37 | #include <xcb/xcb_icccm.h> | ||
Show All 24 Lines | 47 | private Q_SLOTS: | |||
62 | void testKeepBelow(); | 62 | void testKeepBelow(); | ||
63 | 63 | | |||
64 | }; | 64 | }; | ||
65 | 65 | | |||
66 | void StackingOrderTest::initTestCase() | 66 | void StackingOrderTest::initTestCase() | ||
67 | { | 67 | { | ||
68 | qRegisterMetaType<KWin::AbstractClient *>(); | 68 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
69 | qRegisterMetaType<KWin::Deleted *>(); | 69 | qRegisterMetaType<KWin::Deleted *>(); | ||
70 | qRegisterMetaType<KWin::ShellClient *>(); | 70 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
71 | 71 | | |||
72 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 72 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
73 | QVERIFY(workspaceCreatedSpy.isValid()); | 73 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
74 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 74 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
75 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 75 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
76 | 76 | | |||
77 | kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); | 77 | kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig)); | ||
78 | 78 | | |||
Show All 18 Lines | 95 | { | |||
97 | 97 | | |||
98 | // Create the parent. | 98 | // Create the parent. | ||
99 | KWayland::Client::Surface *parentSurface = | 99 | KWayland::Client::Surface *parentSurface = | ||
100 | Test::createSurface(Test::waylandCompositor()); | 100 | Test::createSurface(Test::waylandCompositor()); | ||
101 | QVERIFY(parentSurface); | 101 | QVERIFY(parentSurface); | ||
102 | KWayland::Client::XdgShellSurface *parentShellSurface = | 102 | KWayland::Client::XdgShellSurface *parentShellSurface = | ||
103 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | 103 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | ||
104 | QVERIFY(parentShellSurface); | 104 | QVERIFY(parentShellSurface); | ||
105 | ShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | 105 | XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | ||
106 | QVERIFY(parent); | 106 | QVERIFY(parent); | ||
107 | QVERIFY(parent->isActive()); | 107 | QVERIFY(parent->isActive()); | ||
108 | QVERIFY(!parent->isTransient()); | 108 | QVERIFY(!parent->isTransient()); | ||
109 | 109 | | |||
110 | // Initially, the stacking order should contain only the parent window. | 110 | // Initially, the stacking order should contain only the parent window. | ||
111 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | 111 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | ||
112 | 112 | | |||
113 | // Create the transient. | 113 | // Create the transient. | ||
114 | KWayland::Client::Surface *transientSurface = | 114 | KWayland::Client::Surface *transientSurface = | ||
115 | Test::createSurface(Test::waylandCompositor()); | 115 | Test::createSurface(Test::waylandCompositor()); | ||
116 | QVERIFY(transientSurface); | 116 | QVERIFY(transientSurface); | ||
117 | KWayland::Client::XdgShellSurface *transientShellSurface = | 117 | KWayland::Client::XdgShellSurface *transientShellSurface = | ||
118 | Test::createXdgShellStableSurface(transientSurface, transientSurface); | 118 | Test::createXdgShellStableSurface(transientSurface, transientSurface); | ||
119 | QVERIFY(transientShellSurface); | 119 | QVERIFY(transientShellSurface); | ||
120 | transientShellSurface->setTransientFor(parentShellSurface); | 120 | transientShellSurface->setTransientFor(parentShellSurface); | ||
121 | ShellClient *transient = Test::renderAndWaitForShown( | 121 | XdgShellClient *transient = Test::renderAndWaitForShown( | ||
122 | transientSurface, QSize(128, 128), Qt::red); | 122 | transientSurface, QSize(128, 128), Qt::red); | ||
123 | QVERIFY(transient); | 123 | QVERIFY(transient); | ||
124 | QVERIFY(transient->isActive()); | 124 | QVERIFY(transient->isActive()); | ||
125 | QVERIFY(transient->isTransient()); | 125 | QVERIFY(transient->isTransient()); | ||
126 | 126 | | |||
127 | // The transient should be above the parent. | 127 | // The transient should be above the parent. | ||
128 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient})); | 128 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient})); | ||
129 | 129 | | |||
Show All 11 Lines | 138 | { | |||
141 | 141 | | |||
142 | // Create the parent. | 142 | // Create the parent. | ||
143 | KWayland::Client::Surface *parentSurface = | 143 | KWayland::Client::Surface *parentSurface = | ||
144 | Test::createSurface(Test::waylandCompositor()); | 144 | Test::createSurface(Test::waylandCompositor()); | ||
145 | QVERIFY(parentSurface); | 145 | QVERIFY(parentSurface); | ||
146 | KWayland::Client::XdgShellSurface *parentShellSurface = | 146 | KWayland::Client::XdgShellSurface *parentShellSurface = | ||
147 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | 147 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | ||
148 | QVERIFY(parentShellSurface); | 148 | QVERIFY(parentShellSurface); | ||
149 | ShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | 149 | XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | ||
150 | QVERIFY(parent); | 150 | QVERIFY(parent); | ||
151 | QVERIFY(parent->isActive()); | 151 | QVERIFY(parent->isActive()); | ||
152 | QVERIFY(!parent->isTransient()); | 152 | QVERIFY(!parent->isTransient()); | ||
153 | 153 | | |||
154 | // Initially, the stacking order should contain only the parent window. | 154 | // Initially, the stacking order should contain only the parent window. | ||
155 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | 155 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | ||
156 | 156 | | |||
157 | // Create the transient. | 157 | // Create the transient. | ||
158 | KWayland::Client::Surface *transientSurface = | 158 | KWayland::Client::Surface *transientSurface = | ||
159 | Test::createSurface(Test::waylandCompositor()); | 159 | Test::createSurface(Test::waylandCompositor()); | ||
160 | QVERIFY(transientSurface); | 160 | QVERIFY(transientSurface); | ||
161 | KWayland::Client::XdgShellSurface *transientShellSurface = | 161 | KWayland::Client::XdgShellSurface *transientShellSurface = | ||
162 | Test::createXdgShellStableSurface(transientSurface, transientSurface); | 162 | Test::createXdgShellStableSurface(transientSurface, transientSurface); | ||
163 | QVERIFY(transientShellSurface); | 163 | QVERIFY(transientShellSurface); | ||
164 | transientShellSurface->setTransientFor(parentShellSurface); | 164 | transientShellSurface->setTransientFor(parentShellSurface); | ||
165 | ShellClient *transient = Test::renderAndWaitForShown( | 165 | XdgShellClient *transient = Test::renderAndWaitForShown( | ||
166 | transientSurface, QSize(128, 128), Qt::red); | 166 | transientSurface, QSize(128, 128), Qt::red); | ||
167 | QVERIFY(transient); | 167 | QVERIFY(transient); | ||
168 | QTRY_VERIFY(transient->isActive()); | 168 | QTRY_VERIFY(transient->isActive()); | ||
169 | QVERIFY(transient->isTransient()); | 169 | QVERIFY(transient->isTransient()); | ||
170 | 170 | | |||
171 | // The transient should be above the parent. | 171 | // The transient should be above the parent. | ||
172 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient})); | 172 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient})); | ||
173 | 173 | | |||
174 | // Create a window that doesn't have any relationship to the parent or the transient. | 174 | // Create a window that doesn't have any relationship to the parent or the transient. | ||
175 | KWayland::Client::Surface *anotherSurface = | 175 | KWayland::Client::Surface *anotherSurface = | ||
176 | Test::createSurface(Test::waylandCompositor()); | 176 | Test::createSurface(Test::waylandCompositor()); | ||
177 | QVERIFY(anotherSurface); | 177 | QVERIFY(anotherSurface); | ||
178 | KWayland::Client::XdgShellSurface *anotherShellSurface = | 178 | KWayland::Client::XdgShellSurface *anotherShellSurface = | ||
179 | Test::createXdgShellStableSurface(anotherSurface, anotherSurface); | 179 | Test::createXdgShellStableSurface(anotherSurface, anotherSurface); | ||
180 | QVERIFY(anotherShellSurface); | 180 | QVERIFY(anotherShellSurface); | ||
181 | ShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); | 181 | XdgShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); | ||
182 | QVERIFY(anotherClient); | 182 | QVERIFY(anotherClient); | ||
183 | QVERIFY(anotherClient->isActive()); | 183 | QVERIFY(anotherClient->isActive()); | ||
184 | QVERIFY(!anotherClient->isTransient()); | 184 | QVERIFY(!anotherClient->isTransient()); | ||
185 | 185 | | |||
186 | // The newly created surface has to be above both the parent and the transient. | 186 | // The newly created surface has to be above both the parent and the transient. | ||
187 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient, anotherClient})); | 187 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient, anotherClient})); | ||
188 | 188 | | |||
189 | // If we activate the parent, the transient should be raised too. | 189 | // If we activate the parent, the transient should be raised too. | ||
Show All 34 Lines | 221 | { | |||
224 | 224 | | |||
225 | // Create the parent. | 225 | // Create the parent. | ||
226 | KWayland::Client::Surface *parentSurface = | 226 | KWayland::Client::Surface *parentSurface = | ||
227 | Test::createSurface(Test::waylandCompositor()); | 227 | Test::createSurface(Test::waylandCompositor()); | ||
228 | QVERIFY(parentSurface); | 228 | QVERIFY(parentSurface); | ||
229 | KWayland::Client::XdgShellSurface *parentShellSurface = | 229 | KWayland::Client::XdgShellSurface *parentShellSurface = | ||
230 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | 230 | Test::createXdgShellStableSurface(parentSurface, parentSurface); | ||
231 | QVERIFY(parentShellSurface); | 231 | QVERIFY(parentShellSurface); | ||
232 | ShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | 232 | XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); | ||
233 | QVERIFY(parent); | 233 | QVERIFY(parent); | ||
234 | QVERIFY(parent->isActive()); | 234 | QVERIFY(parent->isActive()); | ||
235 | QVERIFY(!parent->isTransient()); | 235 | QVERIFY(!parent->isTransient()); | ||
236 | 236 | | |||
237 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | 237 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent})); | ||
238 | 238 | | |||
239 | // Create the first transient. | 239 | // Create the first transient. | ||
240 | KWayland::Client::Surface *transient1Surface = | 240 | KWayland::Client::Surface *transient1Surface = | ||
241 | Test::createSurface(Test::waylandCompositor()); | 241 | Test::createSurface(Test::waylandCompositor()); | ||
242 | QVERIFY(transient1Surface); | 242 | QVERIFY(transient1Surface); | ||
243 | KWayland::Client::XdgShellSurface *transient1ShellSurface = | 243 | KWayland::Client::XdgShellSurface *transient1ShellSurface = | ||
244 | Test::createXdgShellStableSurface(transient1Surface, transient1Surface); | 244 | Test::createXdgShellStableSurface(transient1Surface, transient1Surface); | ||
245 | QVERIFY(transient1ShellSurface); | 245 | QVERIFY(transient1ShellSurface); | ||
246 | transient1ShellSurface->setTransientFor(parentShellSurface); | 246 | transient1ShellSurface->setTransientFor(parentShellSurface); | ||
247 | ShellClient *transient1 = Test::renderAndWaitForShown( | 247 | XdgShellClient *transient1 = Test::renderAndWaitForShown( | ||
248 | transient1Surface, QSize(128, 128), Qt::red); | 248 | transient1Surface, QSize(128, 128), Qt::red); | ||
249 | QVERIFY(transient1); | 249 | QVERIFY(transient1); | ||
250 | QTRY_VERIFY(transient1->isActive()); | 250 | QTRY_VERIFY(transient1->isActive()); | ||
251 | QVERIFY(transient1->isTransient()); | 251 | QVERIFY(transient1->isTransient()); | ||
252 | QCOMPARE(transient1->transientFor(), parent); | 252 | QCOMPARE(transient1->transientFor(), parent); | ||
253 | 253 | | |||
254 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1})); | 254 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1})); | ||
255 | 255 | | |||
256 | // Create the second transient. | 256 | // Create the second transient. | ||
257 | KWayland::Client::Surface *transient2Surface = | 257 | KWayland::Client::Surface *transient2Surface = | ||
258 | Test::createSurface(Test::waylandCompositor()); | 258 | Test::createSurface(Test::waylandCompositor()); | ||
259 | QVERIFY(transient2Surface); | 259 | QVERIFY(transient2Surface); | ||
260 | KWayland::Client::XdgShellSurface *transient2ShellSurface = | 260 | KWayland::Client::XdgShellSurface *transient2ShellSurface = | ||
261 | Test::createXdgShellStableSurface(transient2Surface, transient2Surface); | 261 | Test::createXdgShellStableSurface(transient2Surface, transient2Surface); | ||
262 | QVERIFY(transient2ShellSurface); | 262 | QVERIFY(transient2ShellSurface); | ||
263 | transient2ShellSurface->setTransientFor(transient1ShellSurface); | 263 | transient2ShellSurface->setTransientFor(transient1ShellSurface); | ||
264 | ShellClient *transient2 = Test::renderAndWaitForShown( | 264 | XdgShellClient *transient2 = Test::renderAndWaitForShown( | ||
265 | transient2Surface, QSize(128, 128), Qt::red); | 265 | transient2Surface, QSize(128, 128), Qt::red); | ||
266 | QVERIFY(transient2); | 266 | QVERIFY(transient2); | ||
267 | QTRY_VERIFY(transient2->isActive()); | 267 | QTRY_VERIFY(transient2->isActive()); | ||
268 | QVERIFY(transient2->isTransient()); | 268 | QVERIFY(transient2->isTransient()); | ||
269 | QCOMPARE(transient2->transientFor(), transient1); | 269 | QCOMPARE(transient2->transientFor(), transient1); | ||
270 | 270 | | |||
271 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1, transient2})); | 271 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{parent, transient1, transient2})); | ||
272 | 272 | | |||
273 | // Activate the parent, both transients have to be above it. | 273 | // Activate the parent, both transients have to be above it. | ||
274 | workspace()->activateClient(parent); | 274 | workspace()->activateClient(parent); | ||
275 | QTRY_VERIFY(parent->isActive()); | 275 | QTRY_VERIFY(parent->isActive()); | ||
276 | QTRY_VERIFY(!transient1->isActive()); | 276 | QTRY_VERIFY(!transient1->isActive()); | ||
277 | QTRY_VERIFY(!transient2->isActive()); | 277 | QTRY_VERIFY(!transient2->isActive()); | ||
278 | 278 | | |||
279 | // Close the top-most transient. | 279 | // Close the top-most transient. | ||
280 | connect(transient2, &ShellClient::windowClosed, this, | 280 | connect(transient2, &XdgShellClient::windowClosed, this, | ||
281 | [](Toplevel *toplevel, Deleted *deleted) { | 281 | [](Toplevel *toplevel, Deleted *deleted) { | ||
282 | Q_UNUSED(toplevel) | 282 | Q_UNUSED(toplevel) | ||
283 | deleted->refWindow(); | 283 | deleted->refWindow(); | ||
284 | } | 284 | } | ||
285 | ); | 285 | ); | ||
286 | 286 | | |||
287 | QSignalSpy windowClosedSpy(transient2, &ShellClient::windowClosed); | 287 | QSignalSpy windowClosedSpy(transient2, &XdgShellClient::windowClosed); | ||
288 | QVERIFY(windowClosedSpy.isValid()); | 288 | QVERIFY(windowClosedSpy.isValid()); | ||
289 | delete transient2ShellSurface; | 289 | delete transient2ShellSurface; | ||
290 | delete transient2Surface; | 290 | delete transient2Surface; | ||
291 | QVERIFY(windowClosedSpy.wait()); | 291 | QVERIFY(windowClosedSpy.wait()); | ||
292 | 292 | | |||
293 | QScopedPointer<Deleted, WindowUnrefDeleter> deletedTransient( | 293 | QScopedPointer<Deleted, WindowUnrefDeleter> deletedTransient( | ||
294 | windowClosedSpy.first().at(1).value<Deleted *>()); | 294 | windowClosedSpy.first().at(1).value<Deleted *>()); | ||
295 | QVERIFY(deletedTransient.data()); | 295 | QVERIFY(deletedTransient.data()); | ||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Line(s) | 472 | { | |||
566 | 566 | | |||
567 | // Create a Wayland client that is not a member of the window group. | 567 | // Create a Wayland client that is not a member of the window group. | ||
568 | KWayland::Client::Surface *anotherSurface = | 568 | KWayland::Client::Surface *anotherSurface = | ||
569 | Test::createSurface(Test::waylandCompositor()); | 569 | Test::createSurface(Test::waylandCompositor()); | ||
570 | QVERIFY(anotherSurface); | 570 | QVERIFY(anotherSurface); | ||
571 | KWayland::Client::XdgShellSurface *anotherShellSurface = | 571 | KWayland::Client::XdgShellSurface *anotherShellSurface = | ||
572 | Test::createXdgShellStableSurface(anotherSurface, anotherSurface); | 572 | Test::createXdgShellStableSurface(anotherSurface, anotherSurface); | ||
573 | QVERIFY(anotherShellSurface); | 573 | QVERIFY(anotherShellSurface); | ||
574 | ShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); | 574 | XdgShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); | ||
575 | QVERIFY(anotherClient); | 575 | QVERIFY(anotherClient); | ||
576 | QVERIFY(anotherClient->isActive()); | 576 | QVERIFY(anotherClient->isActive()); | ||
577 | QVERIFY(!anotherClient->isTransient()); | 577 | QVERIFY(!anotherClient->isTransient()); | ||
578 | 578 | | |||
579 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient, anotherClient})); | 579 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{leader, member1, member2, transient, anotherClient})); | ||
580 | 580 | | |||
581 | // If we activate the leader, then only it and the transient have to be raised. | 581 | // If we activate the leader, then only it and the transient have to be raised. | ||
582 | workspace()->activateClient(leader); | 582 | workspace()->activateClient(leader); | ||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Line(s) | 819 | { | |||
821 | 821 | | |||
822 | // Create the first client. | 822 | // Create the first client. | ||
823 | KWayland::Client::Surface *clientASurface = | 823 | KWayland::Client::Surface *clientASurface = | ||
824 | Test::createSurface(Test::waylandCompositor()); | 824 | Test::createSurface(Test::waylandCompositor()); | ||
825 | QVERIFY(clientASurface); | 825 | QVERIFY(clientASurface); | ||
826 | KWayland::Client::XdgShellSurface *clientAShellSurface = | 826 | KWayland::Client::XdgShellSurface *clientAShellSurface = | ||
827 | Test::createXdgShellStableSurface(clientASurface, clientASurface); | 827 | Test::createXdgShellStableSurface(clientASurface, clientASurface); | ||
828 | QVERIFY(clientAShellSurface); | 828 | QVERIFY(clientAShellSurface); | ||
829 | ShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); | 829 | XdgShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); | ||
830 | QVERIFY(clientA); | 830 | QVERIFY(clientA); | ||
831 | QVERIFY(clientA->isActive()); | 831 | QVERIFY(clientA->isActive()); | ||
832 | QVERIFY(!clientA->keepAbove()); | 832 | QVERIFY(!clientA->keepAbove()); | ||
833 | 833 | | |||
834 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA})); | 834 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA})); | ||
835 | 835 | | |||
836 | // Create the second client. | 836 | // Create the second client. | ||
837 | KWayland::Client::Surface *clientBSurface = | 837 | KWayland::Client::Surface *clientBSurface = | ||
838 | Test::createSurface(Test::waylandCompositor()); | 838 | Test::createSurface(Test::waylandCompositor()); | ||
839 | QVERIFY(clientBSurface); | 839 | QVERIFY(clientBSurface); | ||
840 | KWayland::Client::XdgShellSurface *clientBShellSurface = | 840 | KWayland::Client::XdgShellSurface *clientBShellSurface = | ||
841 | Test::createXdgShellStableSurface(clientBSurface, clientBSurface); | 841 | Test::createXdgShellStableSurface(clientBSurface, clientBSurface); | ||
842 | QVERIFY(clientBShellSurface); | 842 | QVERIFY(clientBShellSurface); | ||
843 | ShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); | 843 | XdgShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); | ||
844 | QVERIFY(clientB); | 844 | QVERIFY(clientB); | ||
845 | QVERIFY(clientB->isActive()); | 845 | QVERIFY(clientB->isActive()); | ||
846 | QVERIFY(!clientB->keepAbove()); | 846 | QVERIFY(!clientB->keepAbove()); | ||
847 | 847 | | |||
848 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB})); | 848 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB})); | ||
849 | 849 | | |||
850 | // Go to the initial test position. | 850 | // Go to the initial test position. | ||
851 | workspace()->activateClient(clientA); | 851 | workspace()->activateClient(clientA); | ||
Show All 17 Lines | 867 | { | |||
869 | 869 | | |||
870 | // Create the first client. | 870 | // Create the first client. | ||
871 | KWayland::Client::Surface *clientASurface = | 871 | KWayland::Client::Surface *clientASurface = | ||
872 | Test::createSurface(Test::waylandCompositor()); | 872 | Test::createSurface(Test::waylandCompositor()); | ||
873 | QVERIFY(clientASurface); | 873 | QVERIFY(clientASurface); | ||
874 | KWayland::Client::XdgShellSurface *clientAShellSurface = | 874 | KWayland::Client::XdgShellSurface *clientAShellSurface = | ||
875 | Test::createXdgShellStableSurface(clientASurface, clientASurface); | 875 | Test::createXdgShellStableSurface(clientASurface, clientASurface); | ||
876 | QVERIFY(clientAShellSurface); | 876 | QVERIFY(clientAShellSurface); | ||
877 | ShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); | 877 | XdgShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); | ||
878 | QVERIFY(clientA); | 878 | QVERIFY(clientA); | ||
879 | QVERIFY(clientA->isActive()); | 879 | QVERIFY(clientA->isActive()); | ||
880 | QVERIFY(!clientA->keepBelow()); | 880 | QVERIFY(!clientA->keepBelow()); | ||
881 | 881 | | |||
882 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA})); | 882 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA})); | ||
883 | 883 | | |||
884 | // Create the second client. | 884 | // Create the second client. | ||
885 | KWayland::Client::Surface *clientBSurface = | 885 | KWayland::Client::Surface *clientBSurface = | ||
886 | Test::createSurface(Test::waylandCompositor()); | 886 | Test::createSurface(Test::waylandCompositor()); | ||
887 | QVERIFY(clientBSurface); | 887 | QVERIFY(clientBSurface); | ||
888 | KWayland::Client::XdgShellSurface *clientBShellSurface = | 888 | KWayland::Client::XdgShellSurface *clientBShellSurface = | ||
889 | Test::createXdgShellStableSurface(clientBSurface, clientBSurface); | 889 | Test::createXdgShellStableSurface(clientBSurface, clientBSurface); | ||
890 | QVERIFY(clientBShellSurface); | 890 | QVERIFY(clientBShellSurface); | ||
891 | ShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); | 891 | XdgShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); | ||
892 | QVERIFY(clientB); | 892 | QVERIFY(clientB); | ||
893 | QVERIFY(clientB->isActive()); | 893 | QVERIFY(clientB->isActive()); | ||
894 | QVERIFY(!clientB->keepBelow()); | 894 | QVERIFY(!clientB->keepBelow()); | ||
895 | 895 | | |||
896 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB})); | 896 | QCOMPARE(workspace()->stackingOrder(), (ToplevelList{clientA, clientB})); | ||
897 | 897 | | |||
898 | // Set the "keep-below" flag on the client B, it should go below other clients. | 898 | // Set the "keep-below" flag on the client B, it should go below other clients. | ||
899 | { | 899 | { | ||
Show All 11 Lines |