options: Set placement default in kcfg

This ensures the value can still be overridden explicitly in kwinrc.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This commit is contained in:
Kai Uwe Broulik 2022-08-18 13:46:27 +02:00 committed by Kai Uwe Broulik
parent 3ca49ee64e
commit 405469aa19
2 changed files with 8 additions and 7 deletions

View file

@ -3,6 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<include>config-kwin.h</include>
<kcfgfile arg="true" />
<group name="MouseBindings">
<entry name="CommandTitlebarWheel" type="String">
@ -124,7 +125,13 @@
<choice name="OnMainWindow"/>
<choice name="Maximizing"/>
</choices>
<default>Placement::Centered</default>
<default type="code">[] {
#if KWIN_BUILD_DECORATIONS
return Placement::Centered;
#else
return Placement::Maximizing;
#endif
}()</default>
</entry>
<entry name="AutoRaise" type="Bool">
<default>false</default>

View file

@ -761,13 +761,7 @@ void Options::syncFromKcfgc()
setFocusStealingPreventionLevel(m_settings->focusStealingPreventionLevel());
setXwaylandCrashPolicy(m_settings->xwaylandCrashPolicy());
setXwaylandMaxCrashCount(m_settings->xwaylandMaxCrashCount());
#if KWIN_BUILD_DECORATIONS
setPlacement(m_settings->placement());
#else
setPlacement(Placement::Maximizing);
#endif
setAutoRaise(m_settings->autoRaise());
setAutoRaiseInterval(m_settings->autoRaiseInterval());
setDelayFocusInterval(m_settings->delayFocusInterval());