Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
b491aeb9
Commit
b491aeb9
authored
Apr 22, 2022
by
Nils Fenner
Committed by
Vlad Zahorodnii
Apr 22, 2022
Browse files
Rename AbstractClient to Window
parent
2e7364dd
Pipeline
#166998
passed with stage
in 14 minutes and 7 seconds
Changes
212
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/integration/activation_test.cpp
View file @
b491aeb9
...
...
@@ -9,11 +9,11 @@
#include
"kwin_wayland_test.h"
#include
"abstract_client.h"
#include
"cursor.h"
#include
"output.h"
#include
"platform.h"
#include
"wayland_server.h"
#include
"window.h"
#include
"workspace.h"
#include
<KWayland/Client/surface.h>
...
...
@@ -46,7 +46,7 @@ private:
void
ActivationTest
::
initTestCase
()
{
qRegisterMetaType
<
AbstractClient
*>
();
qRegisterMetaType
<
Window
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
@@ -90,13 +90,13 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the left screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -106,13 +106,13 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the right screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -158,13 +158,13 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the left screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -174,13 +174,13 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the right screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -226,13 +226,13 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the top screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -242,13 +242,13 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the bottom screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -294,13 +294,13 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the top screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -310,13 +310,13 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the bottom screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -365,13 +365,13 @@ void ActivationTest::testSwitchToWindowMaximized()
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
QSignalSpy
toplevelConfigureRequestedSpy1
(
shellSurface1
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QSignalSpy
surfaceConfigureRequestedSpy1
(
shellSurface1
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QVERIFY
(
surfaceConfigureRequestedSpy1
.
wait
());
// Wait for the configure event with the activated state.
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
surfaceConfigureRequestedSpy1
.
wait
());
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
AbstractClient
::
frameGeometryChanged
);
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
Window
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy1
.
isValid
());
shellSurface1
->
xdgSurface
()
->
ack_configure
(
surfaceConfigureRequestedSpy1
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
toplevelConfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
...
...
@@ -381,19 +381,19 @@ void ActivationTest::testSwitchToWindowMaximized()
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
QSignalSpy
toplevelConfigureRequestedSpy2
(
shellSurface2
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QSignalSpy
surfaceConfigureRequestedSpy2
(
shellSurface2
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
QVERIFY
(
surfaceConfigureRequestedSpy2
.
wait
());
// Wait for the configure event with the activated state.
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
surfaceConfigureRequestedSpy2
.
wait
());
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
AbstractClient
::
frameGeometryChanged
);
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
Window
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy2
.
isValid
());
shellSurface2
->
xdgSurface
()
->
ack_configure
(
surfaceConfigureRequestedSpy2
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
toplevelConfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy2
.
wait
());
const
QList
<
AbstractClient
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
const
QList
<
Window
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
QVERIFY
(
stackingOrder
.
indexOf
(
client1
)
<
stackingOrder
.
indexOf
(
client2
));
QCOMPARE
(
client1
->
maximizeMode
(),
MaximizeFull
);
QCOMPARE
(
client2
->
maximizeMode
(),
MaximizeFull
);
...
...
@@ -401,13 +401,13 @@ void ActivationTest::testSwitchToWindowMaximized()
// Create several clients on the right screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -452,13 +452,13 @@ void ActivationTest::testSwitchToWindowFullScreen()
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdgToplevelSurface
(
surface1
.
data
()));
QSignalSpy
toplevelConfigureRequestedSpy1
(
shellSurface1
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QSignalSpy
surfaceConfigureRequestedSpy1
(
shellSurface1
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QVERIFY
(
surfaceConfigureRequestedSpy1
.
wait
());
// Wait for the configure event with the activated state.
workspace
()
->
slotWindowFullScreen
();
QVERIFY
(
surfaceConfigureRequestedSpy1
.
wait
());
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
AbstractClient
::
frameGeometryChanged
);
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
Window
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy1
.
isValid
());
shellSurface1
->
xdgSurface
()
->
ack_configure
(
surfaceConfigureRequestedSpy1
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
toplevelConfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
...
...
@@ -468,19 +468,19 @@ void ActivationTest::testSwitchToWindowFullScreen()
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdgToplevelSurface
(
surface2
.
data
()));
QSignalSpy
toplevelConfigureRequestedSpy2
(
shellSurface2
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QSignalSpy
surfaceConfigureRequestedSpy2
(
shellSurface2
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
QVERIFY
(
surfaceConfigureRequestedSpy2
.
wait
());
// Wait for the configure event with the activated state.
workspace
()
->
slotWindowFullScreen
();
QVERIFY
(
surfaceConfigureRequestedSpy2
.
wait
());
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
AbstractClient
::
frameGeometryChanged
);
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
Window
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy2
.
isValid
());
shellSurface2
->
xdgSurface
()
->
ack_configure
(
surfaceConfigureRequestedSpy2
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
toplevelConfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy2
.
wait
());
const
QList
<
AbstractClient
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
const
QList
<
Window
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
QVERIFY
(
stackingOrder
.
indexOf
(
client1
)
<
stackingOrder
.
indexOf
(
client2
));
QVERIFY
(
client1
->
isFullScreen
());
QVERIFY
(
client2
->
isFullScreen
());
...
...
@@ -488,13 +488,13 @@ void ActivationTest::testSwitchToWindowFullScreen()
// Create several clients on the bottom screen.
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdgToplevelSurface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
KWayland
::
Client
::
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdgToplevelSurface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
autotests/integration/activities_test.cpp
View file @
b491aeb9
...
...
@@ -46,7 +46,7 @@ private:
void
ActivitiesTest
::
initTestCase
()
{
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
qRegisterMetaType
<
KWin
::
Deleted
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
autotests/integration/buffer_size_change_test.cpp
View file @
b491aeb9
...
...
@@ -8,10 +8,10 @@
*/
#include
"generic_scene_opengl_test.h"
#include
"abstract_client.h"
#include
"composite.h"
#include
"scene.h"
#include
"wayland_server.h"
#include
"window.h"
#include
<KWayland/Client/subsurface.h>
#include
<KWayland/Client/surface.h>
...
...
@@ -53,7 +53,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
QVERIFY
(
!
shellSurface
.
isNull
());
// set buffer size
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client
);
// add a first repaint
...
...
@@ -65,7 +65,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
// now change buffer size
Test
::
render
(
surface
.
data
(),
QSize
(
30
,
10
),
Qt
::
red
);
QSignalSpy
damagedSpy
(
client
,
&
AbstractClient
::
damaged
);
QSignalSpy
damagedSpy
(
client
,
&
Window
::
damaged
);
QVERIFY
(
damagedSpy
.
isValid
());
QVERIFY
(
damagedSpy
.
wait
());
KWin
::
Compositor
::
self
()
->
scene
()
->
addRepaintFull
();
...
...
@@ -90,7 +90,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
// set buffer sizes
Test
::
render
(
surface
.
data
(),
QSize
(
30
,
10
),
Qt
::
red
);
AbstractClient
*
parent
=
Test
::
renderAndWaitForShown
(
parentSurface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
Window
*
parent
=
Test
::
renderAndWaitForShown
(
parentSurface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
parent
);
// add a first repaint
...
...
@@ -100,7 +100,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
QVERIFY
(
frameRenderedSpy
.
wait
());
// change buffer size of sub surface
QSignalSpy
damagedParentSpy
(
parent
,
&
AbstractClient
::
damaged
);
QSignalSpy
damagedParentSpy
(
parent
,
&
Window
::
damaged
);
QVERIFY
(
damagedParentSpy
.
isValid
());
Test
::
render
(
surface
.
data
(),
QSize
(
20
,
10
),
Qt
::
red
);
parentSurface
->
commit
(
KWayland
::
Client
::
Surface
::
CommitFlag
::
None
);
...
...
autotests/integration/dbus_interface_test.cpp
View file @
b491aeb9
...
...
@@ -10,13 +10,13 @@
#include
"kwin_wayland_test.h"
#include
"abstract_client.h"
#include
"atoms.h"
#include
"deleted.h"
#include
"platform.h"
#include
"rules.h"
#include
"virtualdesktops.h"
#include
"wayland_server.h"
#include
"window.h"
#include
"workspace.h"
#include
"x11client.h"
...
...
@@ -56,7 +56,7 @@ private Q_SLOTS:
void
TestDbusInterface
::
initTestCase
()
{
qRegisterMetaType
<
KWin
::
Deleted
*>
();
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
@@ -113,7 +113,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
Test
::
render
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
clientAddedSpy
.
isEmpty
());
QVERIFY
(
clientAddedSpy
.
wait
());
auto
client
=
clientAddedSpy
.
first
().
first
().
value
<
AbstractClient
*>
();
auto
client
=
clientAddedSpy
.
first
().
first
().
value
<
Window
*>
();
QVERIFY
(
client
);
const
QVariantMap
expectedData
=
{
...
...
@@ -209,7 +209,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
// finally close window
const
auto
id
=
client
->
internalId
();
QSignalSpy
windowClosedSpy
(
client
,
&
AbstractClient
::
windowClosed
);
QSignalSpy
windowClosedSpy
(
client
,
&
Window
::
windowClosed
);
QVERIFY
(
windowClosedSpy
.
isValid
());
shellSurface
.
reset
();
surface
.
reset
();
...
...
autotests/integration/debug_console_test.cpp
View file @
b491aeb9
...
...
@@ -8,13 +8,13 @@
*/
#include
"kwin_wayland_test.h"
#include
"abstract_client.h"
#include
"debug_console.h"
#include
"internal_client.h"
#include
"output.h"
#include
"platform.h"
#include
"utils/xcbutils.h"
#include
"wayland_server.h"
#include
"window.h"
#include
"workspace.h"
#include
<KWayland/Client/compositor.h>
...
...
@@ -47,7 +47,7 @@ private Q_SLOTS:
void
DebugConsoleTest
::
initTestCase
()
{
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
qRegisterMetaType
<
KWin
::
InternalClient
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
autotests/integration/decoration_input_test.cpp
View file @
b491aeb9
...
...
@@ -8,7 +8,6 @@
*/
#include
"kwin_wayland_test.h"
#include
"abstract_client.h"
#include
"cursor.h"
#include
"internal_client.h"
#include
"output.h"
...
...
@@ -17,6 +16,7 @@
#include
"screens.h"
#include
"touch_input.h"
#include
"wayland_server.h"
#include
"window.h"
#include
"workspace.h"
#include
<kwineffects.h>
...
...
@@ -72,7 +72,7 @@ private Q_SLOTS:
void
testTooltipDoesntEatKeyEvents
();
private:
AbstractClient
*
showWindow
();
Window
*
showWindow
();
};
#define MOTION(target) Test::pointerMotion(target, timestamp++)
...
...
@@ -81,7 +81,7 @@ private:
#define RELEASE Test::pointerButtonReleased(BTN_LEFT, timestamp++)
AbstractClient
*
DecorationInputTest
::
showWindow
()
Window
*
DecorationInputTest
::
showWindow
()
{
using
namespace
KWayland
::
Client
;
#define VERIFY(statement) \
...
...
@@ -120,7 +120,7 @@ AbstractClient *DecorationInputTest::showWindow()
void
DecorationInputTest
::
initTestCase
()
{
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
qRegisterMetaType
<
KWin
::
InternalClient
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
@@ -174,7 +174,7 @@ void DecorationInputTest::testAxis_data()
void
DecorationInputTest
::
testAxis
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -223,7 +223,7 @@ void DecorationInputTest::testDoubleClick_data()
void
KWin
::
DecorationInputTest
::
testDoubleClick
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -273,7 +273,7 @@ void DecorationInputTest::testDoubleTap_data()
void
KWin
::
DecorationInputTest
::
testDoubleTap
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -315,7 +315,7 @@ void KWin::DecorationInputTest::testDoubleTap()
void
DecorationInputTest
::
testHover
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -374,14 +374,14 @@ void DecorationInputTest::testPressToMove_data()
void
DecorationInputTest
::
testPressToMove
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
c
->
move
(
screens
()
->
geometry
(
0
).
center
()
-
QPoint
(
c
->
width
()
/
2
,
c
->
height
()
/
2
));
QSignalSpy
startMoveResizedSpy
(
c
,
&
AbstractClient
::
clientStartUserMovedResized
);
QSignalSpy
startMoveResizedSpy
(
c
,
&
Window
::
clientStartUserMovedResized
);
QVERIFY
(
startMoveResizedSpy
.
isValid
());
QSignalSpy
clientFinishUserMovedResizedSpy
(
c
,
&
AbstractClient
::
clientFinishUserMovedResized
);
QSignalSpy
clientFinishUserMovedResizedSpy
(
c
,
&
Window
::
clientFinishUserMovedResized
);
QVERIFY
(
clientFinishUserMovedResizedSpy
.
isValid
());
quint32
timestamp
=
1
;
...
...
@@ -433,14 +433,14 @@ void DecorationInputTest::testTapToMove_data()
void
DecorationInputTest
::
testTapToMove
()
{
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
c
->
move
(
screens
()
->
geometry
(
0
).
center
()
-
QPoint
(
c
->
width
()
/
2
,
c
->
height
()
/
2
));
QSignalSpy
startMoveResizedSpy
(
c
,
&
AbstractClient
::
clientStartUserMovedResized
);
QSignalSpy
startMoveResizedSpy
(
c
,
&
Window
::
clientStartUserMovedResized
);
QVERIFY
(
startMoveResizedSpy
.
isValid
());
QSignalSpy
clientFinishUserMovedResizedSpy
(
c
,
&
AbstractClient
::
clientFinishUserMovedResized
);
QSignalSpy
clientFinishUserMovedResizedSpy
(
c
,
&
Window
::
clientFinishUserMovedResized
);
QVERIFY
(
clientFinishUserMovedResizedSpy
.
isValid
());
quint32
timestamp
=
1
;
...
...
@@ -499,14 +499,14 @@ void DecorationInputTest::testResizeOutsideWindow()
workspace
()
->
slotReconfigure
();
// now create window
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
c
->
move
(
screens
()
->
geometry
(
0
).
center
()
-
QPoint
(
c
->
width
()
/
2
,
c
->
height
()
/
2
));
QVERIFY
(
c
->
frameGeometry
()
!=
c
->
inputGeometry
());
QVERIFY
(
c
->
inputGeometry
().
contains
(
c
->
frameGeometry
()));
QSignalSpy
startMoveResizedSpy
(
c
,
&
AbstractClient
::
clientStartUserMovedResized
);
QSignalSpy
startMoveResizedSpy
(
c
,
&
Window
::
clientStartUserMovedResized
);
QVERIFY
(
startMoveResizedSpy
.
isValid
());
// go to border
...
...
@@ -596,7 +596,7 @@ void DecorationInputTest::testModifierClickUnrestrictedMove()
QCOMPARE
(
options
->
commandAll3
(),
Options
::
MouseUnrestrictedMove
);
// create a window
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -658,7 +658,7 @@ void DecorationInputTest::testModifierScrollOpacity()
group
.
sync
();
workspace
()
->
slotReconfigure
();
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -717,7 +717,7 @@ void DecorationInputTest::testTouchEvents()
{
// this test verifies that the decoration gets a hover leave event on touch release
// see BUG 386231
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
@@ -766,7 +766,7 @@ void DecorationInputTest::testTooltipDoesntEatKeyEvents()
QSignalSpy
enteredSpy
(
keyboard
,
&
KWayland
::
Client
::
Keyboard
::
entered
);
QVERIFY
(
enteredSpy
.
isValid
());
AbstractClient
*
c
=
showWindow
();
Window
*
c
=
showWindow
();
QVERIFY
(
c
);
QVERIFY
(
c
->
isDecorated
());
QVERIFY
(
!
c
->
noBorder
());
...
...
autotests/integration/desktop_window_x11_test.cpp
View file @
b491aeb9
...
...
@@ -8,13 +8,13 @@
*/
#include
"kwin_wayland_test.h"
#include
"abstract_client.h"
#include
"cursor.h"
#include
"deleted.h"
#include
"output.h"
#include
"platform.h"
#include
"utils/xcbutils.h"
#include
"wayland_server.h"
#include
"window.h"
#include
"workspace.h"
#include
"x11client.h"
#include
<kwineffects.h>
...
...
@@ -41,7 +41,7 @@ private:
void
X11DesktopWindowTest
::
initTestCase
()
{
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
qRegisterMetaType
<
KWin
::
Deleted
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
...
...
autotests/integration/dont_crash_aurorae_destroy_deco.cpp
View file @
b491aeb9
...
...
@@ -41,7 +41,7 @@ private Q_SLOTS:
void
DontCrashAuroraeDestroyDecoTest
::
initTestCase
()
{
qputenv
(
"XDG_DATA_DIRS"
,
QCoreApplication
::
applicationDirPath
().
toUtf8
());
qRegisterMetaType
<
KWin
::
AbstractClient
*>
();
qRegisterMetaType
<
KWin
::
Window
*>
();
QSignalSpy
applicationStartedSpy
(
kwinApp
(),
&
Application
::
started
);
QVERIFY
(
applicationStartedSpy
.
isValid
());
kwinApp
()
->
platform
()
->
setInitialWindowSize
(
QSize
(
1280
,
1024
));
...
...
@@ -117,7 +117,7 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
QVERIFY
(
client
->
readyForPainting
());
// simulate click on maximize button
QSignalSpy
maximizedStateChangedSpy
(
client
,
static_cast
<
void
(
AbstractClient
::*
)(
KWin
::
AbstractClient
*
,
MaximizeMode
)
>
(
&
AbstractClient
::
clientMaximizedStateChanged
));
QSignalSpy
maximizedStateChangedSpy
(
client
,
static_cast
<
void
(
Window
::*
)(
KWin
::
Window
*
,
MaximizeMode
)
>
(
&
Window
::
clientMaximizedStateChanged
));
QVERIFY
(
maximizedStateChangedSpy
.
isValid
());
quint32
timestamp
=
1
;
Test
::
pointerMotion
(
client
->
frameGeometry
().
topLeft
()
+
scenePoint
.
toPoint