Do not ask for decoration settings without guarding
Otherwise we crash when no decoration is set (e.g. Plasma Mobile)
This commit is contained in:
parent
aaa060d6c1
commit
ff618e9f41
2 changed files with 5 additions and 3 deletions
|
@ -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)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue