Don't bind ShellClient::acceptsFocus to whether the window is shown
Summary: A not shown window may accept focus (e.g. when minimized). Given that the condition was wrong and broke when making minimized windows not shown. This change takes the idea of not passing focus to a closing or unmapped window directly into acceptsFocus. Which also means that this condition now works for xdg_shell windows. BUG: 368673 Reviewers: #kwin, #plasma_on_wayland, bshah Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2745
This commit is contained in:
parent
156bf258e9
commit
9b32615ab4
2 changed files with 9 additions and 4 deletions
|
@ -276,9 +276,7 @@ void TestShellClient::testMinimizeActiveWindow()
|
||||||
|
|
||||||
workspace()->slotWindowMinimize();
|
workspace()->slotWindowMinimize();
|
||||||
QVERIFY(!c->isShown(true));
|
QVERIFY(!c->isShown(true));
|
||||||
QEXPECT_FAIL("wlShell", "BUG 368673", Continue);
|
|
||||||
QVERIFY(c->wantsInput());
|
QVERIFY(c->wantsInput());
|
||||||
QEXPECT_FAIL("wlShell", "BUG 368673", Continue);
|
|
||||||
QVERIFY(c->wantsTabFocus());
|
QVERIFY(c->wantsTabFocus());
|
||||||
QVERIFY(!c->isActive());
|
QVERIFY(!c->isActive());
|
||||||
QVERIFY(!workspace()->activeClient());
|
QVERIFY(!workspace()->activeClient());
|
||||||
|
|
|
@ -807,12 +807,19 @@ bool ShellClient::acceptsFocus() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (m_closing) {
|
||||||
|
// a closing window does not accept focus
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (m_unmapped) {
|
||||||
|
// an unmapped window does not accept focus
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (m_shellSurface) {
|
if (m_shellSurface) {
|
||||||
if (m_shellSurface->isPopup()) {
|
if (m_shellSurface->isPopup()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// if the window is not visible it doesn't get input
|
return m_shellSurface->acceptsKeyboardFocus();
|
||||||
return m_shellSurface->acceptsKeyboardFocus() && isShown(true);
|
|
||||||
}
|
}
|
||||||
if (m_xdgShellSurface) {
|
if (m_xdgShellSurface) {
|
||||||
// TODO: proper
|
// TODO: proper
|
||||||
|
|
Loading…
Reference in a new issue