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
5932a957
Commit
5932a957
authored
Sep 28, 2020
by
adrien faveraux
Committed by
Vlad Zahorodnii
Sep 28, 2020
Browse files
Migrate Window Management to new approach
parent
d25db243
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
autotests/client/test_plasma_virtual_desktop.cpp
View file @
5932a957
...
...
@@ -126,8 +126,6 @@ void TestVirtualDesktop::init()
m_plasmaVirtualDesktopManagement
=
registry
.
createPlasmaVirtualDesktopManagement
(
plasmaVirtualDesktopManagementSpy
.
first
().
first
().
value
<
quint32
>
(),
plasmaVirtualDesktopManagementSpy
.
first
().
last
().
value
<
quint32
>
(),
this
);
m_windowManagementInterface
=
m_display
->
createPlasmaWindowManagement
(
m_display
);
m_windowManagementInterface
->
create
();
QVERIFY
(
m_windowManagementInterface
->
isValid
());
m_windowManagementInterface
->
setPlasmaVirtualDesktopManagementInterface
(
m_plasmaVirtualDesktopManagementInterface
);
QVERIFY
(
windowManagementSpy
.
wait
());
...
...
autotests/client/test_plasma_window_model.cpp
View file @
5932a957
...
...
@@ -101,7 +101,6 @@ void PlasmaWindowModelTest::init()
QVERIFY
(
m_display
->
isRunning
());
m_display
->
createShm
();
m_pwInterface
=
m_display
->
createPlasmaWindowManagement
();
m_pwInterface
->
create
();
m_plasmaVirtualDesktopManagementInterface
=
m_display
->
createPlasmaVirtualDesktopManagement
(
m_display
);
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
"desktop1"
);
m_plasmaVirtualDesktopManagementInterface
->
createDesktop
(
"desktop2"
);
...
...
@@ -870,7 +869,7 @@ void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy_data()
#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28)
QTest
::
newRow
(
"iconname"
)
<<
&
PlasmaWindow
::
iconChanged
<<
QVariant
::
fromValue
(
&
PlasmaWindowInterface
::
setThemedIconName
)
<<
QVariant
(
QStringLiteral
(
"foo"
));
#endif
QTest
::
newRow
(
"icon"
)
<<
&
PlasmaWindow
::
iconChanged
<<
QVariant
::
fromValue
(
&
PlasmaWindowInterface
::
setIcon
)
<<
QVariant
::
fromValue
(
QIcon
::
fromTheme
(
QStringLiteral
(
"foo"
)));
QTest
::
newRow
(
"icon"
)
<<
&
PlasmaWindow
::
iconChanged
<<
QVariant
::
fromValue
(
&
PlasmaWindowInterface
::
setIcon
)
<<
QVariant
(
QIcon
::
fromTheme
(
QStringLiteral
(
"foo"
)));
QTest
::
newRow
(
"vd"
)
<<
&
PlasmaWindow
::
virtualDesktopChanged
<<
QVariant
::
fromValue
(
&
PlasmaWindowInterface
::
setVirtualDesktop
)
<<
QVariant
(
2u
);
QTest
::
newRow
(
"unmapped"
)
<<
&
PlasmaWindow
::
unmapped
<<
QVariant
::
fromValue
(
&
PlasmaWindowInterface
::
unmap
)
<<
QVariant
();
}
...
...
@@ -901,6 +900,8 @@ void PlasmaWindowModelTest::testChangeWindowAfterModelDestroy()
(
w
->*
(
setter
.
value
<
ServerWindowStringSetter
>
()))(
value
.
toString
());
}
else
if
(
QMetaType
::
Type
(
value
.
type
())
==
QMetaType
::
UInt
)
{
(
w
->*
(
setter
.
value
<
ServerWindowQuint32Setter
>
()))(
value
.
toUInt
());
}
else
if
(
QMetaType
::
Type
(
value
.
type
())
==
QMetaType
::
QIcon
)
{
(
w
->*
(
setter
.
value
<
ServerWindowIconSetter
>
()))(
value
.
value
<
QIcon
>
());
}
else
if
(
!
value
.
isValid
())
{
(
w
->*
(
setter
.
value
<
ServerWindowVoidSetter
>
()))();
}
...
...
autotests/client/test_wayland_windowmanagement.cpp
View file @
5932a957
...
...
@@ -137,8 +137,6 @@ void TestWindowManagement::init()
m_windowManagementInterface
=
m_display
->
createPlasmaWindowManagement
(
m_display
);
m_windowManagementInterface
->
create
();
QVERIFY
(
m_windowManagementInterface
->
isValid
());
QVERIFY
(
windowManagementSpy
.
wait
());
m_windowManagement
=
m_registry
->
createPlasmaWindowManagement
(
windowManagementSpy
.
first
().
first
().
value
<
quint32
>
(),
windowManagementSpy
.
first
().
last
().
value
<
quint32
>
(),
this
);
...
...
src/server/CMakeLists.txt
View file @
5932a957
...
...
@@ -102,7 +102,7 @@ ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
BASENAME org-kde-plasma-virtual-desktop
)
ecm_add_wayland_server_protocol
(
SERVER_LIB_SRCS
ecm_add_
qt
wayland_server_protocol
(
SERVER_LIB_SRCS
PROTOCOL
${
PLASMA_WAYLAND_PROTOCOLS_DIR
}
/plasma-window-management.xml
BASENAME plasma-window-management
)
...
...
src/server/plasmawindowmanagement_interface.cpp
View file @
5932a957
This diff is collapsed.
Click to expand it.
src/server/plasmawindowmanagement_interface.h
View file @
5932a957
...
...
@@ -10,9 +10,6 @@
#include
<KWaylandServer/kwaylandserver_export.h>
#include
"global.h"
#include
"resource.h"
class
QSize
;
namespace
KWaylandServer
...
...
@@ -22,15 +19,17 @@ class Display;
class
PlasmaWindowInterface
;
class
SurfaceInterface
;
class
PlasmaVirtualDesktopManagementInterface
;
class
PlasmaWindowManagementInterfacePrivate
;
class
PlasmaWindowInterfacePrivate
;
/**
* @todo Add documentation
*/
class
KWAYLANDSERVER_EXPORT
PlasmaWindowManagementInterface
:
public
Global
class
KWAYLANDSERVER_EXPORT
PlasmaWindowManagementInterface
:
public
QObject
{
Q_OBJECT
public:
virtual
~
PlasmaWindowManagementInterface
();
~
PlasmaWindowManagementInterface
()
override
;
enum
class
ShowingDesktopState
{
Disabled
,
Enabled
...
...
@@ -84,8 +83,7 @@ Q_SIGNALS:
private:
friend
class
Display
;
explicit
PlasmaWindowManagementInterface
(
Display
*
display
,
QObject
*
parent
);
class
Private
;
Private
*
d_func
()
const
;
QScopedPointer
<
PlasmaWindowManagementInterfacePrivate
>
d
;
};
/**
...
...
@@ -95,7 +93,7 @@ class KWAYLANDSERVER_EXPORT PlasmaWindowInterface : public QObject
{
Q_OBJECT
public:
virtual
~
PlasmaWindowInterface
();
~
PlasmaWindowInterface
()
override
;
void
setTitle
(
const
QString
&
title
);
void
setAppId
(
const
QString
&
appId
);
...
...
@@ -317,10 +315,11 @@ Q_SIGNALS:
private:
friend
class
PlasmaWindowManagementInterface
;
friend
class
PlasmaWindowInterfacePrivate
;
friend
class
PlasmaWindowManagementInterfacePrivate
;
explicit
PlasmaWindowInterface
(
PlasmaWindowManagementInterface
*
wm
,
QObject
*
parent
);
class
Private
;
const
QScopedPointer
<
Private
>
d
;
QScopedPointer
<
PlasmaWindowInterfacePrivate
>
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