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
154a38ad
Commit
154a38ad
authored
Jan 20, 2021
by
David Edmundson
Browse files
Test fullscreen in conjuction with sendToScreen
parent
44713ac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
autotests/integration/placement_test.cpp
View file @
154a38ad
...
...
@@ -52,6 +52,7 @@ private Q_SLOTS:
void
testPlaceUnderMouse
();
void
testPlaceCascaded
();
void
testPlaceRandom
();
void
testFullscreen
();
private:
void
setPlacementPolicy
(
Placement
::
Policy
policy
);
...
...
@@ -345,5 +346,35 @@ void TestPlacement::testPlaceRandom()
QVERIFY
(
Test
::
waitForWindowDestroyed
(
client1
));
}
void
TestPlacement
::
testFullscreen
()
{
setPlacementPolicy
(
Placement
::
Smart
);
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdgShellStableSurface
(
surface
.
data
()));
AbstractClient
*
client
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
red
);
// auto-ack. XdgShell isn't being tested here, only the actual placement
connect
(
shellSurface
.
data
(),
&
XdgShellSurface
::
configureRequested
,
[
&
](
const
QSize
&
size
,
KWayland
::
Client
::
XdgShellSurface
::
States
,
quint32
serial
)
{
if
(
!
size
.
isEmpty
())
{
shellSurface
->
ackConfigure
(
serial
);
Test
::
render
(
surface
.
data
(),
size
,
Qt
::
red
);
}
});
QVERIFY
(
client
);
client
->
sendToScreen
(
0
);
QSignalSpy
geometryChangedSpy
(
client
,
&
Toplevel
::
frameGeometryChanged
);
client
->
setFullScreen
(
true
);
QVERIFY
(
geometryChangedSpy
.
wait
());
QCOMPARE
(
client
->
frameGeometry
(),
screens
()
->
geometry
(
0
));
// this doesn't require a round trip, so should be immediate
client
->
sendToScreen
(
1
);
QCOMPARE
(
client
->
frameGeometry
(),
screens
()
->
geometry
(
1
));
QCOMPARE
(
geometryChangedSpy
.
count
(),
2
);
}
WAYLANDTEST_MAIN
(
TestPlacement
)
#include "placement_test.moc"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment