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 Integration
Commits
fd7f4c33
Commit
fd7f4c33
authored
Sep 08, 2015
by
Marco Martin
Browse files
check for plasmashell existence
parent
c7057625
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/windowsystem/waylandintegration.cpp
View file @
fd7f4c33
...
...
@@ -42,10 +42,7 @@ public:
Q_GLOBAL_STATIC
(
WaylandIntegrationSingleton
,
privateWaylandIntegrationSelf
)
WaylandIntegration
::
WaylandIntegration
()
:
QObject
(),
m_waylandConnection
(
nullptr
),
m_waylandBlurManager
(
nullptr
),
m_waylandCompositor
(
nullptr
)
:
QObject
()
{
setupKWaylandIntegration
();
}
...
...
@@ -84,6 +81,11 @@ KWayland::Client::BlurManager *WaylandIntegration::waylandBlurManager()
{
if
(
!
m_waylandBlurManager
)
{
const
KWayland
::
Client
::
Registry
::
AnnouncedInterface
wmInterface
=
m_registry
->
interface
(
KWayland
::
Client
::
Registry
::
Interface
::
Blur
);
if
(
wmInterface
.
name
==
0
)
{
return
nullptr
;
}
m_waylandBlurManager
=
m_registry
->
createBlurManager
(
wmInterface
.
name
,
wmInterface
.
version
,
this
);
connect
(
m_waylandBlurManager
,
&
KWayland
::
Client
::
BlurManager
::
removed
,
this
,
...
...
@@ -101,6 +103,11 @@ KWayland::Client::ContrastManager *WaylandIntegration::waylandContrastManager()
{
if
(
!
m_waylandContrastManager
)
{
const
KWayland
::
Client
::
Registry
::
AnnouncedInterface
wmInterface
=
m_registry
->
interface
(
KWayland
::
Client
::
Registry
::
Interface
::
Contrast
);
if
(
wmInterface
.
name
==
0
)
{
return
nullptr
;
}
m_waylandContrastManager
=
m_registry
->
createContrastManager
(
wmInterface
.
name
,
wmInterface
.
version
,
this
);
connect
(
m_waylandContrastManager
,
&
KWayland
::
Client
::
ContrastManager
::
removed
,
this
,
...
...
@@ -125,6 +132,12 @@ KWayland::Client::PlasmaWindowManagement *WaylandIntegration::plasmaWindowManage
if
(
!
m_wm
)
{
const
Registry
::
AnnouncedInterface
wmInterface
=
m_registry
->
interface
(
Registry
::
Interface
::
PlasmaWindowManagement
);
if
(
wmInterface
.
name
==
0
)
{
qCWarning
(
KWAYLAND_KWS
)
<<
"This compositor does not support the Plasma Window Management interface"
;
return
nullptr
;
}
m_wm
=
m_registry
->
createPlasmaWindowManagement
(
wmInterface
.
name
,
wmInterface
.
version
,
this
);
connect
(
m_wm
,
&
PlasmaWindowManagement
::
windowCreated
,
this
,
[
this
]
(
PlasmaWindow
*
w
)
{
...
...
@@ -150,7 +163,7 @@ KWayland::Client::PlasmaWindowManagement *WaylandIntegration::plasmaWindowManage
connect
(
m_wm
,
&
PlasmaWindowManagement
::
showingDesktopChanged
,
KWindowSystem
::
self
(),
&
KWindowSystem
::
showingDesktopChanged
);
qCDebug
(
KWAYLAND_KWS
)
<<
"Plasma Window Management interface bound"
;
}
return
m_wm
;
}
...
...
@@ -158,6 +171,11 @@ KWayland::Client::PlasmaShell *WaylandIntegration::waylandPlasmaShell()
{
if
(
!
m_waylandPlasmaShell
)
{
const
KWayland
::
Client
::
Registry
::
AnnouncedInterface
wmInterface
=
m_registry
->
interface
(
KWayland
::
Client
::
Registry
::
Interface
::
PlasmaShell
);
if
(
wmInterface
.
name
==
0
)
{
return
nullptr
;
}
m_waylandPlasmaShell
=
m_registry
->
createPlasmaShell
(
wmInterface
.
name
,
wmInterface
.
version
,
this
);
}
return
m_waylandPlasmaShell
;
...
...
src/windowsystem/waylandintegration.h
View file @
fd7f4c33
...
...
@@ -54,10 +54,10 @@ public:
KWayland
::
Client
::
PlasmaShell
*
waylandPlasmaShell
();
private:
KWayland
::
Client
::
ConnectionThread
*
m_waylandConnection
;
KWayland
::
Client
::
BlurManager
*
m_waylandBlurManager
;
KWayland
::
Client
::
ContrastManager
*
m_waylandContrastManager
;
KWayland
::
Client
::
Compositor
*
m_waylandCompositor
;
KWayland
::
Client
::
ConnectionThread
*
m_waylandConnection
=
nullptr
;
KWayland
::
Client
::
BlurManager
*
m_waylandBlurManager
=
nullptr
;
KWayland
::
Client
::
ContrastManager
*
m_waylandContrastManager
=
nullptr
;
KWayland
::
Client
::
Compositor
*
m_waylandCompositor
=
nullptr
;
KWayland
::
Client
::
PlasmaWindowManagement
*
m_wm
=
nullptr
;
KWayland
::
Client
::
PlasmaShell
*
m_waylandPlasmaShell
=
nullptr
;
KWayland
::
Client
::
Registry
*
m_registry
=
nullptr
;
...
...
src/windowsystem/windowsystem.cpp
View file @
fd7f4c33
...
...
@@ -44,7 +44,6 @@ WindowSystem::WindowSystem()
KWayland
::
Client
::
PlasmaWindow
*
WindowSystem
::
window
(
WId
wid
)
const
{
if
(
!
WaylandIntegration
::
self
()
->
plasmaWindowManagement
())
{
qCWarning
(
KWAYLAND_KWS
)
<<
"This compositor does not support the Plasma Window Management interface"
;
return
nullptr
;
}
...
...
@@ -283,7 +282,6 @@ void WindowSystem::setOnDesktop(WId win, int desktop)
void
WindowSystem
::
setShowingDesktop
(
bool
showing
)
{
if
(
!
WaylandIntegration
::
self
()
->
plasmaWindowManagement
())
{
qCWarning
(
KWAYLAND_KWS
)
<<
"This compositor does not support the Plasma Window Management interface"
;
return
;
}
WaylandIntegration
::
self
()
->
plasmaWindowManagement
()
->
setShowingDesktop
(
showing
);
...
...
@@ -345,7 +343,6 @@ void WindowSystem::setUserTime(WId win, long int time)
bool
WindowSystem
::
showingDesktop
()
{
if
(
!
WaylandIntegration
::
self
()
->
plasmaWindowManagement
())
{
qCWarning
(
KWAYLAND_KWS
)
<<
"This compositor does not support the Plasma Window Management interface"
;
return
false
;
}
return
WaylandIntegration
::
self
()
->
plasmaWindowManagement
()
->
isShowingDesktop
();
...
...
@@ -354,7 +351,6 @@ bool WindowSystem::showingDesktop()
QList
<
WId
>
WindowSystem
::
stackingOrder
()
{
if
(
!
WaylandIntegration
::
self
()
->
plasmaWindowManagement
())
{
qCWarning
(
KWAYLAND_KWS
)
<<
"This compositor does not support the Plasma Window Management interface"
;
return
QList
<
WId
>
();
}
...
...
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