diff options
Diffstat (limited to 'src/input/killX11Handler.h')
-rw-r--r-- | src/input/killX11Handler.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/input/killX11Handler.h b/src/input/killX11Handler.h index 2f3ef44..6501d5d 100644 --- a/src/input/killX11Handler.h +++ b/src/input/killX11Handler.h @@ -20,15 +20,23 @@ #include <QCoreApplication> #include "inputEventHandler.h" -class KillX11Handler : public DefaultInputEventHandler<InputEvent::ET_SPECIAL, InputEvent::EC_KILL_X> +/** + * Kills the X11 Server on Linux. + */ +class KillX11Handler : public InputEventHandler< + input_policy::Match<InputEvent::ET_SPECIAL, InputEvent::EC_KILL_X>, + input_policy::Require<input_policy::LinuxSystem> > { public: - void handle(InputEvent const&, InputEventContext const*); - static void describeInto(QList<SpecialInputEventDescription>& list) - { - list << SpecialInputEventDescription(tr(QT_TRANSLATE_NOOP("InputEventHandler", "Kill X Server")), InputEvent::ET_SPECIAL, InputEvent::EC_KILL_X); - } + /** + * Kills the X11 Server on Linux. + * + * The X11-Server is found by asking ConsoleKit for its controlling + * tty. The sole process that has an open file descriptor referencing it + * must be the X Server. It is then sent SIGTERM. + */ + void doHandle(InputEvent const&, InputEventContext const*); }; #endif /* KILLX11HANDLER_H_ */ |