wayland: Honor NoPlugin option

If decorations are disabled, don't send xdg-toplevel-decoration
configure events requesting ssd mode.
This commit is contained in:
Vlad Zahorodnii 2021-02-24 10:35:18 +02:00 committed by Aleix Pol Gonzalez
parent 6c9e0781cd
commit 9977f21980
3 changed files with 14 additions and 2 deletions

View file

@ -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;

View file

@ -39,6 +39,8 @@ class KWIN_EXPORT DecorationBridge : public KDecoration2::DecorationBridge
public:
~DecorationBridge() override;
static bool hasPlugin();
void init();
KDecoration2::Decoration *createDecoration(AbstractClient *client);

View file

@ -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;
}