autotests: Port away from deprecated clientArea() overloads
This commit is contained in:
parent
78b5330824
commit
5bbd21f682
2 changed files with 142 additions and 113 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "platform.h"
|
||||
#include "cursor.h"
|
||||
#include "screens.h"
|
||||
#include "virtualdesktops.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
#include <KWayland/Client/connection_thread.h>
|
||||
|
@ -267,12 +268,16 @@ void PlasmaSurfaceTest::testPanelTypeHasStrut()
|
|||
// now render and map the window
|
||||
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
|
||||
|
||||
// the panel is on the first output and the current desktop
|
||||
AbstractOutput *output = kwinApp()->platform()->enabledOutputs().constFirst();
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
|
||||
QVERIFY(c);
|
||||
QCOMPARE(c->windowType(), NET::Dock);
|
||||
QVERIFY(c->isDock());
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
|
||||
QTEST(c->hasStrut(), "expectedStrut");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, 0, 0), "expectedMaxArea");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, output, desktop), "expectedMaxArea");
|
||||
QTEST(c->layer(), "expectedLayer");
|
||||
}
|
||||
|
||||
|
@ -314,12 +319,16 @@ void PlasmaSurfaceTest::testPanelWindowsCanCover()
|
|||
// now render and map the window
|
||||
auto panel = Test::renderAndWaitForShown(surface.data(), panelGeometry.size(), Qt::blue);
|
||||
|
||||
// the panel is on the first output and the current desktop
|
||||
AbstractOutput *output = kwinApp()->platform()->enabledOutputs().constFirst();
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
|
||||
QVERIFY(panel);
|
||||
QCOMPARE(panel->windowType(), NET::Dock);
|
||||
QVERIFY(panel->isDock());
|
||||
QCOMPARE(panel->frameGeometry(), panelGeometry);
|
||||
QCOMPARE(panel->hasStrut(), false);
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 0), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, output, desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(panel->layer(), KWin::NormalLayer);
|
||||
|
||||
// create a Window
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
#include "kwin_wayland_test.h"
|
||||
#include "abstract_output.h"
|
||||
#include "platform.h"
|
||||
#include "x11client.h"
|
||||
#include "cursor.h"
|
||||
|
@ -135,26 +136,27 @@ void StrutsTest::testWaylandStruts()
|
|||
using namespace KWayland::Client;
|
||||
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
|
||||
// no, struts yet
|
||||
QVERIFY(waylandServer()->clients().isEmpty());
|
||||
// first screen
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
// second screen
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
// combined
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->restrictedMoveArea(desktop), QRegion());
|
||||
|
||||
QFETCH(QVector<QRect>, windowGeometries);
|
||||
|
@ -187,24 +189,24 @@ void StrutsTest::testWaylandStruts()
|
|||
|
||||
// some props are independent of struts - those first
|
||||
// screen 0
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
// screen 1
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
// combined
|
||||
QCOMPARE(workspace()->clientArea(FullArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
|
||||
// now verify the actual updated client areas
|
||||
QTEST(workspace()->clientArea(PlacementArea, 0, 1), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, 0, 1), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(PlacementArea, 1, 1), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, 1, 1), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(WorkArea, 0, 1), "workArea");
|
||||
QTEST(workspace()->clientArea(PlacementArea, outputs[0], desktop), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, outputs[0], desktop), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(PlacementArea, outputs[1], desktop), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, outputs[1], desktop), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(WorkArea, outputs[0], desktop), "workArea");
|
||||
QTEST(workspace()->restrictedMoveArea(desktop), "restrictedMoveArea");
|
||||
|
||||
// delete all surfaces
|
||||
|
@ -219,6 +221,9 @@ void StrutsTest::testWaylandStruts()
|
|||
|
||||
void StrutsTest::testMoveWaylandPanel()
|
||||
{
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
|
||||
// this test verifies that repositioning a Wayland panel updates the client area
|
||||
using namespace KWayland::Client;
|
||||
const QRect windowGeometry(0, 1000, 1280, 24);
|
||||
|
@ -241,28 +246,31 @@ void StrutsTest::testMoveWaylandPanel()
|
|||
QCOMPARE(c->frameGeometry(), windowGeometry);
|
||||
QVERIFY(c->isDock());
|
||||
QVERIFY(c->hasStrut());
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea,outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea,outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1000));
|
||||
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
plasmaSurface->setPosition(QPoint(1280, 1000));
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(c->frameGeometry(), QRect(1280, 1000, 1280, 24));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea,outputs[1], desktop), QRect(1280, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea,outputs[1], desktop), QRect(1280, 0, 1280, 1000));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1000));
|
||||
}
|
||||
|
||||
void StrutsTest::testWaylandMobilePanel()
|
||||
{
|
||||
using namespace KWayland::Client;
|
||||
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
|
||||
//First enable maxmizing policy
|
||||
KConfigGroup group = kwinApp()->config()->group("Windows");
|
||||
group.writeEntry("Placement", "Maximizing");
|
||||
|
@ -291,11 +299,11 @@ void StrutsTest::testWaylandMobilePanel()
|
|||
QVERIFY(c->isDock());
|
||||
QVERIFY(c->hasStrut());
|
||||
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 964));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 964));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 964));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 60, 1280, 964));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 60, 1280, 964));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 60, 2560, 964));
|
||||
|
||||
// create another bottom panel
|
||||
const QRect windowGeometry2(0, 874, 1280, 150);
|
||||
|
@ -320,11 +328,11 @@ void StrutsTest::testWaylandMobilePanel()
|
|||
QVERIFY(c1->isDock());
|
||||
QVERIFY(c1->hasStrut());
|
||||
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 60, 1280, 814));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 60, 1280, 814));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 60, 2560, 814));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 60, 1280, 814));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 60, 1280, 814));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 60, 2560, 814));
|
||||
|
||||
// Destroy test clients.
|
||||
shellSurface.reset();
|
||||
|
@ -540,25 +548,26 @@ void StrutsTest::testX11Struts()
|
|||
// this test verifies that struts are applied correctly for X11 windows
|
||||
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
|
||||
// no, struts yet
|
||||
// first screen
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
// second screen
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
// combined
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->restrictedMoveArea(desktop), QRegion());
|
||||
|
||||
// create an xcb window
|
||||
|
@ -624,24 +633,24 @@ void StrutsTest::testX11Struts()
|
|||
// this should have affected the client area
|
||||
// some props are independent of struts - those first
|
||||
// screen 0
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
// screen 1
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
// combined
|
||||
QCOMPARE(workspace()->clientArea(FullArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
|
||||
// now verify the actual updated client areas
|
||||
QTEST(workspace()->clientArea(PlacementArea, 0, 1), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, 0, 1), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(PlacementArea, 1, 1), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, 1, 1), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(WorkArea, 0, 1), "workArea");
|
||||
QTEST(workspace()->clientArea(PlacementArea, outputs[0], desktop), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, outputs[0], desktop), "screen0Maximized");
|
||||
QTEST(workspace()->clientArea(PlacementArea, outputs[1], desktop), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(MaximizeArea, outputs[1], desktop), "screen1Maximized");
|
||||
QTEST(workspace()->clientArea(WorkArea, outputs[0], desktop), "workArea");
|
||||
QTEST(workspace()->restrictedMoveArea(desktop), "restrictedMoveArea");
|
||||
|
||||
// and destroy the window again
|
||||
|
@ -655,22 +664,22 @@ void StrutsTest::testX11Struts()
|
|||
QVERIFY(windowClosedSpy.wait());
|
||||
|
||||
// now struts should be removed again
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 0, 1), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[0], desktop), QRect(0, 0, 1280, 1024));
|
||||
// second screen
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, 1, 1), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MovementArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeFullArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
QCOMPARE(workspace()->clientArea(ScreenArea, outputs[1], desktop), QRect(1280, 0, 1280, 1024));
|
||||
// combined
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, 0, 1), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->clientArea(FullArea, outputs[0], desktop), QRect(0, 0, 2560, 1024));
|
||||
QCOMPARE(workspace()->restrictedMoveArea(desktop), QRegion());
|
||||
}
|
||||
|
||||
|
@ -687,6 +696,9 @@ void StrutsTest::test363804()
|
|||
QCOMPARE(screens()->geometry(1), geometries.at(1));
|
||||
QCOMPARE(screens()->geometry(), QRect(0, 0, 1920, 1848));
|
||||
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
|
||||
// create an xcb window
|
||||
QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
|
||||
QVERIFY(!xcb_connection_has_error(c.data()));
|
||||
|
@ -735,11 +747,11 @@ void StrutsTest::test363804()
|
|||
QCOMPARE(client->frameGeometry(), windowGeometry);
|
||||
|
||||
// now verify the actual updated client areas
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), geometries.at(0));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), geometries.at(0));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(554, 1080, 1366, 732));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(554, 1080, 1366, 732));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 1920, 1812));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), geometries.at(0));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), geometries.at(0));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(554, 1080, 1366, 732));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(554, 1080, 1366, 732));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 1920, 1812));
|
||||
|
||||
// and destroy the window again
|
||||
xcb_unmap_window(c.data(), w);
|
||||
|
@ -763,10 +775,15 @@ void StrutsTest::testLeftScreenSmallerBottomAligned()
|
|||
Qt::DirectConnection,
|
||||
Q_ARG(int, 2),
|
||||
Q_ARG(QVector<QRect>, geometries));
|
||||
QCOMPARE(screens()->geometry(0), geometries.at(0));
|
||||
QCOMPARE(screens()->geometry(1), geometries.at(1));
|
||||
QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050));
|
||||
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
QCOMPARE(outputs[0]->geometry(), geometries.at(0));
|
||||
QCOMPARE(outputs[1]->geometry(), geometries.at(1));
|
||||
|
||||
// the test window will be on the current desktop
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
|
||||
// create the panel
|
||||
QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
|
||||
QVERIFY(!xcb_connection_has_error(c.data()));
|
||||
|
@ -815,11 +832,11 @@ void StrutsTest::testLeftScreenSmallerBottomAligned()
|
|||
QCOMPARE(client->frameGeometry(), windowGeometry);
|
||||
|
||||
// now verify the actual updated client areas
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 306, 1366, 744));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 306, 1366, 744));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), geometries.at(1));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), geometries.at(1));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 306, 1366, 744));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 306, 1366, 744));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), geometries.at(1));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), geometries.at(1));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 3046, 1050));
|
||||
|
||||
// now create a window which is larger than screen 0
|
||||
|
||||
|
@ -869,18 +886,21 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens()
|
|||
// when moving a window with decorations in a restricted way it should pass from one screen
|
||||
// to the other even if there is a panel in between.
|
||||
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
|
||||
// left screen must be smaller than right screen
|
||||
const QVector<QRect> geometries{QRect(0, 282, 1366, 768), QRect(1366, 0, 1680, 1050)};
|
||||
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs",
|
||||
Qt::DirectConnection,
|
||||
Q_ARG(int, 2),
|
||||
Q_ARG(QVector<QRect>, geometries));
|
||||
QCOMPARE(screens()->geometry(0), geometries.at(0));
|
||||
QCOMPARE(screens()->geometry(1), geometries.at(1));
|
||||
QCOMPARE(screens()->geometry(), QRect(0, 0, 3046, 1050));
|
||||
|
||||
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
|
||||
QCOMPARE(outputs[0]->geometry(), geometries.at(0));
|
||||
QCOMPARE(outputs[1]->geometry(), geometries.at(1));
|
||||
|
||||
// all windows will be placed on the current desktop
|
||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||
|
||||
// create the panel on the right screen, left edge
|
||||
QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
|
||||
QVERIFY(!xcb_connection_has_error(c.data()));
|
||||
|
@ -929,11 +949,11 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens()
|
|||
QCOMPARE(client->frameGeometry(), windowGeometry);
|
||||
|
||||
// now verify the actual updated client areas
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 282, 1366, 768));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 282, 1366, 768));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, 1, 1), QRect(1390, 0, 1656, 1050));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1390, 0, 1656, 1050));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 3046, 1050));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[0], desktop), QRect(0, 282, 1366, 768));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[0], desktop), QRect(0, 282, 1366, 768));
|
||||
QCOMPARE(workspace()->clientArea(PlacementArea, outputs[1], desktop), QRect(1390, 0, 1656, 1050));
|
||||
QCOMPARE(workspace()->clientArea(MaximizeArea, outputs[1], desktop), QRect(1390, 0, 1656, 1050));
|
||||
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 3046, 1050));
|
||||
QCOMPARE(workspace()->restrictedMoveArea(desktop), QRegion(1366, 0, 24, 1050));
|
||||
|
||||
// create another window and try to move it
|
||||
|
|
Loading…
Reference in a new issue