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
This commit is contained in:
Martin Flöser 2017-08-18 20:56:13 +02:00
parent 9c74be1256
commit 76ee47151a
2 changed files with 0 additions and 18 deletions

View file

@ -48,7 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QFile>
#include <QMouseEvent>
#include <QProcess>
#include <QWhatsThis>
// XLib
#include <X11/Xutil.h>
#include <fixx11h.h>
@ -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: ?
}
}

View file

@ -51,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QKeyEvent>
#include <QMouseEvent>
#include <QStyleHints>
#include <QWhatsThis>
#include <QWheelEvent>
#include <kkeyserver.h>
@ -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<xcb_enter_notify_event_t*>(e)->event);
if (w)
QWhatsThis::leaveWhatsThisMode();
}
if (ScreenEdges::self()->isEntered(reinterpret_cast<xcb_enter_notify_event_t*>(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<xcb_leave_notify_event_t*>(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<xcb_configure_request_event_t*>(e);
if (event->parent == rootWindow()) {