Skip to content
GitLab
Menu
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
282e0d1c
Commit
282e0d1c
authored
May 11, 2021
by
Vlad Zahorodnii
Browse files
autotests: Port the tests to new xdg-shell helpers
parent
4e7c6b57
Changes
52
Hide whitespace changes
Inline
Side-by-side
autotests/integration/CMakeLists.txt
View file @
282e0d1c
...
...
@@ -23,6 +23,10 @@ ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
PROTOCOL
${
WaylandProtocols_DATADIR
}
/stable/xdg-shell/xdg-shell.xml
BASENAME xdg-shell
)
ecm_add_qtwayland_client_protocol
(
KWinIntegrationTestFramework_SOURCES
PROTOCOL
${
WaylandProtocols_DATADIR
}
/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
BASENAME xdg-decoration-unstable-v1
)
add_library
(
KWinIntegrationTestFramework STATIC
${
KWinIntegrationTestFramework_SOURCES
}
)
target_link_libraries
(
KWinIntegrationTestFramework
Qt::Test
...
...
autotests/integration/activation_test.cpp
View file @
282e0d1c
...
...
@@ -88,13 +88,13 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the left screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -104,13 +104,13 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the right screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -156,13 +156,13 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the left screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -172,13 +172,13 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the right screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -224,13 +224,13 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the top screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -240,13 +240,13 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the bottom screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -292,13 +292,13 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the top screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
...
...
@@ -308,13 +308,13 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the bottom screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -361,33 +361,37 @@ void ActivationTest::testSwitchToWindowMaximized()
// Create several maximized clients on the left screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QSignalSpy
configureRequestedSpy1
(
shellSurface1
.
data
(),
&
XdgShellSurface
::
configureRequested
);
QVERIFY
(
configureRequestedSpy1
.
wait
());
QSignalSpy
toplevelConfigureRequestedSpy1
(
shellSurface1
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QVERIFY
(
toplevelConfigureRequestedSpy1
.
isValid
());
QSignalSpy
surfaceConfigureRequestedSpy1
(
shellSurface1
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
QVERIFY
(
surfaceConfigureRequestedSpy1
.
isValid
());
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
c
onfigureRequestedSpy1
.
wait
());
QVERIFY
(
surfaceC
onfigureRequestedSpy1
.
wait
());
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
AbstractClient
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy1
.
isValid
());
shellSurface1
->
ack
C
onfigure
(
c
onfigureRequestedSpy1
.
last
().
at
(
2
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
c
onfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
shellSurface1
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy1
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
toplevelC
onfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy1
.
wait
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
QSignalSpy
configureRequestedSpy2
(
shellSurface2
.
data
(),
&
XdgShellSurface
::
configureRequested
);
QVERIFY
(
configureRequestedSpy2
.
wait
());
QSignalSpy
toplevelConfigureRequestedSpy2
(
shellSurface2
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QVERIFY
(
toplevelConfigureRequestedSpy2
.
wait
());
QSignalSpy
surfaceConfigureRequestedSpy2
(
shellSurface2
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
QVERIFY
(
surfaceConfigureRequestedSpy2
.
isValid
());
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
c
onfigureRequestedSpy2
.
wait
());
QVERIFY
(
surfaceC
onfigureRequestedSpy2
.
wait
());
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
AbstractClient
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy2
.
isValid
());
shellSurface2
->
ack
C
onfigure
(
c
onfigureRequestedSpy2
.
last
().
at
(
2
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
c
onfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
shellSurface2
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy2
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
toplevelC
onfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy2
.
wait
());
const
QList
<
Toplevel
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
...
...
@@ -397,13 +401,13 @@ void ActivationTest::testSwitchToWindowMaximized()
// Create several clients on the right screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
@@ -446,33 +450,37 @@ void ActivationTest::testSwitchToWindowFullScreen()
// Create several maximized clients on the top screen.
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
AbstractClient
*
client1
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client1
);
QVERIFY
(
client1
->
isActive
());
QSignalSpy
configureRequestedSpy1
(
shellSurface1
.
data
(),
&
XdgShellSurface
::
configureRequested
);
QVERIFY
(
configureRequestedSpy1
.
wait
());
QSignalSpy
toplevelConfigureRequestedSpy1
(
shellSurface1
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QVERIFY
(
toplevelConfigureRequestedSpy1
.
isValid
());
QSignalSpy
surfaceConfigureRequestedSpy1
(
shellSurface1
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
QVERIFY
(
surfaceConfigureRequestedSpy1
.
isValid
());
workspace
()
->
slotWindowFullScreen
();
QVERIFY
(
c
onfigureRequestedSpy1
.
wait
());
QVERIFY
(
surfaceC
onfigureRequestedSpy1
.
wait
());
QSignalSpy
frameGeometryChangedSpy1
(
client1
,
&
AbstractClient
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy1
.
isValid
());
shellSurface1
->
ack
C
onfigure
(
c
onfigureRequestedSpy1
.
last
().
at
(
2
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
c
onfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
shellSurface1
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy1
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface1
.
data
(),
toplevelC
onfigureRequestedSpy1
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy1
.
wait
());
QScopedPointer
<
Surface
>
surface2
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface2
(
Test
::
createXdg
ShellStable
Surface
(
surface2
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface2
(
Test
::
createXdg
Toplevel
Surface
(
surface2
.
data
()));
AbstractClient
*
client2
=
Test
::
renderAndWaitForShown
(
surface2
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client2
);
QVERIFY
(
client2
->
isActive
());
QSignalSpy
configureRequestedSpy2
(
shellSurface2
.
data
(),
&
XdgShellSurface
::
configureRequested
);
QVERIFY
(
configureRequestedSpy2
.
wait
());
QSignalSpy
toplevelConfigureRequestedSpy2
(
shellSurface2
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QVERIFY
(
toplevelConfigureRequestedSpy2
.
wait
());
QSignalSpy
surfaceConfigureRequestedSpy2
(
shellSurface2
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
QVERIFY
(
surfaceConfigureRequestedSpy2
.
isValid
());
workspace
()
->
slotWindowFullScreen
();
QVERIFY
(
c
onfigureRequestedSpy2
.
wait
());
QVERIFY
(
surfaceC
onfigureRequestedSpy2
.
wait
());
QSignalSpy
frameGeometryChangedSpy2
(
client2
,
&
AbstractClient
::
frameGeometryChanged
);
QVERIFY
(
frameGeometryChangedSpy2
.
isValid
());
shellSurface2
->
ack
C
onfigure
(
c
onfigureRequestedSpy2
.
last
().
at
(
2
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
c
onfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
shellSurface2
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy2
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface2
.
data
(),
toplevelC
onfigureRequestedSpy2
.
last
().
at
(
0
).
toSize
(),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy2
.
wait
());
const
QList
<
Toplevel
*>
stackingOrder
=
workspace
()
->
stackingOrder
();
...
...
@@ -482,13 +490,13 @@ void ActivationTest::testSwitchToWindowFullScreen()
// Create several clients on the bottom screen.
QScopedPointer
<
Surface
>
surface3
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface3
(
Test
::
createXdg
ShellStable
Surface
(
surface3
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface3
(
Test
::
createXdg
Toplevel
Surface
(
surface3
.
data
()));
AbstractClient
*
client3
=
Test
::
renderAndWaitForShown
(
surface3
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client3
);
QVERIFY
(
client3
->
isActive
());
QScopedPointer
<
Surface
>
surface4
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface4
(
Test
::
createXdg
ShellStable
Surface
(
surface4
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface4
(
Test
::
createXdg
Toplevel
Surface
(
surface4
.
data
()));
AbstractClient
*
client4
=
Test
::
renderAndWaitForShown
(
surface4
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client4
);
QVERIFY
(
client4
->
isActive
());
...
...
autotests/integration/buffer_size_change_test.cpp
View file @
282e0d1c
...
...
@@ -13,7 +13,6 @@
#include "scene.h"
#include "wayland_server.h"
#include <KWayland/Client/xdgshell.h>
#include <KWayland/Client/subsurface.h>
#include <KWayland/Client/surface.h>
...
...
@@ -47,7 +46,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
// set buffer size
...
...
@@ -77,7 +76,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
// setup parent surface
QScopedPointer
<
Surface
>
parentSurface
(
Test
::
createSurface
());
QVERIFY
(
!
parentSurface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
parentSurface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
parentSurface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
// setup sub surface
...
...
autotests/integration/dbus_interface_test.cpp
View file @
282e0d1c
...
...
@@ -102,9 +102,9 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
QVERIFY
(
clientAddedSpy
.
isValid
());
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
shellSurface
->
set
AppId
(
QByteArray
Literal
(
"org.kde.foo"
));
shellSurface
->
set
T
itle
(
QStringLiteral
(
"Test window"
));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
shellSurface
->
set
_app_id
(
QString
Literal
(
"org.kde.foo"
));
shellSurface
->
set
_t
itle
(
QStringLiteral
(
"Test window"
));
// now let's render
Test
::
render
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
...
...
autotests/integration/debug_console_test.cpp
View file @
282e0d1c
...
...
@@ -310,7 +310,7 @@ void DebugConsoleTest::testWaylandClient()
using
namespace
KWayland
::
Client
;
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
surface
->
isValid
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
Test
::
render
(
surface
.
data
(),
QSize
(
10
,
10
),
Qt
::
red
);
...
...
autotests/integration/decoration_input_test.cpp
View file @
282e0d1c
...
...
@@ -96,7 +96,7 @@ AbstractClient *DecorationInputTest::showWindow()
Surface
*
surface
=
Test
::
createSurface
(
Test
::
waylandCompositor
());
VERIFY
(
surface
);
XdgShellSurface
*
shellSurface
=
Test
::
createXdg
ShellStable
Surface
(
surface
,
surface
);
Test
::
XdgToplevel
*
shellSurface
=
Test
::
createXdg
Toplevel
Surface
(
surface
,
surface
);
VERIFY
(
shellSurface
);
auto
deco
=
Test
::
waylandServerSideDecoration
()
->
create
(
surface
,
surface
);
QSignalSpy
decoSpy
(
deco
,
&
ServerSideDecoration
::
modeChanged
);
...
...
autotests/integration/dont_crash_cancel_animation.cpp
View file @
282e0d1c
...
...
@@ -85,7 +85,7 @@ void DontCrashCancelAnimationFromAnimationEndedTest::testScript()
// create a window
Surface
*
surface
=
Test
::
createSurface
(
Test
::
waylandCompositor
());
QVERIFY
(
surface
);
XdgShellSurface
*
shellSurface
=
Test
::
createXdg
ShellStable
Surface
(
surface
,
surface
);
Test
::
XdgToplevel
*
shellSurface
=
Test
::
createXdg
Toplevel
Surface
(
surface
,
surface
);
QVERIFY
(
shellSurface
);
// let's render
auto
c
=
Test
::
renderAndWaitForShown
(
surface
,
QSize
(
100
,
50
),
Qt
::
blue
);
...
...
autotests/integration/dont_crash_cursor_physical_size_empty.cpp
View file @
282e0d1c
...
...
@@ -81,7 +81,7 @@ void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco()
// see BUG: 390314
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
Test
::
waylandServerSideDecoration
()
->
create
(
surface
.
data
(),
surface
.
data
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
auto
c
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
c
);
...
...
autotests/integration/dont_crash_no_border.cpp
View file @
282e0d1c
...
...
@@ -90,7 +90,7 @@ void DontCrashNoBorder::testCreateWindow()
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
shellSurface
);
QScopedPointer
<
ServerSideDecoration
>
deco
(
Test
::
waylandServerSideDecoration
()
->
create
(
surface
.
data
()));
QSignalSpy
decoSpy
(
deco
.
data
(),
&
ServerSideDecoration
::
modeChanged
);
...
...
autotests/integration/dont_crash_reinitialize_compositor.cpp
View file @
282e0d1c
...
...
@@ -22,7 +22,6 @@
#include "effect_builtins.h"
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
namespace
KWin
{
...
...
@@ -119,7 +118,7 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client
);
...
...
autotests/integration/dont_crash_useractions_menu.cpp
View file @
282e0d1c
...
...
@@ -80,7 +80,7 @@ void TestDontCrashUseractionsMenu::testShowHideShowUseractionsMenu()
{
// this test creates the condition of BUG 382063
QScopedPointer
<
Surface
>
surface1
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface1
(
Test
::
createXdg
ShellStable
Surface
(
surface1
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface1
(
Test
::
createXdg
Toplevel
Surface
(
surface1
.
data
()));
auto
client
=
Test
::
renderAndWaitForShown
(
surface1
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client
);
...
...
autotests/integration/effects/desktop_switching_animation_test.cpp
View file @
282e0d1c
...
...
@@ -21,7 +21,6 @@
#include "effect_builtins.h"
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
using
namespace
KWin
;
...
...
@@ -113,7 +112,7 @@ void DesktopSwitchingAnimationTest::testSwitchDesktops()
using
namespace
KWayland
::
Client
;
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client
);
...
...
autotests/integration/effects/maximize_animation_test.cpp
View file @
282e0d1c
...
...
@@ -21,7 +21,6 @@
#include "effect_builtins.h"
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
using
namespace
KWin
;
...
...
@@ -92,35 +91,35 @@ void MaximizeAnimationTest::testMaximizeRestore()
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
(),
nullptr
,
Test
::
CreationSetup
::
CreateOnly
));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
(),
nullptr
,
Test
::
CreationSetup
::
CreateOnly
));
// Wait for the initial configure event.
XdgShellSurface
::
States
states
;
QSignalSpy
configureRequestedSpy
(
shellSurface
.
data
(),
&
XdgShellSurface
::
configureRequested
);
Test
::
XdgToplevel
::
States
states
;
QSignalSpy
toplevelConfigureRequestedSpy
(
shellSurface
.
data
(),
&
Test
::
XdgToplevel
::
configureRequested
);
QSignalSpy
surfaceConfigureRequestedSpy
(
shellSurface
->
xdgSurface
(),
&
Test
::
XdgSurface
::
configureRequested
);
surface
->
commit
(
Surface
::
CommitFlag
::
None
);
QVERIFY
(
configureRequestedSpy
.
isValid
());
QVERIFY
(
configureRequestedSpy
.
wait
());
QCOMPARE
(
configureRequestedSpy
.
count
(),
1
);
QCOMPARE
(
configureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
0
,
0
));
states
=
configureRequestedSpy
.
last
().
at
(
1
).
value
<
XdgShellSurface
::
States
>
();
QVERIFY
(
!
states
.
testFlag
(
XdgShellSurface
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
XdgShellSurface
::
State
::
Maximized
));
QVERIFY
(
surfaceConfigureRequestedSpy
.
wait
());
QCOMPARE
(
surfaceConfigureRequestedSpy
.
count
(),
1
);
QCOMPARE
(
toplevelConfigureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
0
,
0
));
states
=
toplevelConfigureRequestedSpy
.
last
().
at
(
1
).
value
<
Test
::
XdgToplevel
::
States
>
();
QVERIFY
(
!
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Maximized
));
// Draw contents of the surface.
shellSurface
->
ack
C
onfigure
(
c
onfigureRequestedSpy
.
last
().
at
(
2
).
value
<
quint32
>
());
shellSurface
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
quint32
>
());
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
client
);
QVERIFY
(
client
->
isActive
());
QCOMPARE
(
client
->
maximizeMode
(),
MaximizeMode
::
MaximizeRestore
);
// We should receive a configure event when the client becomes active.
QVERIFY
(
c
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
c
onfigureRequestedSpy
.
count
(),
2
);
states
=
c
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
XdgShellSurface
::
States
>
();
QVERIFY
(
states
.
testFlag
(
XdgShellSurface
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
XdgShellSurface
::
State
::
Maximized
));
QVERIFY
(
surfaceC
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
surfaceC
onfigureRequestedSpy
.
count
(),
2
);
states
=
toplevelC
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
Test
::
XdgToplevel
::
States
>
();
QVERIFY
(
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Maximized
));
// Load effect that will be tested.
const
QString
effectName
=
QStringLiteral
(
"kwin4_effect_maximize"
);
...
...
@@ -140,15 +139,15 @@ void MaximizeAnimationTest::testMaximizeRestore()
QVERIFY
(
maximizeChangedSpy
.
isValid
());
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
c
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
c
onfigureRequestedSpy
.
count
(),
3
);
QCOMPARE
(
c
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
1280
,
1024
));
states
=
c
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
XdgShellSurface
::
States
>
();
QVERIFY
(
states
.
testFlag
(
XdgShellSurface
::
State
::
Activated
));
QVERIFY
(
states
.
testFlag
(
XdgShellSurface
::
State
::
Maximized
));
QVERIFY
(
surfaceC
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
surfaceC
onfigureRequestedSpy
.
count
(),
3
);
QCOMPARE
(
toplevelC
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
1280
,
1024
));
states
=
toplevelC
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
Test
::
XdgToplevel
::
States
>
();
QVERIFY
(
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Activated
));
QVERIFY
(
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Maximized
));
// Draw contents of the maximized client.
shellSurface
->
ack
C
onfigure
(
c
onfigureRequestedSpy
.
last
().
at
(
2
).
value
<
quint32
>
());
shellSurface
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface
.
data
(),
QSize
(
1280
,
1024
),
Qt
::
red
);
QVERIFY
(
frameGeometryChangedSpy
.
wait
());
QCOMPARE
(
frameGeometryChangedSpy
.
count
(),
1
);
...
...
@@ -161,15 +160,15 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Restore the client.
workspace
()
->
slotWindowMaximize
();
QVERIFY
(
c
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
c
onfigureRequestedSpy
.
count
(),
4
);
QCOMPARE
(
c
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
100
,
50
));
states
=
c
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
XdgShellSurface
::
States
>
();
QVERIFY
(
states
.
testFlag
(
XdgShellSurface
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
XdgShellSurface
::
State
::
Maximized
));
QVERIFY
(
surfaceC
onfigureRequestedSpy
.
wait
());
QCOMPARE
(
surfaceC
onfigureRequestedSpy
.
count
(),
4
);
QCOMPARE
(
toplevelC
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
QSize
>
(),
QSize
(
100
,
50
));
states
=
toplevelC
onfigureRequestedSpy
.
last
().
at
(
1
).
value
<
Test
::
XdgToplevel
::
States
>
();
QVERIFY
(
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Activated
));
QVERIFY
(
!
states
.
testFlag
(
Test
::
XdgToplevel
::
State
::
Maximized
));
// Draw contents of the restored client.
shellSurface
->
ack
C
onfigure
(
c
onfigureRequestedSpy
.
last
().
at
(
2
).
value
<
quint32
>
());
shellSurface
->
xdgSurface
()
->
ack
_c
onfigure
(
surfaceC
onfigureRequestedSpy
.
last
().
at
(
0
).
value
<
quint32
>
());
Test
::
render
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
frameGeometryChangedSpy
.
wait
());
QCOMPARE
(
frameGeometryChangedSpy
.
count
(),
2
);
...
...
autotests/integration/effects/minimize_animation_test.cpp
View file @
282e0d1c
...
...
@@ -23,7 +23,6 @@
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/plasmawindowmanagement.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
using
namespace
KWin
;
...
...
@@ -114,7 +113,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
const
QRect
panelRect
=
QRect
(
0
,
0
,
1280
,
36
);
QScopedPointer
<
Surface
>
panelSurface
(
Test
::
createSurface
());
QVERIFY
(
!
panelSurface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
panelShellSurface
(
Test
::
createXdg
ShellStable
Surface
(
panelSurface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
panelShellSurface
(
Test
::
createXdg
Toplevel
Surface
(
panelSurface
.
data
()));
QVERIFY
(
!
panelShellSurface
.
isNull
());
QScopedPointer
<
PlasmaShellSurface
>
plasmaPanelShellSurface
(
Test
::
waylandPlasmaShell
()
->
createSurface
(
panelSurface
.
data
()));
QVERIFY
(
!
plasmaPanelShellSurface
.
isNull
());
...
...
@@ -131,7 +130,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
// Create the test client.
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdg
ShellStable
Surface
(
surface
.
data
()));
QScopedPointer
<
Test
::
XdgToplevel
>
shellSurface
(
Test
::
createXdg
Toplevel
Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
red
);
QVERIFY
(
client
);
...
...
autotests/integration/effects/popup_open_close_animation_test.cpp
View file @
282e0d1c
...
...
@@ -24,8 +24,6 @@
#include "effect_builtins.h"
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgdecoration.h>
#include <KWayland/Client/xdgshell.h>
#include <linux/input.h>
...
...
@@ -78,7 +76,7 @@ void PopupOpenCloseAnimationTest::initTestCase()
void
PopupOpenCloseAnimationTest
::
init
()
{
QVERIFY
(
Test
::
setupWaylandConnection
(
Test
::
AdditionalWaylandInterface
::
XdgDecoration
));
QVERIFY
(
Test
::
setupWaylandConnection
(
Test
::
AdditionalWaylandInterface
::
XdgDecoration
V1
));
}
void
PopupOpenCloseAnimationTest
::
cleanup
()
...
...
@@ -104,7 +102,7 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()