2013-06-26 12:15:20 +04:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
#ifndef KWIN_INPUT_H
|
|
|
|
#define KWIN_INPUT_H
|
|
|
|
#include <kwinglobals.h>
|
2015-02-19 12:38:49 +03:00
|
|
|
#include <QAction>
|
2013-06-26 12:15:20 +04:00
|
|
|
#include <QObject>
|
|
|
|
#include <QPoint>
|
2016-05-12 17:33:03 +03:00
|
|
|
#include <QPointer>
|
2013-07-02 13:44:18 +04:00
|
|
|
#include <config-kwin.h>
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2016-05-06 10:53:36 +03:00
|
|
|
#include <KSharedConfig>
|
|
|
|
|
2016-11-15 16:23:51 +03:00
|
|
|
#include <functional>
|
|
|
|
|
2015-06-26 14:47:08 +03:00
|
|
|
class KGlobalAccelInterface;
|
2013-07-10 13:41:16 +04:00
|
|
|
class QKeySequence;
|
2016-02-15 15:51:36 +03:00
|
|
|
class QMouseEvent;
|
|
|
|
class QKeyEvent;
|
|
|
|
class QWheelEvent;
|
2013-07-10 13:41:16 +04:00
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
namespace KWin
|
|
|
|
{
|
2013-07-10 13:41:16 +04:00
|
|
|
class GlobalShortcutsManager;
|
2013-07-01 10:37:59 +04:00
|
|
|
class Toplevel;
|
2016-02-03 17:17:49 +03:00
|
|
|
class InputEventFilter;
|
2016-12-27 22:16:50 +03:00
|
|
|
class InputEventSpy;
|
2016-02-15 15:42:48 +03:00
|
|
|
class KeyboardInputRedirection;
|
2016-11-25 09:17:43 +03:00
|
|
|
class PointerConstraintsFilter;
|
2016-02-12 15:30:00 +03:00
|
|
|
class PointerInputRedirection;
|
2016-02-15 11:36:59 +03:00
|
|
|
class TouchInputRedirection;
|
2016-11-15 16:23:51 +03:00
|
|
|
class WindowSelectorFilter;
|
2017-12-27 22:25:36 +03:00
|
|
|
class SwitchEvent;
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2016-05-12 17:33:03 +03:00
|
|
|
namespace Decoration
|
|
|
|
{
|
|
|
|
class DecoratedClientImpl;
|
|
|
|
}
|
|
|
|
|
2015-03-30 09:55:41 +03:00
|
|
|
namespace LibInput
|
|
|
|
{
|
|
|
|
class Connection;
|
|
|
|
}
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
/**
|
|
|
|
* @brief This class is responsible for redirecting incoming input to the surface which currently
|
|
|
|
* has input or send enter/leave events.
|
|
|
|
*
|
|
|
|
* In addition input is intercepted before passed to the surfaces to have KWin internal areas
|
|
|
|
* getting input first (e.g. screen edges) and filter the input event out if we currently have
|
|
|
|
* a full input grab.
|
|
|
|
*
|
|
|
|
*/
|
2015-06-26 14:47:08 +03:00
|
|
|
class KWIN_EXPORT InputRedirection : public QObject
|
2013-06-26 12:15:20 +04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum PointerButtonState {
|
|
|
|
PointerButtonReleased,
|
|
|
|
PointerButtonPressed
|
|
|
|
};
|
|
|
|
enum PointerAxis {
|
|
|
|
PointerAxisVertical,
|
|
|
|
PointerAxisHorizontal
|
|
|
|
};
|
2013-07-02 13:44:18 +04:00
|
|
|
enum KeyboardKeyState {
|
|
|
|
KeyboardKeyReleased,
|
2016-02-19 09:53:20 +03:00
|
|
|
KeyboardKeyPressed,
|
|
|
|
KeyboardKeyAutoRepeat
|
2013-07-02 13:44:18 +04:00
|
|
|
};
|
2013-06-26 12:15:20 +04:00
|
|
|
virtual ~InputRedirection();
|
2015-06-26 14:47:08 +03:00
|
|
|
void init();
|
2013-06-26 12:15:20 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return const QPointF& The current global pointer position
|
|
|
|
*/
|
2016-02-12 15:30:00 +03:00
|
|
|
QPointF globalPointer() const;
|
2013-06-26 16:32:03 +04:00
|
|
|
Qt::MouseButtons qtButtonStates() const;
|
2013-07-02 13:44:18 +04:00
|
|
|
Qt::KeyboardModifiers keyboardModifiers() const;
|
2016-12-26 16:19:56 +03:00
|
|
|
Qt::KeyboardModifiers modifiersRelevantForGlobalShortcuts() const;
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2013-07-10 13:41:16 +04:00
|
|
|
void registerShortcut(const QKeySequence &shortcut, QAction *action);
|
2015-02-19 12:38:49 +03:00
|
|
|
/**
|
|
|
|
* @overload
|
|
|
|
*
|
|
|
|
* Like registerShortcut, but also connects QAction::triggered to the @p slot on @p receiver.
|
|
|
|
* It's recommended to use this method as it ensures that the X11 timestamp is updated prior
|
|
|
|
* to the @p slot being invoked. If not using this overload it's required to ensure that
|
|
|
|
* registerShortcut is called before connecting to QAction's triggered signal.
|
|
|
|
**/
|
2017-07-18 22:12:37 +03:00
|
|
|
template <typename T, typename Slot>
|
|
|
|
void registerShortcut(const QKeySequence &shortcut, QAction *action, T *receiver, Slot slot);
|
2013-07-15 00:52:58 +04:00
|
|
|
void registerPointerShortcut(Qt::KeyboardModifiers modifiers, Qt::MouseButton pointerButtons, QAction *action);
|
2013-07-15 13:26:56 +04:00
|
|
|
void registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action);
|
2017-03-18 13:00:30 +03:00
|
|
|
void registerTouchpadSwipeShortcut(SwipeDirection direction, QAction *action);
|
2015-06-26 14:47:08 +03:00
|
|
|
void registerGlobalAccel(KGlobalAccelInterface *interface);
|
2013-07-10 13:41:16 +04:00
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
void processPointerMotion(const QPointF &pos, uint32_t time);
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
void processPointerButton(uint32_t button, PointerButtonState state, uint32_t time);
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
void processPointerAxis(PointerAxis axis, qreal delta, uint32_t time);
|
2013-07-02 13:44:18 +04:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
void processKeyboardKey(uint32_t key, KeyboardKeyState state, uint32_t time);
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
void processKeyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group);
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
**/
|
|
|
|
void processKeymapChange(int fd, uint32_t size);
|
2015-03-25 16:50:14 +03:00
|
|
|
void processTouchDown(qint32 id, const QPointF &pos, quint32 time);
|
|
|
|
void processTouchUp(qint32 id, quint32 time);
|
|
|
|
void processTouchMotion(qint32 id, const QPointF &pos, quint32 time);
|
|
|
|
void cancelTouch();
|
|
|
|
void touchFrame();
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2015-06-05 07:43:12 +03:00
|
|
|
bool supportsPointerWarping() const;
|
|
|
|
void warpPointer(const QPointF &pos);
|
|
|
|
|
2016-02-15 17:40:25 +03:00
|
|
|
/**
|
|
|
|
* Adds the @p filter to the list of event filters and makes it the first
|
|
|
|
* event filter in processing.
|
|
|
|
*
|
|
|
|
* Note: the event filter will get events before the lock screen can get them, thus
|
|
|
|
* this is a security relevant method.
|
|
|
|
**/
|
2017-01-02 22:13:30 +03:00
|
|
|
void prependInputEventFilter(InputEventFilter *filter);
|
2016-02-03 17:17:49 +03:00
|
|
|
void uninstallInputEventFilter(InputEventFilter *filter);
|
2016-12-27 22:16:50 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Installs the @p spy for spying on events.
|
|
|
|
**/
|
|
|
|
void installInputEventSpy(InputEventSpy *spy);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Uninstalls the @p spy. This happens automatically when deleting an InputEventSpy.
|
|
|
|
**/
|
|
|
|
void uninstallInputEventSpy(InputEventSpy *spy);
|
|
|
|
|
2016-02-03 17:17:49 +03:00
|
|
|
Toplevel *findToplevel(const QPoint &pos);
|
|
|
|
GlobalShortcutsManager *shortcuts() const {
|
|
|
|
return m_shortcuts;
|
|
|
|
}
|
|
|
|
|
2016-12-24 13:00:08 +03:00
|
|
|
/**
|
|
|
|
* Sends an event through all InputFilters.
|
|
|
|
* The method @p function is invoked on each input filter. Processing is stopped if
|
|
|
|
* a filter returns @c true for @p function.
|
|
|
|
*
|
2017-01-02 22:08:01 +03:00
|
|
|
* The UnaryPredicate is defined like the UnaryPredicate of std::any_of.
|
|
|
|
* The signature of the function should be equivalent to the following:
|
|
|
|
* @code
|
|
|
|
* bool function(const InputEventFilter *spy);
|
|
|
|
* @endcode
|
|
|
|
*
|
2016-12-24 13:00:08 +03:00
|
|
|
* The intended usage is to std::bind the method to invoke on the filter with all arguments
|
|
|
|
* bind.
|
|
|
|
**/
|
2017-01-02 22:08:01 +03:00
|
|
|
template <class UnaryPredicate>
|
|
|
|
void processFilters(UnaryPredicate function) {
|
|
|
|
std::any_of(m_filters.constBegin(), m_filters.constEnd(), function);
|
|
|
|
}
|
2016-12-24 13:00:08 +03:00
|
|
|
|
2016-12-27 22:16:50 +03:00
|
|
|
/**
|
|
|
|
* Sends an event through all input event spies.
|
|
|
|
* The @p function is invoked on each InputEventSpy.
|
|
|
|
*
|
|
|
|
* The UnaryFunction is defined like the UnaryFunction of std::for_each.
|
|
|
|
* The signature of the function should be equivalent to the following:
|
|
|
|
* @code
|
|
|
|
* void function(const InputEventSpy *spy);
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* The intended usage is to std::bind the method to invoke on the spies with all arguments
|
|
|
|
* bind.
|
|
|
|
**/
|
|
|
|
template <class UnaryFunction>
|
|
|
|
void processSpies(UnaryFunction function) {
|
|
|
|
std::for_each(m_spies.constBegin(), m_spies.constEnd(), function);
|
|
|
|
}
|
|
|
|
|
2016-02-15 15:42:48 +03:00
|
|
|
KeyboardInputRedirection *keyboard() const {
|
|
|
|
return m_keyboard;
|
|
|
|
}
|
2016-02-12 15:30:00 +03:00
|
|
|
PointerInputRedirection *pointer() const {
|
|
|
|
return m_pointer;
|
|
|
|
}
|
2016-02-15 11:36:59 +03:00
|
|
|
TouchInputRedirection *touch() const {
|
|
|
|
return m_touch;
|
|
|
|
}
|
2013-07-01 10:37:59 +04:00
|
|
|
|
2016-08-03 09:31:58 +03:00
|
|
|
bool hasAlphaNumericKeyboard();
|
|
|
|
|
2016-11-15 16:23:51 +03:00
|
|
|
void startInteractiveWindowSelection(std::function<void(KWin::Toplevel*)> callback, const QByteArray &cursorName);
|
2016-11-23 17:53:17 +03:00
|
|
|
void startInteractivePositionSelection(std::function<void(const QPoint &)> callback);
|
2016-11-15 16:23:51 +03:00
|
|
|
bool isSelectingWindow() const;
|
|
|
|
|
2016-11-25 09:17:43 +03:00
|
|
|
bool isBreakingPointerConstraints() const;
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
Q_SIGNALS:
|
|
|
|
/**
|
|
|
|
* @brief Emitted when the global pointer position changed
|
|
|
|
*
|
|
|
|
* @param pos The new global pointer position.
|
|
|
|
*/
|
|
|
|
void globalPointerChanged(const QPointF &pos);
|
|
|
|
/**
|
|
|
|
* @brief Emitted when the state of a pointer button changed.
|
|
|
|
*
|
|
|
|
* @param button The button which changed
|
|
|
|
* @param state The new button state
|
|
|
|
*/
|
2013-06-26 16:32:03 +04:00
|
|
|
void pointerButtonStateChanged(uint32_t button, InputRedirection::PointerButtonState state);
|
2013-06-26 12:15:20 +04:00
|
|
|
/**
|
|
|
|
* @brief Emitted when a pointer axis changed
|
|
|
|
*
|
|
|
|
* @param axis The axis on which the even occurred
|
|
|
|
* @param delta The delta of the event.
|
|
|
|
*/
|
2013-06-26 16:32:03 +04:00
|
|
|
void pointerAxisChanged(InputRedirection::PointerAxis axis, qreal delta);
|
2013-07-02 14:16:03 +04:00
|
|
|
/**
|
|
|
|
* @brief Emitted when the modifiers changes.
|
|
|
|
*
|
|
|
|
* Only emitted for the mask which is provided by Qt::KeyboardModifiers, if other modifiers
|
|
|
|
* change signal is not emitted
|
|
|
|
*
|
|
|
|
* @param newMods The new modifiers state
|
|
|
|
* @param oldMods The previous modifiers state
|
|
|
|
*/
|
|
|
|
void keyboardModifiersChanged(Qt::KeyboardModifiers newMods, Qt::KeyboardModifiers oldMods);
|
2015-08-31 09:55:26 +03:00
|
|
|
/**
|
|
|
|
* @brief Emitted when the state of a key changed.
|
|
|
|
*
|
|
|
|
* @param keyCode The keycode of the key which changed
|
|
|
|
* @param oldMods The new key state
|
|
|
|
*/
|
|
|
|
void keyStateChanged(quint32 keyCode, InputRedirection::KeyboardKeyState state);
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2016-08-03 09:31:58 +03:00
|
|
|
void hasAlphaNumericKeyboardChanged(bool set);
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
private:
|
2014-08-15 11:30:08 +04:00
|
|
|
void setupLibInput();
|
2017-05-07 02:40:48 +03:00
|
|
|
void setupTouchpadShortcuts();
|
2015-03-30 09:55:41 +03:00
|
|
|
void setupLibInputWithScreens();
|
2015-06-13 18:54:08 +03:00
|
|
|
void setupWorkspace();
|
2015-09-15 11:29:06 +03:00
|
|
|
void reconfigure();
|
2016-02-03 17:17:49 +03:00
|
|
|
void setupInputFilters();
|
|
|
|
void installInputEventFilter(InputEventFilter *filter);
|
2016-02-15 15:42:48 +03:00
|
|
|
KeyboardInputRedirection *m_keyboard;
|
2016-02-12 15:30:00 +03:00
|
|
|
PointerInputRedirection *m_pointer;
|
2016-02-15 11:36:59 +03:00
|
|
|
TouchInputRedirection *m_touch;
|
2013-06-26 12:15:20 +04:00
|
|
|
|
2013-07-10 13:41:16 +04:00
|
|
|
GlobalShortcutsManager *m_shortcuts;
|
|
|
|
|
2015-03-30 09:55:41 +03:00
|
|
|
LibInput::Connection *m_libInput = nullptr;
|
|
|
|
|
2016-11-15 16:23:51 +03:00
|
|
|
WindowSelectorFilter *m_windowSelector = nullptr;
|
2016-11-25 09:17:43 +03:00
|
|
|
PointerConstraintsFilter *m_pointerConstraintsFilter = nullptr;
|
2016-11-15 16:23:51 +03:00
|
|
|
|
2016-02-03 17:17:49 +03:00
|
|
|
QVector<InputEventFilter*> m_filters;
|
2016-12-27 22:16:50 +03:00
|
|
|
QVector<InputEventSpy*> m_spies;
|
2016-02-03 17:17:49 +03:00
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
KWIN_SINGLETON(InputRedirection)
|
|
|
|
friend InputRedirection *input();
|
2016-02-03 17:17:49 +03:00
|
|
|
friend class DecorationEventFilter;
|
|
|
|
friend class InternalWindowEventFilter;
|
|
|
|
friend class ForwardInputFilter;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for filtering input events inside InputRedirection.
|
|
|
|
*
|
|
|
|
* The idea behind the InputEventFilter is to have task oriented
|
|
|
|
* filters. E.g. there is one filter taking care of a locked screen,
|
|
|
|
* one to take care of interacting with window decorations, etc.
|
|
|
|
*
|
|
|
|
* A concrete subclass can reimplement the virtual methods and decide
|
|
|
|
* whether an event should be filtered out or not by returning either
|
|
|
|
* @c true or @c false. E.g. the lock screen filter can easily ensure
|
|
|
|
* that all events are filtered out.
|
|
|
|
*
|
|
|
|
* As soon as a filter returns @c true the processing is stopped. If
|
|
|
|
* a filter returns @c false the next one is invoked. This means a filter
|
|
|
|
* installed early gets to see more events than a filter installed later on.
|
|
|
|
*
|
|
|
|
* Deleting an instance of InputEventFilter automatically uninstalls it from
|
|
|
|
* InputRedirection.
|
|
|
|
**/
|
2016-02-15 17:40:25 +03:00
|
|
|
class KWIN_EXPORT InputEventFilter
|
2016-02-03 17:17:49 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
InputEventFilter();
|
|
|
|
virtual ~InputEventFilter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event filter for pointer events which can be described by a QMouseEvent.
|
|
|
|
*
|
|
|
|
* Please note that the button translation in QMouseEvent cannot cover all
|
|
|
|
* possible buttons. Because of that also the @p nativeButton code is passed
|
|
|
|
* through the filter. For internal areas it's fine to use @p event, but for
|
|
|
|
* passing to client windows the @p nativeButton should be used.
|
|
|
|
*
|
|
|
|
* @param event The event information about the move or button press/release
|
|
|
|
* @param nativeButton The native key code of the button, for move events 0
|
|
|
|
* @return @c true to stop further event processing, @c false to pass to next filter
|
|
|
|
**/
|
|
|
|
virtual bool pointerEvent(QMouseEvent *event, quint32 nativeButton);
|
|
|
|
/**
|
|
|
|
* Event filter for pointer axis events.
|
|
|
|
*
|
|
|
|
* @param event The event information about the axis event
|
|
|
|
* @return @c true to stop further event processing, @c false to pass to next filter
|
|
|
|
**/
|
|
|
|
virtual bool wheelEvent(QWheelEvent *event);
|
|
|
|
/**
|
|
|
|
* Event filter for keyboard events.
|
|
|
|
*
|
|
|
|
* @param event The event information about the key event
|
|
|
|
* @return @c tru to stop further event processing, @c false to pass to next filter.
|
|
|
|
**/
|
|
|
|
virtual bool keyEvent(QKeyEvent *event);
|
|
|
|
virtual bool touchDown(quint32 id, const QPointF &pos, quint32 time);
|
|
|
|
virtual bool touchMotion(quint32 id, const QPointF &pos, quint32 time);
|
|
|
|
virtual bool touchUp(quint32 id, quint32 time);
|
2016-08-05 15:35:33 +03:00
|
|
|
|
|
|
|
virtual bool pinchGestureBegin(int fingerCount, quint32 time);
|
|
|
|
virtual bool pinchGestureUpdate(qreal scale, qreal angleDelta, const QSizeF &delta, quint32 time);
|
|
|
|
virtual bool pinchGestureEnd(quint32 time);
|
|
|
|
virtual bool pinchGestureCancelled(quint32 time);
|
|
|
|
|
|
|
|
virtual bool swipeGestureBegin(int fingerCount, quint32 time);
|
|
|
|
virtual bool swipeGestureUpdate(const QSizeF &delta, quint32 time);
|
|
|
|
virtual bool swipeGestureEnd(quint32 time);
|
|
|
|
virtual bool swipeGestureCancelled(quint32 time);
|
2016-09-15 09:47:01 +03:00
|
|
|
|
2017-12-27 22:25:36 +03:00
|
|
|
virtual bool switchEvent(SwitchEvent *event);
|
|
|
|
|
2016-09-15 09:47:01 +03:00
|
|
|
protected:
|
|
|
|
void passToWaylandServer(QKeyEvent *event);
|
2013-06-26 12:15:20 +04:00
|
|
|
};
|
|
|
|
|
2016-05-12 17:33:03 +03:00
|
|
|
class InputDeviceHandler : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~InputDeviceHandler();
|
|
|
|
|
|
|
|
QPointer<Toplevel> window() const {
|
|
|
|
return m_window;
|
|
|
|
}
|
|
|
|
QPointer<Decoration::DecoratedClientImpl> decoration() const {
|
|
|
|
return m_decoration;
|
|
|
|
}
|
2016-05-23 18:07:08 +03:00
|
|
|
QPointer<QWindow> internalWindow() const {
|
|
|
|
return m_internalWindow;
|
|
|
|
}
|
2016-05-12 17:33:03 +03:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void decorationChanged();
|
2016-05-23 18:07:08 +03:00
|
|
|
void internalWindowChanged();
|
2016-05-12 17:33:03 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
explicit InputDeviceHandler(InputRedirection *parent);
|
|
|
|
void updateDecoration(Toplevel *t, const QPointF &pos);
|
2016-05-23 18:07:08 +03:00
|
|
|
void updateInternalWindow(const QPointF &pos);
|
2016-05-12 17:33:03 +03:00
|
|
|
InputRedirection *m_input;
|
|
|
|
/**
|
|
|
|
* @brief The Toplevel which currently receives events
|
|
|
|
*/
|
|
|
|
QPointer<Toplevel> m_window;
|
|
|
|
/**
|
|
|
|
* @brief The Decoration which currently receives events.
|
|
|
|
**/
|
|
|
|
QPointer<Decoration::DecoratedClientImpl> m_decoration;
|
2016-05-23 18:07:08 +03:00
|
|
|
QPointer<QWindow> m_internalWindow;
|
2016-05-12 17:33:03 +03:00
|
|
|
};
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
inline
|
|
|
|
InputRedirection *input()
|
|
|
|
{
|
|
|
|
return InputRedirection::s_self;
|
|
|
|
}
|
|
|
|
|
2017-07-18 22:12:37 +03:00
|
|
|
template <typename T, typename Slot>
|
2015-02-19 12:38:49 +03:00
|
|
|
inline
|
2017-07-18 22:12:37 +03:00
|
|
|
void InputRedirection::registerShortcut(const QKeySequence &shortcut, QAction *action, T *receiver, Slot slot) {
|
2015-02-19 12:38:49 +03:00
|
|
|
registerShortcut(shortcut, action);
|
|
|
|
connect(action, &QAction::triggered, receiver, slot);
|
|
|
|
}
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
} // namespace KWin
|
|
|
|
|
2015-09-02 11:10:49 +03:00
|
|
|
Q_DECLARE_METATYPE(KWin::InputRedirection::KeyboardKeyState)
|
|
|
|
Q_DECLARE_METATYPE(KWin::InputRedirection::PointerButtonState)
|
|
|
|
Q_DECLARE_METATYPE(KWin::InputRedirection::PointerAxis)
|
|
|
|
|
2013-06-26 12:15:20 +04:00
|
|
|
#endif // KWIN_INPUT_H
|