Add rule to protect the focus on a window

This allows to pin the focus on certain window as well
as to more easily give it away on others (typically launchers)

BUG: 185060
CCBUG: 337798
FIXED-IN: 5.5
REVIEW: 126059
icc-effect-5.14.5
Thomas Lübking 2015-11-13 00:37:01 +01:00
parent 37a64dcf5f
commit a4791e629d
6 changed files with 382 additions and 267 deletions

View File

@ -541,6 +541,11 @@ void Workspace::setShouldGetFocus(AbstractClient* c)
updateStackingOrder(); // e.g. fullscreens have different layer when active/not-active
}
namespace FSP {
enum Level { None = 0, Low, Medium, High, Extreme };
}
// focus_in -> the window got FocusIn event
// ignore_desktop - call comes from _NET_ACTIVE_WINDOW message, don't refuse just because of window
// is on a different desktop
@ -557,7 +562,7 @@ bool Workspace::allowClientActivation(const KWin::AbstractClient *c, xcb_timesta
if (time == -1U)
time = c->userTime();
int level = c->rules()->checkFSP(options->focusStealingPreventionLevel());
if (session_saving && level <= 2) { // <= normal
if (session_saving && level <= FSP::Medium) { // <= normal
return true;
}
AbstractClient* ac = mostRecentlyActivatedClient();
@ -572,33 +577,52 @@ bool Workspace::allowClientActivation(const KWin::AbstractClient *c, xcb_timesta
if (!c->rules()->checkAcceptFocus(false))
return false;
}
if (level == 0) // none
const int protection = ac ? ac->rules()->checkFPP(2) : 0;
// stealing is unconditionally allowed (NETWM behavior)
if (level == FSP::None || protection == FSP::None)
return true;
if (level == 4) // extreme
// The active client "grabs" the focus or stealing is generally forbidden
if (level == FSP::Extreme || protection == FSP::Extreme)
return false;
// Desktop switching is only allowed in the "no protection" case
if (!ignore_desktop && !c->isOnCurrentDesktop())
return false; // allow only with level == 0
// No active client, it's ok to pass focus
// NOTICE that extreme protection needs to be handled before to allow protection on unmanged windows
if (ac == NULL || ac->isDesktop()) {
qCDebug(KWIN_CORE) << "Activation: No client active, allowing";
return true; // no active client -> always allow
}
// TODO window urgency -> return true?
if (AbstractClient::belongToSameApplication(c, ac, true)) {
// Unconditionally allow intra-client passing around for lower stealing protections
// unless the active client has High interest
if (AbstractClient::belongToSameApplication(c, ac, true) && protection < FSP::High) {
qCDebug(KWIN_CORE) << "Activation: Belongs to active application";
return true;
}
if (level == 3) // high
// High FPS, not intr-client change. Only allow if the active client has only minor interest
if (level > FSP::Medium && protection > FSP::Low)
return false;
if (time == -1U) { // no time known
qCDebug(KWIN_CORE) << "Activation: No timestamp at all";
if (level == 1) // low
// Only allow for Low protection unless active client has High interest in focus
if (level < FSP::Medium && protection < FSP::High)
return true;
// no timestamp at all, don't activate - because there's also creation timestamp
// done on CreateNotify, this case should happen only in case application
// maps again already used window, i.e. this won't happen after app startup
return false;
}
// level == 2 // normal
// Low or medium FSP, usertime comparism is possible
Time user_time = ac->userTime();
qCDebug(KWIN_CORE) << "Activation, compared:" << c << ":" << time << ":" << user_time
<< ":" << (NET::timestampCompare(time, user_time) >= 0);

View File

@ -121,6 +121,7 @@ RulesWidget::RulesWidget(QWidget* parent)
SETUP(shortcut, force);
// workarounds tab
SETUP(fsplevel, force);
SETUP(fpplevel, force);
SETUP(type, force);
SETUP(ignoregeometry, set);
SETUP(minsize, force);
@ -206,6 +207,7 @@ void RulesWidget::updateEnableshortcut()
}
// workarounds tab
UPDATE_ENABLE_SLOT(fsplevel)
UPDATE_ENABLE_SLOT(fpplevel)
UPDATE_ENABLE_SLOT(type)
UPDATE_ENABLE_SLOT(ignoregeometry)
UPDATE_ENABLE_SLOT(minsize)
@ -508,6 +510,7 @@ void RulesWidget::setRules(Rules* rules)
SPINBOX_FORCE_RULE(opacityinactive,);
LINEEDIT_SET_RULE(shortcut,);
COMBOBOX_FORCE_RULE(fsplevel,);
COMBOBOX_FORCE_RULE(fpplevel,);
COMBOBOX_FORCE_RULE(type, typeToCombo);
CHECKBOX_SET_RULE(ignoregeometry,);
LINEEDIT_FORCE_RULE(minsize, sizeToStr);
@ -611,6 +614,7 @@ Rules* RulesWidget::rules() const
SPINBOX_FORCE_RULE(opacityinactive,);
LINEEDIT_SET_RULE(shortcut,);
COMBOBOX_FORCE_RULE(fsplevel,);
COMBOBOX_FORCE_RULE(fpplevel,);
COMBOBOX_FORCE_RULE(type, comboToType);
CHECKBOX_SET_RULE(ignoregeometry,);
LINEEDIT_FORCE_RULE(minsize, strToSize);
@ -731,6 +735,7 @@ void RulesWidget::prefillUnusedValues(const KWindowInfo& info)
SPINBOX_PREFILL(opacityinactive, , 100 /*get the actual opacity somehow*/);
//LINEEDIT_PREFILL( shortcut, );
//COMBOBOX_PREFILL( fsplevel, );
//COMBOBOX_PREFILL( fpplevel, );
COMBOBOX_PREFILL(type, typeToCombo, info.windowType(SUPPORTED_MANAGED_WINDOW_TYPES_MASK));
//CHECKBOX_PREFILL( ignoregeometry, );
LINEEDIT_PREFILL(minsize, sizeToStr, info.frameGeometry().size());

View File

@ -92,6 +92,7 @@ private Q_SLOTS:
void updateEnableopacityinactive();
// workarounds tab
void updateEnablefsplevel();
void updateEnablefpplevel();
void updateEnabletype();
void updateEnableignoregeometry();
void updateEnableminsize();

View File

@ -1902,42 +1902,6 @@ like your complete screen area.</string>
<string>Appearance &amp;&amp; &amp;Fixes</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="11" column="5" rowspan="2" colspan="2">
<widget class="YesNoBox" name="acceptfocus" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="2" colspan="3">
<widget class="QComboBox" name="rule_opacityactive">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="23" column="1" rowspan="2">
<widget class="QCheckBox" name="enable_blockcompositing">
<property name="text">
<string>Block compositing</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="enable_noborder">
<property name="text">
@ -1982,13 +1946,78 @@ like your complete screen area.</string>
</item>
</widget>
</item>
<item row="2" column="1" rowspan="2" colspan="6">
<item row="0" column="5">
<widget class="YesNoBox" name="noborder" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="enable_decocolor">
<property name="text">
<string>Titlebar color &amp;scheme</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="3">
<widget class="QComboBox" name="rule_decocolor">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="1" column="5">
<widget class="QComboBox" name="decocolor">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2" colspan="5">
<widget class="Line" name="line_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="2" colspan="3">
<widget class="QComboBox" name="rule_opacityactive">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="enable_opacityactive">
<property name="text">
@ -1996,20 +2025,7 @@ like your complete screen area.</string>
</property>
</widget>
</item>
<item row="10" column="0" rowspan="3">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="5" colspan="2">
<item row="4" column="5">
<widget class="QSpinBox" name="opacityactive">
<property name="enabled">
<bool>false</bool>
@ -2054,7 +2070,7 @@ like your complete screen area.</string>
</item>
</widget>
</item>
<item row="5" column="5" colspan="2">
<item row="5" column="5">
<widget class="QSpinBox" name="opacityinactive">
<property name="enabled">
<bool>false</bool>
@ -2070,7 +2086,30 @@ like your complete screen area.</string>
</property>
</widget>
</item>
<item row="9" column="3">
<item row="6" column="0" rowspan="2" colspan="3">
<widget class="Line" name="line_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="3">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="3">
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2086,7 +2125,169 @@ like your complete screen area.</string>
</property>
</spacer>
</item>
<item row="11" column="1" rowspan="2">
<item row="8" column="0">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="enable_fsplevel">
<property name="toolTip">
<string>KWin tries to prevent windows from taking the focus
(&quot;activate&quot;) while you're working in another window,
but this may sometimes fail or superact.
&quot;None&quot; will unconditionally allow this window to get the focus while
&quot;Extreme&quot; will completely prevent it from taking the focus.</string>
</property>
<property name="text">
<string>&amp;Focus stealing prevention</string>
</property>
</widget>
</item>
<item row="8" column="2" colspan="3">
<widget class="QComboBox" name="rule_fsplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="8" column="5">
<widget class="KComboBox" name="fsplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string comment="no focus stealing prevention">None</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Extreme</string>
</property>
</item>
</widget>
</item>
<item row="8" column="6">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="enable_fpplevel">
<property name="toolTip">
<string>This controls the focus protection of the currenly active window.
None will always give the focus away,
Extreme will keep it.
Otherwise it's interleaved with the stealing prevention
assigned to the window that wants the focus.</string>
</property>
<property name="text">
<string>Focus protection</string>
</property>
</widget>
</item>
<item row="9" column="2" colspan="3">
<widget class="QComboBox" name="rule_fpplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="9" column="5">
<widget class="KComboBox" name="fpplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string comment="no focus stealing prevention">None</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Extreme</string>
</property>
</item>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="enable_acceptfocus">
<property name="toolTip">
<string>Windows may prevent to get the focus (activate) when being clicked.
@ -2098,7 +2299,7 @@ from getting focused on a mouse click.</string>
</property>
</widget>
</item>
<item row="11" column="2" rowspan="2" colspan="3">
<item row="10" column="2" colspan="3">
<widget class="QComboBox" name="rule_acceptfocus">
<property name="enabled">
<bool>false</bool>
@ -2120,14 +2321,14 @@ from getting focused on a mouse click.</string>
</item>
</widget>
</item>
<item row="14" column="1" rowspan="3" colspan="6">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="10" column="5">
<widget class="YesNoBox" name="acceptfocus" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="11" column="1">
<widget class="QCheckBox" name="enable_disableglobalshortcuts">
<property name="toolTip">
<string>When used, a window will receive
@ -2147,7 +2348,7 @@ while it's active!</string>
</property>
</widget>
</item>
<item row="13" column="2" colspan="3">
<item row="11" column="2" colspan="3">
<widget class="QComboBox" name="rule_disableglobalshortcuts">
<property name="enabled">
<bool>false</bool>
@ -2169,35 +2370,64 @@ while it's active!</string>
</item>
</widget>
</item>
<item row="17" column="1" rowspan="2">
<item row="11" column="5">
<widget class="YesNoBox" name="disableglobalshortcuts" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="12" column="1" colspan="5">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QCheckBox" name="enable_closeable">
<property name="text">
<string>&amp;Closeable</string>
</property>
</widget>
</item>
<item row="19" column="1">
<widget class="QCheckBox" name="enable_type">
<property name="text">
<string>Window &amp;type</string>
<item row="13" column="2" colspan="3">
<widget class="QComboBox" name="rule_closeable">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="17" column="5" rowspan="2" colspan="2">
<item row="13" column="5">
<widget class="YesNoBox" name="closeable" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="20" column="1" rowspan="3" colspan="6">
<widget class="Line" name="line_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="14" column="1">
<widget class="QCheckBox" name="enable_type">
<property name="text">
<string>Window &amp;type</string>
</property>
</widget>
</item>
<item row="19" column="2" colspan="3">
<item row="14" column="2" colspan="3">
<widget class="QComboBox" name="rule_type">
<property name="enabled">
<bool>false</bool>
@ -2219,7 +2449,7 @@ while it's active!</string>
</item>
</widget>
</item>
<item row="19" column="5" colspan="2">
<item row="14" column="5">
<widget class="QComboBox" name="type">
<property name="enabled">
<bool>false</bool>
@ -2271,131 +2501,21 @@ while it's active!</string>
</item>
</widget>
</item>
<item row="7" column="3">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="8">
<widget class="Line" name="line_15">
<item row="15" column="1" colspan="5">
<widget class="Line" name="line_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="23" column="5" rowspan="2" colspan="2">
<widget class="YesNoBox" name="blockcompositing" native="true">
<property name="enabled">
<bool>false</bool>
<item row="16" column="1">
<widget class="QCheckBox" name="enable_blockcompositing">
<property name="text">
<string>Block compositing</string>
</property>
</widget>
</item>
<item row="25" column="2" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="5" colspan="2">
<widget class="YesNoBox" name="disableglobalshortcuts" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="10" column="7" rowspan="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5" colspan="2">
<widget class="YesNoBox" name="noborder" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="17" column="2" rowspan="2" colspan="3">
<widget class="QComboBox" name="rule_closeable">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="10" column="5" colspan="2">
<widget class="KComboBox" name="fsplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string comment="no focus stealing prevention">None</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Extreme</string>
</property>
</item>
</widget>
</item>
<item row="23" column="2" rowspan="2" colspan="3">
<item row="16" column="2" colspan="3">
<widget class="QComboBox" name="rule_blockcompositing">
<property name="enabled">
<bool>false</bool>
@ -2417,77 +2537,25 @@ while it's active!</string>
</item>
</widget>
</item>
<item row="10" column="2" colspan="3">
<widget class="QComboBox" name="rule_fsplevel">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="enable_fsplevel">
<property name="toolTip">
<string>KWin tries to prevent windows from taking the focus
(&quot;activate&quot;) while you're working in another window,
but this may sometimes fail or superact.
&quot;None&quot; will unconditionally allow this window to get the focus while
&quot;Extreme&quot; will completely prevent it from taking the focus.</string>
</property>
<property name="text">
<string>&amp;Focus stealing prevention</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="enable_decocolor">
<property name="text">
<string>Titlebar color &amp;scheme</string>
</property>
</widget>
</item>
<item row="1" column="5" colspan="2">
<widget class="QComboBox" name="decocolor">
<item row="16" column="5">
<widget class="YesNoBox" name="blockcompositing" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2" colspan="3">
<widget class="QComboBox" name="rule_decocolor">
<property name="enabled">
<bool>false</bool>
<item row="17" column="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<item>
<property name="text">
<string>Do Not Affect</string>
</property>
</item>
<item>
<property name="text">
<string>Force</string>
</property>
</item>
<item>
<property name="text">
<string>Force Temporarily</string>
</property>
</item>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
@ -2496,16 +2564,16 @@ but this may sometimes fail or superact.
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>YesNoBox</class>
<extends>QWidget</extends>
@ -2592,6 +2660,9 @@ but this may sometimes fail or superact.
<tabstop>shortcut_edit</tabstop>
<tabstop>enable_noborder</tabstop>
<tabstop>rule_noborder</tabstop>
<tabstop>enable_decocolor</tabstop>
<tabstop>rule_decocolor</tabstop>
<tabstop>decocolor</tabstop>
<tabstop>enable_opacityactive</tabstop>
<tabstop>rule_opacityactive</tabstop>
<tabstop>opacityactive</tabstop>
@ -2601,6 +2672,9 @@ but this may sometimes fail or superact.
<tabstop>enable_fsplevel</tabstop>
<tabstop>rule_fsplevel</tabstop>
<tabstop>fsplevel</tabstop>
<tabstop>enable_fpplevel</tabstop>
<tabstop>rule_fpplevel</tabstop>
<tabstop>fpplevel</tabstop>
<tabstop>enable_acceptfocus</tabstop>
<tabstop>rule_acceptfocus</tabstop>
<tabstop>enable_disableglobalshortcuts</tabstop>

View File

@ -73,6 +73,7 @@ Rules::Rules()
, decocolorrule(UnusedForceRule)
, blockcompositingrule(UnusedForceRule)
, fsplevelrule(UnusedForceRule)
, fpplevelrule(UnusedForceRule)
, acceptfocusrule(UnusedForceRule)
, closeablerule(UnusedForceRule)
, autogrouprule(UnusedForceRule)
@ -182,6 +183,7 @@ void Rules::readFromCfg(const KConfigGroup& cfg)
decocolorrule = decocolor.isEmpty() ? UnusedForceRule : readForceRule(cfg, QStringLiteral("decocolorrule"));
READ_FORCE_RULE(blockcompositing, , false);
READ_FORCE_RULE(fsplevel, limit0to4, 0); // fsp is 0-4
READ_FORCE_RULE(fpplevel, limit0to4, 0); // fpp is 0-4
READ_FORCE_RULE(acceptfocus, , false);
READ_FORCE_RULE(closeable, , false);
READ_FORCE_RULE(autogroup, , false);
@ -279,6 +281,7 @@ void Rules::write(KConfigGroup& cfg) const
WRITE_FORCE_RULE(decocolor, colorToString);
WRITE_FORCE_RULE(blockcompositing,);
WRITE_FORCE_RULE(fsplevel,);
WRITE_FORCE_RULE(fpplevel,);
WRITE_FORCE_RULE(acceptfocus,);
WRITE_FORCE_RULE(closeable,);
WRITE_FORCE_RULE(autogroup,);
@ -322,6 +325,7 @@ bool Rules::isEmpty() const
&& decocolorrule == UnusedForceRule
&& blockcompositingrule == UnusedForceRule
&& fsplevelrule == UnusedForceRule
&& fpplevelrule == UnusedForceRule
&& acceptfocusrule == UnusedForceRule
&& closeablerule == UnusedForceRule
&& autogrouprule == UnusedForceRule
@ -650,6 +654,7 @@ APPLY_RULE(noborder, NoBorder, bool)
APPLY_FORCE_RULE(decocolor, DecoColor, QString)
APPLY_FORCE_RULE(blockcompositing, BlockCompositing, bool)
APPLY_FORCE_RULE(fsplevel, FSP, int)
APPLY_FORCE_RULE(fpplevel, FPP, int)
APPLY_FORCE_RULE(acceptfocus, AcceptFocus, bool)
APPLY_FORCE_RULE(closeable, Closeable, bool)
APPLY_FORCE_RULE(autogroup, Autogrouping, bool)
@ -718,6 +723,7 @@ void Rules::discardUsed(bool withdrawn)
DISCARD_USED_FORCE_RULE(decocolor);
DISCARD_USED_FORCE_RULE(blockcompositing);
DISCARD_USED_FORCE_RULE(fsplevel);
DISCARD_USED_FORCE_RULE(fpplevel);
DISCARD_USED_FORCE_RULE(acceptfocus);
DISCARD_USED_FORCE_RULE(closeable);
DISCARD_USED_FORCE_RULE(autogroup);
@ -851,6 +857,7 @@ CHECK_RULE(NoBorder, bool)
CHECK_FORCE_RULE(DecoColor, QString)
CHECK_FORCE_RULE(BlockCompositing, bool)
CHECK_FORCE_RULE(FSP, int)
CHECK_FORCE_RULE(FPP, int)
CHECK_FORCE_RULE(AcceptFocus, bool)
CHECK_FORCE_RULE(Closeable, bool)
CHECK_FORCE_RULE(Autogrouping, bool)

View File

@ -80,6 +80,7 @@ public:
QString checkDecoColor(QString schemeFile) const;
bool checkBlockCompositing(bool block) const;
int checkFSP(int fsp) const;
int checkFPP(int fpp) const;
bool checkAcceptFocus(bool focus) const;
bool checkCloseable(bool closeable) const;
bool checkAutogrouping(bool autogroup) const;
@ -147,6 +148,7 @@ public:
bool applyDecoColor(QString &schemeFile) const;
bool applyBlockCompositing(bool& block) const;
bool applyFSP(int& fsp) const;
bool applyFPP(int& fpp) const;
bool applyAcceptFocus(bool& focus) const;
bool applyCloseable(bool& closeable) const;
bool applyAutogrouping(bool& autogroup) const;
@ -262,7 +264,9 @@ private:
bool blockcompositing;
ForceRule blockcompositingrule;
int fsplevel;
int fpplevel;
ForceRule fsplevelrule;
ForceRule fpplevelrule;
bool acceptfocus;
ForceRule acceptfocusrule;
bool closeable;