input: use MouseEvent instead of QMouseEvent
This commit is contained in:
parent
0777d076e6
commit
3d92f5b75f
10 changed files with 25 additions and 24 deletions
|
@ -28,7 +28,7 @@ DpmsInputEventFilter::DpmsInputEventFilter()
|
|||
|
||||
DpmsInputEventFilter::~DpmsInputEventFilter() = default;
|
||||
|
||||
bool DpmsInputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||
bool DpmsInputEventFilter::pointerEvent(MouseEvent *event, quint32 nativeButton)
|
||||
{
|
||||
notify();
|
||||
return true;
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
DpmsInputEventFilter();
|
||||
~DpmsInputEventFilter() override;
|
||||
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override;
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override;
|
||||
bool wheelEvent(QWheelEvent *event) override;
|
||||
bool keyEvent(QKeyEvent *event) override;
|
||||
bool touchDown(qint32 id, const QPointF &pos, quint32 time) override;
|
||||
|
|
|
@ -105,7 +105,7 @@ InputEventFilter::~InputEventFilter()
|
|||
}
|
||||
}
|
||||
|
||||
bool InputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||
bool InputEventFilter::pointerEvent(MouseEvent *event, quint32 nativeButton)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ public:
|
|||
class LockScreenFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (!waylandServer()->isScreenLocked()) {
|
||||
return false;
|
||||
|
@ -508,7 +508,7 @@ private:
|
|||
class EffectsFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (!effects) {
|
||||
return false;
|
||||
|
@ -593,7 +593,7 @@ public:
|
|||
class MoveResizeFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
Window *window = workspace()->moveResizeWindow();
|
||||
if (!window) {
|
||||
|
@ -703,7 +703,7 @@ private:
|
|||
class WindowSelectorFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (!m_active) {
|
||||
return false;
|
||||
|
@ -874,7 +874,7 @@ public:
|
|||
m_powerDown.setInterval(1000);
|
||||
}
|
||||
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress) {
|
||||
if (input()->shortcuts()->processPointerPressed(event->modifiers(), event->buttons())) {
|
||||
|
@ -1176,7 +1176,7 @@ std::pair<bool, bool> performWindowWheelAction(QWheelEvent *event, Window *windo
|
|||
|
||||
class InternalWindowEventFilter : public InputEventFilter
|
||||
{
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (!input()->pointer()->focus() || !input()->pointer()->focus()->isInternal()) {
|
||||
return false;
|
||||
|
@ -1346,7 +1346,7 @@ private:
|
|||
class DecorationEventFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
auto decoration = input()->pointer()->decoration();
|
||||
if (!decoration) {
|
||||
|
@ -1558,7 +1558,7 @@ private:
|
|||
class TabBoxInputFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 button) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 button) override
|
||||
{
|
||||
if (!workspace()->tabbox() || !workspace()->tabbox()->isGrabbed()) {
|
||||
return false;
|
||||
|
@ -1597,7 +1597,7 @@ public:
|
|||
class ScreenEdgeInputFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
workspace()->screenEdges()->isEntered(event);
|
||||
// always forward
|
||||
|
@ -1653,7 +1653,7 @@ private:
|
|||
class WindowActionInputFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
if (event->type() != QEvent::MouseButtonPress) {
|
||||
return false;
|
||||
|
@ -1734,7 +1734,7 @@ public:
|
|||
class ForwardInputFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
auto seat = waylandServer()->seat();
|
||||
seat->setTimestamp(event->timestamp());
|
||||
|
@ -2343,7 +2343,7 @@ public:
|
|||
connect(&m_raiseTimer, &QTimer::timeout, this, &DragAndDropInputFilter::raiseDragTarget);
|
||||
}
|
||||
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override
|
||||
{
|
||||
auto seat = waylandServer()->seat();
|
||||
if (!seat->isDragPointer()) {
|
||||
|
|
|
@ -45,6 +45,7 @@ class SwitchEvent;
|
|||
class TabletEvent;
|
||||
class TabletToolId;
|
||||
class TabletPadId;
|
||||
class MouseEvent;
|
||||
|
||||
namespace Decoration
|
||||
{
|
||||
|
@ -383,7 +384,7 @@ public:
|
|||
* @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);
|
||||
virtual bool pointerEvent(MouseEvent *event, quint32 nativeButton);
|
||||
/**
|
||||
* Event filter for pointer axis events.
|
||||
*
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
bool PlaceholderInputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||
bool PlaceholderInputEventFilter::pointerEvent(MouseEvent *event, quint32 nativeButton)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace KWin
|
|||
class PlaceholderInputEventFilter : public InputEventFilter
|
||||
{
|
||||
public:
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override;
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override;
|
||||
bool wheelEvent(QWheelEvent *event) override;
|
||||
bool keyEvent(QKeyEvent *event) override;
|
||||
bool touchDown(qint32 id, const QPointF &pos, quint32 time) override;
|
||||
|
|
|
@ -196,7 +196,7 @@ void ButtonRebindsFilter::loadConfig(const KConfigGroup &group)
|
|||
}
|
||||
}
|
||||
|
||||
bool ButtonRebindsFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||
bool ButtonRebindsFilter::pointerEvent(KWin::MouseEvent *event, quint32 nativeButton)
|
||||
{
|
||||
if (event->type() != QEvent::MouseButtonPress && event->type() != QEvent::MouseButtonRelease) {
|
||||
return false;
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
};
|
||||
|
||||
explicit ButtonRebindsFilter();
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override;
|
||||
bool pointerEvent(KWin::MouseEvent *event, quint32 nativeButton) override;
|
||||
bool tabletPadButtonEvent(uint button, bool pressed, const KWin::TabletPadId &tabletPadId, uint time) override;
|
||||
bool tabletToolButtonEvent(uint button, bool pressed, const KWin::TabletToolId &tabletToolId, uint time) override;
|
||||
|
||||
|
|
|
@ -6,14 +6,13 @@
|
|||
*/
|
||||
#include "popup_input_filter.h"
|
||||
#include "deleted.h"
|
||||
#include "input_event.h"
|
||||
#include "internalwindow.h"
|
||||
#include "wayland/seat_interface.h"
|
||||
#include "wayland_server.h"
|
||||
#include "window.h"
|
||||
#include "workspace.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -41,7 +40,8 @@ void PopupInputFilter::handleWindowRemoved(Window *window)
|
|||
{
|
||||
m_popupWindows.removeOne(window);
|
||||
}
|
||||
bool PopupInputFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton)
|
||||
|
||||
bool PopupInputFilter::pointerEvent(MouseEvent *event, quint32 nativeButton)
|
||||
{
|
||||
if (m_popupWindows.isEmpty()) {
|
||||
return false;
|
||||
|
|
|
@ -20,7 +20,7 @@ class PopupInputFilter : public QObject, public InputEventFilter
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit PopupInputFilter();
|
||||
bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override;
|
||||
bool pointerEvent(MouseEvent *event, quint32 nativeButton) override;
|
||||
bool keyEvent(QKeyEvent *event) override;
|
||||
bool touchDown(qint32 id, const QPointF &pos, quint32 time) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue