From 76ee47151a2ce7f879f63d9715aebd440aebc889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Fri, 18 Aug 2017 20:56:13 +0200 Subject: [PATCH] Don't create QWhatsThis when user presses showContextHelp button Summary: I don't know what the idea of entering QWhatsThis mode was, but the code is pretty much dead. There is no QWhatsThis window shown as KWin does not have any UI or help. The window which eventually gets shown in context help is provided by the client application. Furthermore KWin never leaves the QWhatsThis mode. At least one code path entering in leave is dead in general and one at least on Wayland (but probably also on X11 as the window never gets shown). The show context help functionality works fine without the QWhatsThis handling, so let's remove it. I tried to blame what was the idea behind it, but it was unchanged since decades and blame ended in a code moving commit. Test Plan: Used show context help (kcmshell5 --platform xcb kwinoptions) Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D7398 --- client.cpp | 2 -- events.cpp | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/client.cpp b/client.cpp index cb09c00d90..b785fb0852 100644 --- a/client.cpp +++ b/client.cpp @@ -48,7 +48,6 @@ along with this program. If not, see . #include #include #include -#include // XLib #include #include @@ -1399,7 +1398,6 @@ void Client::showContextHelp() { if (info->supportsProtocol(NET::ContextHelpProtocol)) { sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help); - QWhatsThis::enterWhatsThisMode(); // SELI TODO: ? } } diff --git a/events.cpp b/events.cpp index 1770719c9f..462611ba20 100644 --- a/events.cpp +++ b/events.cpp @@ -51,7 +51,6 @@ along with this program. If not, see . #include #include #include -#include #include #include @@ -385,25 +384,10 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) } case XCB_ENTER_NOTIFY: { - if (QWhatsThis::inWhatsThisMode()) { - QWidget* w = QWidget::find(reinterpret_cast(e)->event); - if (w) - QWhatsThis::leaveWhatsThisMode(); - } if (ScreenEdges::self()->isEntered(reinterpret_cast(e))) return true; break; } - case XCB_LEAVE_NOTIFY: { - if (!QWhatsThis::inWhatsThisMode()) - break; - // TODO is this cliente ever found, given that client events are searched above? - const auto *event = reinterpret_cast(e); - Client* c = findClient(Predicate::FrameIdMatch, event->event); - if (c && event->detail != XCB_NOTIFY_DETAIL_INFERIOR) - QWhatsThis::leaveWhatsThisMode(); - break; - } case XCB_CONFIGURE_REQUEST: { const auto *event = reinterpret_cast(e); if (event->parent == rootWindow()) {