Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/struts_test.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 172 | for (auto it = windowGeometries.constBegin(), end = windowGeometries.constEnd(); it != end; it++) { | |||
---|---|---|---|---|---|
178 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | 178 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | ||
179 | Test::initXdgShellSurface(surface, shellSurface); | 179 | Test::initXdgShellSurface(surface, shellSurface); | ||
180 | 180 | | |||
181 | // map the window | 181 | // map the window | ||
182 | auto c = Test::renderAndWaitForShown(surface, windowGeometry.size(), Qt::red, QImage::Format_RGB32); | 182 | auto c = Test::renderAndWaitForShown(surface, windowGeometry.size(), Qt::red, QImage::Format_RGB32); | ||
183 | 183 | | |||
184 | QVERIFY(c); | 184 | QVERIFY(c); | ||
185 | QVERIFY(!c->isActive()); | 185 | QVERIFY(!c->isActive()); | ||
186 | QCOMPARE(c->geometry(), windowGeometry); | 186 | QCOMPARE(c->frameGeometry(), windowGeometry); | ||
187 | QVERIFY(c->isDock()); | 187 | QVERIFY(c->isDock()); | ||
188 | QVERIFY(c->hasStrut()); | 188 | QVERIFY(c->hasStrut()); | ||
189 | clients.insert(surface, c); | 189 | clients.insert(surface, c); | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | // some props are independent of struts - those first | 192 | // some props are independent of struts - those first | ||
193 | // screen 0 | 193 | // screen 0 | ||
194 | QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024)); | 194 | QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
Show All 37 Lines | 225 | { | |||
232 | plasmaSurface->setPosition(windowGeometry.topLeft()); | 232 | plasmaSurface->setPosition(windowGeometry.topLeft()); | ||
233 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | 233 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | ||
234 | Test::initXdgShellSurface(surface.data(), shellSurface.data()); | 234 | Test::initXdgShellSurface(surface.data(), shellSurface.data()); | ||
235 | 235 | | |||
236 | // map the window | 236 | // map the window | ||
237 | auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); | 237 | auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); | ||
238 | QVERIFY(c); | 238 | QVERIFY(c); | ||
239 | QVERIFY(!c->isActive()); | 239 | QVERIFY(!c->isActive()); | ||
240 | QCOMPARE(c->geometry(), windowGeometry); | 240 | QCOMPARE(c->frameGeometry(), windowGeometry); | ||
241 | QVERIFY(c->isDock()); | 241 | QVERIFY(c->isDock()); | ||
242 | QVERIFY(c->hasStrut()); | 242 | QVERIFY(c->hasStrut()); | ||
243 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1000)); | 243 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1000)); | ||
244 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1000)); | 244 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1000)); | ||
245 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 245 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
246 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 246 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
247 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); | 247 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); | ||
248 | 248 | | |||
249 | QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryShapeChanged); | 249 | QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryShapeChanged); | ||
250 | QVERIFY(geometryChangedSpy.isValid()); | 250 | QVERIFY(geometryChangedSpy.isValid()); | ||
251 | plasmaSurface->setPosition(QPoint(1280, 1000)); | 251 | plasmaSurface->setPosition(QPoint(1280, 1000)); | ||
252 | QVERIFY(geometryChangedSpy.wait()); | 252 | QVERIFY(geometryChangedSpy.wait()); | ||
253 | QCOMPARE(c->geometry(), QRect(1280, 1000, 1280, 24)); | 253 | QCOMPARE(c->frameGeometry(), QRect(1280, 1000, 1280, 24)); | ||
254 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024)); | 254 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
255 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024)); | 255 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
256 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1000)); | 256 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1000)); | ||
257 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1000)); | 257 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1000)); | ||
258 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); | 258 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); | ||
259 | } | 259 | } | ||
260 | 260 | | |||
261 | void StrutsTest::testWaylandMobilePanel() | 261 | void StrutsTest::testWaylandMobilePanel() | ||
Show All 14 Lines | 262 | { | |||
276 | plasmaSurface->setPosition(windowGeometry.topLeft()); | 276 | plasmaSurface->setPosition(windowGeometry.topLeft()); | ||
277 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | 277 | plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); | ||
278 | Test::initXdgShellSurface(surface.data(), shellSurface.data()); | 278 | Test::initXdgShellSurface(surface.data(), shellSurface.data()); | ||
279 | 279 | | |||
280 | // map the first panel | 280 | // map the first panel | ||
281 | auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); | 281 | auto c = Test::renderAndWaitForShown(surface.data(), windowGeometry.size(), Qt::red, QImage::Format_RGB32); | ||
282 | QVERIFY(c); | 282 | QVERIFY(c); | ||
283 | QVERIFY(!c->isActive()); | 283 | QVERIFY(!c->isActive()); | ||
284 | QCOMPARE(c->geometry(), windowGeometry); | 284 | QCOMPARE(c->frameGeometry(), windowGeometry); | ||
285 | QVERIFY(c->isDock()); | 285 | QVERIFY(c->isDock()); | ||
286 | QVERIFY(c->hasStrut()); | 286 | QVERIFY(c->hasStrut()); | ||
287 | 287 | | |||
288 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 964)); | 288 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 964)); | ||
289 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 964)); | 289 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 964)); | ||
290 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 290 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
291 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 291 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
292 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 964)); | 292 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 964)); | ||
293 | 293 | | |||
294 | // create another bottom panel | 294 | // create another bottom panel | ||
295 | const QRect windowGeometry2(0, 874, 1280, 150); | 295 | const QRect windowGeometry2(0, 874, 1280, 150); | ||
296 | QScopedPointer<Surface> surface2(Test::createSurface()); | 296 | QScopedPointer<Surface> surface2(Test::createSurface()); | ||
297 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data(), surface2.data(), Test::CreationSetup::CreateOnly)); | 297 | QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data(), surface2.data(), Test::CreationSetup::CreateOnly)); | ||
298 | QScopedPointer<PlasmaShellSurface> plasmaSurface2(m_plasmaShell->createSurface(surface2.data())); | 298 | QScopedPointer<PlasmaShellSurface> plasmaSurface2(m_plasmaShell->createSurface(surface2.data())); | ||
299 | plasmaSurface2->setPosition(windowGeometry2.topLeft()); | 299 | plasmaSurface2->setPosition(windowGeometry2.topLeft()); | ||
300 | plasmaSurface2->setRole(PlasmaShellSurface::Role::Panel); | 300 | plasmaSurface2->setRole(PlasmaShellSurface::Role::Panel); | ||
301 | Test::initXdgShellSurface(surface2.data(), shellSurface2.data()); | 301 | Test::initXdgShellSurface(surface2.data(), shellSurface2.data()); | ||
302 | 302 | | |||
303 | auto c1 = Test::renderAndWaitForShown(surface2.data(), windowGeometry2.size(), Qt::blue, QImage::Format_RGB32); | 303 | auto c1 = Test::renderAndWaitForShown(surface2.data(), windowGeometry2.size(), Qt::blue, QImage::Format_RGB32); | ||
304 | 304 | | |||
305 | QVERIFY(c1); | 305 | QVERIFY(c1); | ||
306 | QVERIFY(!c1->isActive()); | 306 | QVERIFY(!c1->isActive()); | ||
307 | QCOMPARE(c1->geometry(), windowGeometry2); | 307 | QCOMPARE(c1->frameGeometry(), windowGeometry2); | ||
308 | QVERIFY(c1->isDock()); | 308 | QVERIFY(c1->isDock()); | ||
309 | QVERIFY(c1->hasStrut()); | 309 | QVERIFY(c1->hasStrut()); | ||
310 | 310 | | |||
311 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 814)); | 311 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 814)); | ||
312 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 814)); | 312 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 814)); | ||
313 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 313 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
314 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | 314 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); | ||
315 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 814)); | 315 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 814)); | ||
▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Line(s) | 527 | { | |||
600 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | 600 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | ||
601 | QVERIFY(windowCreatedSpy.isValid()); | 601 | QVERIFY(windowCreatedSpy.isValid()); | ||
602 | QVERIFY(windowCreatedSpy.wait()); | 602 | QVERIFY(windowCreatedSpy.wait()); | ||
603 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | 603 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | ||
604 | QVERIFY(client); | 604 | QVERIFY(client); | ||
605 | QCOMPARE(client->window(), w); | 605 | QCOMPARE(client->window(), w); | ||
606 | QVERIFY(!client->isDecorated()); | 606 | QVERIFY(!client->isDecorated()); | ||
607 | QCOMPARE(client->windowType(), NET::Dock); | 607 | QCOMPARE(client->windowType(), NET::Dock); | ||
608 | QCOMPARE(client->geometry(), windowGeometry); | 608 | QCOMPARE(client->frameGeometry(), windowGeometry); | ||
609 | 609 | | |||
610 | // this should have affected the client area | 610 | // this should have affected the client area | ||
611 | // some props are independent of struts - those first | 611 | // some props are independent of struts - those first | ||
612 | // screen 0 | 612 | // screen 0 | ||
613 | QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024)); | 613 | QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
614 | QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024)); | 614 | QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
615 | QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024)); | 615 | QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
616 | QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024)); | 616 | QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024)); | ||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 664 | { | |||
713 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | 713 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | ||
714 | QVERIFY(windowCreatedSpy.isValid()); | 714 | QVERIFY(windowCreatedSpy.isValid()); | ||
715 | QVERIFY(windowCreatedSpy.wait()); | 715 | QVERIFY(windowCreatedSpy.wait()); | ||
716 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | 716 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | ||
717 | QVERIFY(client); | 717 | QVERIFY(client); | ||
718 | QCOMPARE(client->window(), w); | 718 | QCOMPARE(client->window(), w); | ||
719 | QVERIFY(!client->isDecorated()); | 719 | QVERIFY(!client->isDecorated()); | ||
720 | QCOMPARE(client->windowType(), NET::Dock); | 720 | QCOMPARE(client->windowType(), NET::Dock); | ||
721 | QCOMPARE(client->geometry(), windowGeometry); | 721 | QCOMPARE(client->frameGeometry(), windowGeometry); | ||
722 | 722 | | |||
723 | // now verify the actual updated client areas | 723 | // now verify the actual updated client areas | ||
724 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), geometries.at(0)); | 724 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), geometries.at(0)); | ||
725 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), geometries.at(0)); | 725 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), geometries.at(0)); | ||
726 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(554, 1080, 1366, 732)); | 726 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(554, 1080, 1366, 732)); | ||
727 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(554, 1080, 1366, 732)); | 727 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(554, 1080, 1366, 732)); | ||
728 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 1920, 1812)); | 728 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 1920, 1812)); | ||
729 | 729 | | |||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 742 | { | |||
793 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | 793 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | ||
794 | QVERIFY(windowCreatedSpy.isValid()); | 794 | QVERIFY(windowCreatedSpy.isValid()); | ||
795 | QVERIFY(windowCreatedSpy.wait()); | 795 | QVERIFY(windowCreatedSpy.wait()); | ||
796 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | 796 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | ||
797 | QVERIFY(client); | 797 | QVERIFY(client); | ||
798 | QCOMPARE(client->window(), w); | 798 | QCOMPARE(client->window(), w); | ||
799 | QVERIFY(!client->isDecorated()); | 799 | QVERIFY(!client->isDecorated()); | ||
800 | QCOMPARE(client->windowType(), NET::Dock); | 800 | QCOMPARE(client->windowType(), NET::Dock); | ||
801 | QCOMPARE(client->geometry(), windowGeometry); | 801 | QCOMPARE(client->frameGeometry(), windowGeometry); | ||
802 | 802 | | |||
803 | // now verify the actual updated client areas | 803 | // now verify the actual updated client areas | ||
804 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 306, 1366, 744)); | 804 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 306, 1366, 744)); | ||
805 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 306, 1366, 744)); | 805 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 306, 1366, 744)); | ||
806 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), geometries.at(1)); | 806 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), geometries.at(1)); | ||
807 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), geometries.at(1)); | 807 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), geometries.at(1)); | ||
808 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050)); | 808 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050)); | ||
809 | 809 | | |||
Show All 13 Lines | |||||
823 | xcb_icccm_set_wm_normal_hints(c.data(), w2, &hints2); | 823 | xcb_icccm_set_wm_normal_hints(c.data(), w2, &hints2); | ||
824 | xcb_map_window(c.data(), w2); | 824 | xcb_map_window(c.data(), w2); | ||
825 | xcb_flush(c.data()); | 825 | xcb_flush(c.data()); | ||
826 | QVERIFY(windowCreatedSpy.wait()); | 826 | QVERIFY(windowCreatedSpy.wait()); | ||
827 | X11Client *client2 = windowCreatedSpy.last().first().value<X11Client *>(); | 827 | X11Client *client2 = windowCreatedSpy.last().first().value<X11Client *>(); | ||
828 | QVERIFY(client2); | 828 | QVERIFY(client2); | ||
829 | QVERIFY(client2 != client); | 829 | QVERIFY(client2 != client); | ||
830 | QVERIFY(client2->isDecorated()); | 830 | QVERIFY(client2->isDecorated()); | ||
831 | QCOMPARE(client2->geometry(), QRect(0, 306, 1366, 744)); | 831 | QCOMPARE(client2->frameGeometry(), QRect(0, 306, 1366, 744)); | ||
832 | QCOMPARE(client2->maximizeMode(), KWin::MaximizeFull); | 832 | QCOMPARE(client2->maximizeMode(), KWin::MaximizeFull); | ||
833 | // destroy window again | 833 | // destroy window again | ||
834 | QSignalSpy normalWindowClosedSpy(client2, &X11Client::windowClosed); | 834 | QSignalSpy normalWindowClosedSpy(client2, &X11Client::windowClosed); | ||
835 | QVERIFY(normalWindowClosedSpy.isValid()); | 835 | QVERIFY(normalWindowClosedSpy.isValid()); | ||
836 | xcb_unmap_window(c.data(), w2); | 836 | xcb_unmap_window(c.data(), w2); | ||
837 | xcb_destroy_window(c.data(), w2); | 837 | xcb_destroy_window(c.data(), w2); | ||
838 | xcb_flush(c.data()); | 838 | xcb_flush(c.data()); | ||
839 | QVERIFY(normalWindowClosedSpy.wait()); | 839 | QVERIFY(normalWindowClosedSpy.wait()); | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 853 | { | |||
905 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | 905 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | ||
906 | QVERIFY(windowCreatedSpy.isValid()); | 906 | QVERIFY(windowCreatedSpy.isValid()); | ||
907 | QVERIFY(windowCreatedSpy.wait()); | 907 | QVERIFY(windowCreatedSpy.wait()); | ||
908 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | 908 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | ||
909 | QVERIFY(client); | 909 | QVERIFY(client); | ||
910 | QCOMPARE(client->window(), w); | 910 | QCOMPARE(client->window(), w); | ||
911 | QVERIFY(!client->isDecorated()); | 911 | QVERIFY(!client->isDecorated()); | ||
912 | QCOMPARE(client->windowType(), NET::Dock); | 912 | QCOMPARE(client->windowType(), NET::Dock); | ||
913 | QCOMPARE(client->geometry(), windowGeometry); | 913 | QCOMPARE(client->frameGeometry(), windowGeometry); | ||
914 | 914 | | |||
915 | // now verify the actual updated client areas | 915 | // now verify the actual updated client areas | ||
916 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 282, 1366, 768)); | 916 | QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 282, 1366, 768)); | ||
917 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 282, 1366, 768)); | 917 | QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 282, 1366, 768)); | ||
918 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1390, 0, 1656, 1050)); | 918 | QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1390, 0, 1656, 1050)); | ||
919 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1390, 0, 1656, 1050)); | 919 | QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1390, 0, 1656, 1050)); | ||
920 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050)); | 920 | QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050)); | ||
921 | QCOMPARE(workspace()->restrictedMoveArea(-1), QRegion(1366, 0, 24, 1050)); | 921 | QCOMPARE(workspace()->restrictedMoveArea(-1), QRegion(1366, 0, 24, 1050)); | ||
Show All 18 Lines | |||||
940 | QVERIFY(windowCreatedSpy.wait()); | 940 | QVERIFY(windowCreatedSpy.wait()); | ||
941 | X11Client *client2 = windowCreatedSpy.last().first().value<X11Client *>(); | 941 | X11Client *client2 = windowCreatedSpy.last().first().value<X11Client *>(); | ||
942 | QVERIFY(client2); | 942 | QVERIFY(client2); | ||
943 | QVERIFY(client2 != client); | 943 | QVERIFY(client2 != client); | ||
944 | QVERIFY(client2->isDecorated()); | 944 | QVERIFY(client2->isDecorated()); | ||
945 | QCOMPARE(client2->clientSize(), QSize(200, 300)); | 945 | QCOMPARE(client2->clientSize(), QSize(200, 300)); | ||
946 | QCOMPARE(client2->pos(), QPoint(1500, 400)); | 946 | QCOMPARE(client2->pos(), QPoint(1500, 400)); | ||
947 | 947 | | |||
948 | const QRect origGeo = client2->geometry(); | 948 | const QRect origGeo = client2->frameGeometry(); | ||
949 | Cursor::setPos(origGeo.center()); | 949 | Cursor::setPos(origGeo.center()); | ||
950 | workspace()->performWindowOperation(client2, Options::MoveOp); | 950 | workspace()->performWindowOperation(client2, Options::MoveOp); | ||
951 | QTRY_COMPARE(workspace()->moveResizeClient(), client2); | 951 | QTRY_COMPARE(workspace()->moveResizeClient(), client2); | ||
952 | QVERIFY(client2->isMove()); | 952 | QVERIFY(client2->isMove()); | ||
953 | // move to next screen - step is 8 pixel, so 800 pixel | 953 | // move to next screen - step is 8 pixel, so 800 pixel | ||
954 | for (int i = 0; i < 100; i++) { | 954 | for (int i = 0; i < 100; i++) { | ||
955 | client2->keyPressEvent(Qt::Key_Left); | 955 | client2->keyPressEvent(Qt::Key_Left); | ||
956 | QTest::qWait(50); | 956 | QTest::qWait(50); | ||
957 | } | 957 | } | ||
958 | client2->keyPressEvent(Qt::Key_Enter); | 958 | client2->keyPressEvent(Qt::Key_Enter); | ||
959 | QCOMPARE(client2->isMove(), false); | 959 | QCOMPARE(client2->isMove(), false); | ||
960 | QVERIFY(workspace()->moveResizeClient() == nullptr); | 960 | QVERIFY(workspace()->moveResizeClient() == nullptr); | ||
961 | QCOMPARE(client2->geometry(), QRect(origGeo.translated(-800, 0))); | 961 | QCOMPARE(client2->frameGeometry(), QRect(origGeo.translated(-800, 0))); | ||
962 | } | 962 | } | ||
963 | 963 | | |||
964 | } | 964 | } | ||
965 | 965 | | |||
966 | WAYLANDTEST_MAIN(KWin::StrutsTest) | 966 | WAYLANDTEST_MAIN(KWin::StrutsTest) | ||
967 | #include "struts_test.moc" | 967 | #include "struts_test.moc" |