Commit 9b32615a authored by Martin Flöser's avatar Martin Flöser

Don't bind ShellClient::acceptsFocus to whether the window is shown

A not shown window may accept focus (e.g. when minimized). Given that
the condition was wrong and broke when making minimized windows not

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:
parent 156bf258
......@@ -276,9 +276,7 @@ void TestShellClient::testMinimizeActiveWindow()
QEXPECT_FAIL("wlShell", "BUG 368673", Continue);
QEXPECT_FAIL("wlShell", "BUG 368673", Continue);
......@@ -807,12 +807,19 @@ bool ShellClient::acceptsFocus() const
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->isPopup()) {
return false;
// if the window is not visible it doesn't get input
return m_shellSurface->acceptsKeyboardFocus() && isShown(true);
return m_shellSurface->acceptsKeyboardFocus();
if (m_xdgShellSurface) {
// TODO: proper
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