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