Add safety guards in FocusChain::move{After,Before}Window()
If the `window` is the same as the `reference`, the `window` will be inserted at index "-1", which is wrong.
This commit is contained in:
parent
22e10f6efb
commit
ef9d3a1cd0
1 changed files with 6 additions and 0 deletions
|
@ -139,6 +139,9 @@ void FocusChain::moveAfterWindow(Window *window, Window *reference)
|
|||
if (!window->wantsTabFocus()) {
|
||||
return;
|
||||
}
|
||||
if (reference == window) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto it = m_desktopFocusChains.begin();
|
||||
it != m_desktopFocusChains.end();
|
||||
|
@ -159,6 +162,9 @@ void FocusChain::moveBeforeWindow(Window *window, Window *reference)
|
|||
if (!window->wantsTabFocus()) {
|
||||
return;
|
||||
}
|
||||
if (reference == window) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto it = m_desktopFocusChains.begin();
|
||||
it != m_desktopFocusChains.end();
|
||||
|
|
Loading…
Reference in a new issue