From 4ebba6e13443f1056fa1bb57c07d5220e2abc31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 11 Nov 2015 11:00:59 +0100 Subject: [PATCH] [wayland] Don't pass keyboard events to Unmanaged windows The way it was implemented it allowed an X11 unmanaged window to become a key logger. Basically as soon as there was an unmanaged window it got all key events. This problem was discovered through the xembed-sni-proxy which broke key input to all Wayland windows in a Plasma/Wayland session. With this change Unmanaged windows don't get any key events at all. This might break some applications as e.g. context menus are using override redirect windows. A test with Qt applications shows that the menus are still functional and the events are delivered correctly internally. If applications show problems with this change, we might need to weaken the restriction. --- input.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/input.cpp b/input.cpp index 43c165181b..eddc00b424 100644 --- a/input.cpp +++ b/input.cpp @@ -868,15 +868,7 @@ void InputRedirection::updateKeyboardWindow() } if (auto seat = findSeat()) { // TODO: this needs better integration - // check unmanaged - Toplevel *t = nullptr; - if (!workspace()->unmanagedList().isEmpty()) { - // TODO: better check whether this unmanaged should get the key event - t = workspace()->unmanagedList().first(); - } - if (!t) { - t = workspace()->activeClient(); - } + Toplevel *t = workspace()->activeClient(); if (t && t->surface()) { if (t->surface() != seat->focusedKeyboardSurface()) { seat->setFocusedKeyboardSurface(t->surface());