Commit a3ffcfa8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

Do not ask for decoration settings without guarding

Otherwise we crash when no decoration is set (e.g. Plasma Mobile)

(cherry picked from commit ff618e9f)
parent 42126a25
......@@ -76,7 +76,7 @@ void ApplicationMenu::slotShowRequest(const QString &serviceName, const QDBusObj
// Ignore show request when user has not configured the application menu title bar button
auto decorationSettings = Decoration::DecorationBridge::self()->settings();
if (!decorationSettings->decorationButtonsLeft().contains(KDecoration2::DecorationButtonType::ApplicationMenu)
if (decorationSettings && !decorationSettings->decorationButtonsLeft().contains(KDecoration2::DecorationButtonType::ApplicationMenu)
&& !decorationSettings->decorationButtonsRight().contains(KDecoration2::DecorationButtonType::ApplicationMenu)) {
......@@ -1513,9 +1513,11 @@ EffectFrame* EffectsHandlerImpl::effectFrame(EffectFrameStyle style, bool static
QVariant EffectsHandlerImpl::kwinOption(KWinOption kwopt)
switch (kwopt) {
case CloseButtonCorner:
case CloseButtonCorner: {
// TODO: this could become per window and be derived from the actual position in the deco
return Decoration::DecorationBridge::self()->settings()->decorationButtonsLeft().contains(KDecoration2::DecorationButtonType::Close) ? Qt::TopLeftCorner : Qt::TopRightCorner;
const auto settings = Decoration::DecorationBridge::self()->settings();
return settings && settings->decorationButtonsLeft().contains(KDecoration2::DecorationButtonType::Close) ? Qt::TopLeftCorner : Qt::TopRightCorner;
case SwitchDesktopOnScreenEdge:
return ScreenEdges::self()->isDesktopSwitching();
case SwitchDesktopOnScreenEdgeMovingWindows:
Supports Markdown
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