Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KWin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
43
Merge Requests
43
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
KWin
Commits
0d2a3417
Commit
0d2a3417
authored
Jan 21, 2018
by
Martin Flöser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[autotests/integration] Add test for broken quick tiling for xdg_shell
See also D9980. CCBUG: 388072
parent
498d40d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
autotests/integration/kwin_wayland_test.h
autotests/integration/kwin_wayland_test.h
+1
-0
autotests/integration/quick_tiling_test.cpp
autotests/integration/quick_tiling_test.cpp
+66
-0
No files found.
autotests/integration/kwin_wayland_test.h
View file @
0d2a3417
...
...
@@ -132,6 +132,7 @@ enum class ShellSurfaceType {
QObject
*
createShellSurface
(
ShellSurfaceType
type
,
KWayland
::
Client
::
Surface
*
surface
,
QObject
*
parent
=
nullptr
);
KWayland
::
Client
::
ShellSurface
*
createShellSurface
(
KWayland
::
Client
::
Surface
*
surface
,
QObject
*
parent
=
nullptr
);
KWayland
::
Client
::
XdgShellSurface
*
createXdgShellV5Surface
(
KWayland
::
Client
::
Surface
*
surface
,
QObject
*
parent
=
nullptr
);
KWayland
::
Client
::
XdgShellSurface
*
createXdgShellV6Surface
(
KWayland
::
Client
::
Surface
*
surface
,
QObject
*
parent
=
nullptr
);
/**
...
...
autotests/integration/quick_tiling_test.cpp
View file @
0d2a3417
...
...
@@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
#include <QDBusConnection>
#include <QDBusMessage>
...
...
@@ -67,6 +68,8 @@ private Q_SLOTS:
void
testQuickTilingKeyboardMove
();
void
testQuickTilingPointerMove_data
();
void
testQuickTilingPointerMove
();
void
testQuickTilingPointerMoveXdgShell_data
();
void
testQuickTilingPointerMoveXdgShell
();
void
testX11QuickTiling_data
();
void
testX11QuickTiling
();
void
testX11QuickTilingAfterVertMaximize_data
();
...
...
@@ -430,6 +433,69 @@ void QuickTilingTest::testQuickTilingPointerMove()
QCOMPARE
(
quickTileChangedSpy
.
count
(),
1
);
QTEST
(
c
->
quickTileMode
(),
"expectedMode"
);
QTRY_COMPARE
(
sizeChangeSpy
.
count
(),
1
);
}
void
QuickTilingTest
::
testQuickTilingPointerMoveXdgShell_data
()
{
QTest
::
addColumn
<
QPoint
>
(
"targetPos"
);
QTest
::
addColumn
<
QuickTileMode
>
(
"expectedMode"
);
QTest
::
newRow
(
"topRight"
)
<<
QPoint
(
2559
,
24
)
<<
QuickTileMode
(
QuickTileFlag
::
Top
|
QuickTileFlag
::
Right
);
QTest
::
newRow
(
"right"
)
<<
QPoint
(
2559
,
512
)
<<
QuickTileMode
(
QuickTileFlag
::
Right
);
QTest
::
newRow
(
"bottomRight"
)
<<
QPoint
(
2559
,
1023
)
<<
QuickTileMode
(
QuickTileFlag
::
Bottom
|
QuickTileFlag
::
Right
);
QTest
::
newRow
(
"bottomLeft"
)
<<
QPoint
(
0
,
1023
)
<<
QuickTileMode
(
QuickTileFlag
::
Bottom
|
QuickTileFlag
::
Left
);
QTest
::
newRow
(
"Left"
)
<<
QPoint
(
0
,
512
)
<<
QuickTileMode
(
QuickTileFlag
::
Left
);
QTest
::
newRow
(
"topLeft"
)
<<
QPoint
(
0
,
24
)
<<
QuickTileMode
(
QuickTileFlag
::
Top
|
QuickTileFlag
::
Left
);
}
void
QuickTilingTest
::
testQuickTilingPointerMoveXdgShell
()
{
using
namespace
KWayland
::
Client
;
QScopedPointer
<
Surface
>
surface
(
Test
::
createSurface
());
QVERIFY
(
!
surface
.
isNull
());
QScopedPointer
<
XdgShellSurface
>
shellSurface
(
Test
::
createXdgShellV6Surface
(
surface
.
data
()));
QVERIFY
(
!
shellSurface
.
isNull
());
QSignalSpy
configureRequestedSpy
(
shellSurface
.
data
(),
&
XdgShellSurface
::
configureRequested
);
QVERIFY
(
configureRequestedSpy
.
isValid
());
// let's render
auto
c
=
Test
::
renderAndWaitForShown
(
surface
.
data
(),
QSize
(
100
,
50
),
Qt
::
blue
);
QVERIFY
(
c
);
QCOMPARE
(
workspace
()
->
activeClient
(),
c
);
QCOMPARE
(
c
->
geometry
(),
QRect
(
0
,
0
,
100
,
50
));
QCOMPARE
(
c
->
quickTileMode
(),
QuickTileMode
(
QuickTileFlag
::
None
));
QCOMPARE
(
c
->
maximizeMode
(),
MaximizeRestore
);
QVERIFY
(
configureRequestedSpy
.
wait
());
QCOMPARE
(
configureRequestedSpy
.
count
(),
2
);
QSignalSpy
quickTileChangedSpy
(
c
,
&
AbstractClient
::
quickTileModeChanged
);
QVERIFY
(
quickTileChangedSpy
.
isValid
());
workspace
()
->
performWindowOperation
(
c
,
Options
::
UnrestrictedMoveOp
);
QCOMPARE
(
c
,
workspace
()
->
getMovingClient
());
QCOMPARE
(
Cursor
::
pos
(),
QPoint
(
49
,
24
));
QVERIFY
(
configureRequestedSpy
.
wait
());
QCOMPARE
(
configureRequestedSpy
.
count
(),
3
);
QFETCH
(
QPoint
,
targetPos
);
quint32
timestamp
=
1
;
kwinApp
()
->
platform
()
->
pointerMotion
(
targetPos
,
timestamp
++
);
kwinApp
()
->
platform
()
->
pointerButtonPressed
(
BTN_LEFT
,
timestamp
++
);
kwinApp
()
->
platform
()
->
pointerButtonReleased
(
BTN_LEFT
,
timestamp
++
);
QCOMPARE
(
Cursor
::
pos
(),
targetPos
);
QVERIFY
(
!
workspace
()
->
getMovingClient
());
QCOMPARE
(
quickTileChangedSpy
.
count
(),
1
);
QTEST
(
c
->
quickTileMode
(),
"expectedMode"
);
QVERIFY
(
configureRequestedSpy
.
wait
());
QEXPECT_FAIL
(
""
,
"BUG 388072"
,
Continue
);
QCOMPARE
(
configureRequestedSpy
.
count
(),
4
);
QEXPECT_FAIL
(
""
,
"BUG 388072"
,
Continue
);
QCOMPARE
(
false
,
configureRequestedSpy
.
last
().
first
().
toSize
().
isEmpty
());
}
struct
XcbConnectionDeleter
...
...
Write
Preview
Markdown
is supported
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