Commit 3dc79a6f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Honor NoPlugin option

If decorations are disabled, don't send xdg-toplevel-decoration
configure events requesting ssd mode.

(cherry picked from commit 9977f219)
parent 85d6715b
......@@ -98,6 +98,15 @@ void DecorationBridge::readDecorationOptions()
m_showToolTips = kwinApp()->config()->group(s_pluginName).readEntry("ShowToolTips", true);
}
bool DecorationBridge::hasPlugin()
{
const DecorationBridge *bridge = DecorationBridge::self();
if (!bridge) {
return false;
}
return !bridge->m_noPlugin && bridge->m_factory;
}
void DecorationBridge::init()
{
using namespace KWaylandServer;
......
......@@ -39,6 +39,8 @@ class KWIN_EXPORT DecorationBridge : public KDecoration2::DecorationBridge
public:
~DecorationBridge() override;
static bool hasPlugin();
void init();
KDecoration2::Decoration *createDecoration(AbstractClient *client);
......
......@@ -10,6 +10,7 @@
*/
#include "xdgshellclient.h"
#include "abstract_wayland_output.h"
#include "decorations/decorationbridge.h"
#include "deleted.h"
#include "platform.h"
#include "screenedge.h"
......@@ -564,7 +565,7 @@ bool XdgToplevelClient::userCanSetNoBorder() const
switch (m_xdgDecoration->preferredMode()) {
case XdgToplevelDecorationV1Interface::Mode::Server:
case XdgToplevelDecorationV1Interface::Mode::Undefined:
return !isFullScreen() && !isShade();
return Decoration::DecorationBridge::hasPlugin() && !isFullScreen() && !isShade();
case XdgToplevelDecorationV1Interface::Mode::Client:
return false;
}
......@@ -587,7 +588,7 @@ bool XdgToplevelClient::noBorder() const
switch (m_xdgDecoration->preferredMode()) {
case XdgToplevelDecorationV1Interface::Mode::Server:
case XdgToplevelDecorationV1Interface::Mode::Undefined:
return m_userNoBorder || isFullScreen();
return !Decoration::DecorationBridge::hasPlugin() || m_userNoBorder || isFullScreen();
case XdgToplevelDecorationV1Interface::Mode::Client:
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment