Commit b3e9c819 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

[focuschain/task switcher] Add hidden option to govern repositioning minimized windows

Since some people apparently liked the old behavior of moving minimized
windows to the end of the focus chain, let's let them have it if they
set a hidden config option:

`MoveMinimizedWindowsToEndOfTabBoxFocusChain=true` in the `[TabBox]` group
of the kwinrc file.

We can add a UI for it later if needed.

BUG: 427840
FIXED-IN: 5.21
parent 75fded6f
......@@ -703,7 +703,11 @@ void AbstractClient::minimize(bool avoid_animation)
doMinimize();
updateWindowRules(Rules::Minimize);
FocusChain::self()->update(this, FocusChain::MakeFirstMinimized);
if (options->moveMinimizedWindowsToEndOfTabBoxFocusChain()) {
FocusChain::self()->update(this, FocusChain::MakeFirstMinimized);
}
// TODO: merge signal with s_minimized
addWorkspaceRepaint(visibleRect());
emit clientMinimized(this, !avoid_animation);
......
......@@ -227,14 +227,18 @@ AbstractClient *FocusChain::nextForDesktop(AbstractClient *reference, uint deskt
void FocusChain::makeFirstInChain(AbstractClient *client, Chain &chain)
{
chain.removeAll(client);
if (client->isMinimized()) { // add it before the first minimized ...
for (int i = chain.count()-1; i >= 0; --i) {
if (chain.at(i)->isMinimized()) {
chain.insert(i+1, client);
return;
if (options->moveMinimizedWindowsToEndOfTabBoxFocusChain()) {
if (client->isMinimized()) { // add it before the first minimized ...
for (int i = chain.count()-1; i >= 0; --i) {
if (chain.at(i)->isMinimized()) {
chain.insert(i+1, client);
return;
}
}
chain.prepend(client); // ... or at end of chain
} else {
chain.append(client);
}
chain.prepend(client); // ... or at end of chain
} else {
chain.append(client);
}
......
......@@ -295,6 +295,9 @@
<entry name="LayoutName" type="String">
<default>thumbnails</default>
</entry>
<entry name="MoveMinimizedWindowsToEndOfTabBoxFocusChain" type="Bool">
<default>false</default>
</entry>
</group>
<group name="KDE">
<entry name="AnimationDurationFactor" type="Double">
......
......@@ -111,6 +111,7 @@ Options::Options(QObject *parent)
, m_glPreferBufferSwap(Options::defaultGlPreferBufferSwap())
, m_glPlatformInterface(Options::defaultGlPlatformInterface())
, m_windowsBlockCompositing(true)
, m_MoveMinimizedWindowsToEndOfTabBoxFocusChain(false)
, OpTitlebarDblClick(Options::defaultOperationTitlebarDblClick())
, CmdActiveTitlebar1(Options::defaultCommandActiveTitlebar1())
, CmdActiveTitlebar2(Options::defaultCommandActiveTitlebar2())
......@@ -679,6 +680,15 @@ void Options::setWindowsBlockCompositing(bool value)
emit windowsBlockCompositingChanged();
}
void Options::setMoveMinimizedWindowsToEndOfTabBoxFocusChain(bool value)
{
if (m_MoveMinimizedWindowsToEndOfTabBoxFocusChain == value) {
return;
}
m_MoveMinimizedWindowsToEndOfTabBoxFocusChain = value;
}
void Options::setGlPreferBufferSwap(char glPreferBufferSwap)
{
if (glPreferBufferSwap == 'a') {
......@@ -849,6 +859,7 @@ void Options::syncFromKcfgc()
setElectricBorderTiling(m_settings->electricBorderTiling());
setElectricBorderCornerRatio(m_settings->electricBorderCornerRatio());
setWindowsBlockCompositing(m_settings->windowsBlockCompositing());
setMoveMinimizedWindowsToEndOfTabBoxFocusChain(m_settings->moveMinimizedWindowsToEndOfTabBoxFocusChain());
}
......
......@@ -590,6 +590,10 @@ public:
return m_windowsBlockCompositing;
}
bool moveMinimizedWindowsToEndOfTabBoxFocusChain() const {
return m_MoveMinimizedWindowsToEndOfTabBoxFocusChain;
}
QStringList modifierOnlyDBusShortcut(Qt::KeyboardModifier mod) const;
// setters
......@@ -651,6 +655,7 @@ public:
void setGlPreferBufferSwap(char glPreferBufferSwap);
void setGlPlatformInterface(OpenGLPlatformInterface interface);
void setWindowsBlockCompositing(bool set);
void setMoveMinimizedWindowsToEndOfTabBoxFocusChain(bool set);
// default values
static WindowOperation defaultOperationTitlebarDblClick() {
......@@ -881,6 +886,7 @@ private:
GlSwapStrategy m_glPreferBufferSwap;
OpenGLPlatformInterface m_glPlatformInterface;
bool m_windowsBlockCompositing;
bool m_MoveMinimizedWindowsToEndOfTabBoxFocusChain;
WindowOperation OpTitlebarDblClick;
WindowOperation opMaxButtonRightClick = defaultOperationMaxButtonRightClick();
......
Markdown is supported
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