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
KWayland Server
Commits
8e86b7a1
Commit
8e86b7a1
authored
Nov 01, 2020
by
David Edmundson
Browse files
Port PlasmaShellSurface to the new approach
This gets rid of some boiler plate and simplifies some code.
parent
d70552f6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
autotests/client/test_error.cpp
View file @
8e86b7a1
...
...
@@ -56,7 +56,6 @@ void ErrorTest::init()
m_display
->
createShm
();
m_ci
=
m_display
->
createCompositor
(
m_display
);
m_psi
=
m_display
->
createPlasmaShell
(
m_display
);
m_psi
->
create
();
// setup connection
m_connection
=
new
KWayland
::
Client
::
ConnectionThread
;
...
...
autotests/client/test_plasmashell.cpp
View file @
8e86b7a1
...
...
@@ -68,7 +68,6 @@ void TestPlasmaShell::init()
m_display
->
createShm
();
m_plasmaShellInterface
=
m_display
->
createPlasmaShell
(
m_display
);
m_plasmaShellInterface
->
create
();
// setup connection
m_connection
=
new
KWayland
::
Client
::
ConnectionThread
;
...
...
@@ -181,9 +180,6 @@ void TestPlasmaShell::testRole()
QVERIFY
(
sps
);
QVERIFY
(
sps
->
surface
());
QCOMPARE
(
sps
->
surface
(),
surfaceCreatedSpy
.
first
().
first
().
value
<
SurfaceInterface
*>
());
QCOMPARE
(
sps
->
shell
(),
m_plasmaShellInterface
);
QCOMPARE
(
PlasmaShellSurfaceInterface
::
get
(
sps
->
resource
()),
sps
);
QVERIFY
(
!
PlasmaShellSurfaceInterface
::
get
(
nullptr
));
// default role should be normal
QCOMPARE
(
sps
->
role
(),
PlasmaShellSurfaceInterface
::
Role
::
Normal
);
...
...
@@ -465,16 +461,12 @@ void TestPlasmaShell::testDisconnect()
QVERIFY
(
sps
);
// disconnect
QSignalSpy
clientDisconnectedSpy
(
sps
->
client
(),
&
ClientConnection
::
disconnected
);
QVERIFY
(
clientDisconnectedSpy
.
isValid
());
QSignalSpy
surfaceDestroyedSpy
(
sps
,
&
QObject
::
destroyed
);
QVERIFY
(
surfaceDestroyedSpy
.
isValid
());
if
(
m_connection
)
{
m_connection
->
deleteLater
();
m_connection
=
nullptr
;
}
QVERIFY
(
clientDisconnectedSpy
.
wait
());
QCOMPARE
(
clientDisconnectedSpy
.
count
(),
1
);
QCOMPARE
(
surfaceDestroyedSpy
.
count
(),
0
);
QVERIFY
(
surfaceDestroyedSpy
.
wait
());
QCOMPARE
(
surfaceDestroyedSpy
.
count
(),
1
);
...
...
src/server/CMakeLists.txt
View file @
8e86b7a1
...
...
@@ -90,7 +90,7 @@ ecm_add_wayland_server_protocol(SERVER_LIB_SRCS
BASENAME org_kde_kwin_outputdevice
)
ecm_add_wayland_server_protocol
(
SERVER_LIB_SRCS
ecm_add_
qt
wayland_server_protocol
(
SERVER_LIB_SRCS
PROTOCOL
${
PLASMA_WAYLAND_PROTOCOLS_DIR
}
/plasma-shell.xml
BASENAME plasma-shell
)
...
...
src/server/plasmashell_interface.cpp
View file @
8e86b7a1
This diff is collapsed.
Click to expand it.
src/server/plasmashell_interface.h
View file @
8e86b7a1
/*
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
...
...
@@ -10,9 +11,6 @@
#include
<KWaylandServer/kwaylandserver_export.h>
#include
"global.h"
#include
"resource.h"
class
QSize
;
struct
wl_resource
;
...
...
@@ -23,6 +21,9 @@ class Display;
class
SurfaceInterface
;
class
PlasmaShellSurfaceInterface
;
class
PlasmaShellInterfacePrivate
;
class
PlasmaShellSurfaceInterfacePrivate
;
/**
* @brief Global for the org_kde_plasma_shell interface.
*
...
...
@@ -35,7 +36,7 @@ class PlasmaShellSurfaceInterface;
*
* @since 5.4
**/
class
KWAYLANDSERVER_EXPORT
PlasmaShellInterface
:
public
Global
class
KWAYLANDSERVER_EXPORT
PlasmaShellInterface
:
public
QObject
{
Q_OBJECT
public:
...
...
@@ -50,7 +51,7 @@ Q_SIGNALS:
private:
friend
class
Display
;
explicit
PlasmaShellInterface
(
Display
*
display
,
QObject
*
parent
);
class
Private
;
QScopedPointer
<
PlasmaShellInterface
Private
>
d
;
};
/**
...
...
@@ -60,7 +61,7 @@ private:
*
* @since 5.4
**/
class
KWAYLANDSERVER_EXPORT
PlasmaShellSurfaceInterface
:
public
Resource
class
KWAYLANDSERVER_EXPORT
PlasmaShellSurfaceInterface
:
public
QObject
{
Q_OBJECT
public:
...
...
@@ -70,11 +71,6 @@ public:
* @returns the SurfaceInterface this PlasmaShellSurfaceInterface got created for
**/
SurfaceInterface
*
surface
()
const
;
/**
* @returns The PlasmaShellInterface which created this PlasmaShellSurfaceInterface.
**/
PlasmaShellInterface
*
shell
()
const
;
/**
* @returns the requested position in global coordinates.
**/
...
...
@@ -227,10 +223,9 @@ Q_SIGNALS:
void
panelTakesFocusChanged
();
private:
friend
class
PlasmaShellInterface
;
explicit
PlasmaShellSurfaceInterface
(
PlasmaShellInterface
*
shell
,
SurfaceInterface
*
parent
,
wl_resource
*
parentResource
);
class
Private
;
Private
*
d_func
()
const
;
friend
class
PlasmaShellInterfacePrivate
;
explicit
PlasmaShellSurfaceInterface
(
SurfaceInterface
*
surface
,
wl_resource
*
resource
);
QScopedPointer
<
PlasmaShellSurfaceInterfacePrivate
>
d
;
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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