input: Rewritten pointer constraints (#4889)
* rewritten constraints * send pointer enter on activate if not pointer focus * minor cleanup * simulate movement on commit * don't ignore oneshot prop * various fixes * dont send motion on confined * update pos hint on region change
This commit is contained in:
parent
328ab43165
commit
d72ea5f2a7
14 changed files with 282 additions and 386 deletions
44
src/desktop/Constraint.hpp
Normal file
44
src/desktop/Constraint.hpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
|
||||
#include "../includes.hpp"
|
||||
#include "../helpers/Region.hpp"
|
||||
#include "../helpers/WLListener.hpp"
|
||||
|
||||
class CWLSurface;
|
||||
|
||||
class CConstraint {
|
||||
public:
|
||||
CConstraint(wlr_pointer_constraint_v1* constraint, CWLSurface* owner);
|
||||
~CConstraint();
|
||||
|
||||
void onCommit();
|
||||
void onDestroy();
|
||||
void onSetRegion();
|
||||
CRegion logicConstraintRegion();
|
||||
bool isLocked();
|
||||
Vector2D logicPositionHint();
|
||||
|
||||
void deactivate();
|
||||
void activate();
|
||||
bool active();
|
||||
|
||||
CWLSurface* owner();
|
||||
|
||||
private:
|
||||
bool m_bActive = false;
|
||||
CWLSurface* m_pOwner = nullptr;
|
||||
wlr_pointer_constraint_v1* m_pConstraint;
|
||||
|
||||
CRegion m_rRegion;
|
||||
bool m_bHintSet = false;
|
||||
Vector2D m_vPositionHint = {-1, -1};
|
||||
Vector2D m_vCursorPosOnActivate = {-1, -1};
|
||||
|
||||
// for oneshot constraints that have been activated once
|
||||
bool m_bDead = false;
|
||||
|
||||
DYNLISTENER(destroyConstraint);
|
||||
DYNLISTENER(setConstraintRegion);
|
||||
|
||||
void initSignals();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue