Specialize StateDragging for wayland
Introduces StateDraggingWayland. Wayland is the alien, so don't want to introduce hacks in the existing clean code. StateDraggingWayland will deal with the wayland workarounds. Although the impl only has placeholders for now I'm committing it because it's already an improvement: broken detachment is no longer possible. Detached windows were going to a random place on screen.
This commit is contained in:
@@ -128,6 +128,7 @@ public:
|
||||
bool handleMouseButtonRelease(QPoint) override;
|
||||
};
|
||||
|
||||
// Used on all platforms except Wayland. @see StateDraggingWayland
|
||||
class StateDragging : public StateBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -139,6 +140,18 @@ public:
|
||||
bool handleMouseMove(QPoint globalPos) override;
|
||||
};
|
||||
|
||||
// Used on wayland only to use QDrag instead of setting geometry on mouse-move.
|
||||
class StateDraggingWayland : public StateDragging
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit StateDraggingWayland(DragController *parent);
|
||||
~StateDraggingWayland() override;
|
||||
void onEntry(QEvent *) override;
|
||||
bool handleMouseButtonRelease(QPoint globalPos) override;
|
||||
bool handleMouseMove(QPoint globalPos) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user