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:
Vaxry
2024-03-02 21:04:55 +00:00
committed by GitHub
parent 328ab43165
commit d72ea5f2a7
14 changed files with 282 additions and 386 deletions

View File

@@ -2,6 +2,7 @@
#include "../defines.hpp"
#include "../helpers/Region.hpp"
#include "Constraint.hpp"
class CWindow;
struct SLayerSurface;
@@ -32,6 +33,7 @@ class CWLSurface {
Vector2D correctSmallVec() const; // returns a corrective vector for small() surfaces
Vector2D getViewporterCorrectedSize() const;
CRegion logicalDamage() const;
void onCommit();
// getters for owners.
CWindow* getWindow();
@@ -41,6 +43,8 @@ class CWLSurface {
// desktop components misc utils
std::optional<CBox> getSurfaceBoxGlobal();
void appendConstraint(wlr_pointer_constraint_v1* constraint);
CConstraint* constraint();
// allow stretching. Useful for plugins.
bool m_bFillIgnoreSmall = false;
@@ -72,6 +76,8 @@ class CWLSurface {
}
static CWLSurface* surfaceFromWlr(wlr_surface* pSurface) {
if (!pSurface)
return nullptr;
return (CWLSurface*)pSurface->data;
}
@@ -85,9 +91,15 @@ class CWLSurface {
CPopup* m_pPopupOwner = nullptr;
CSubsurface* m_pSubsurfaceOwner = nullptr;
void destroy();
void init();
bool desktopComponent();
//
std::unique_ptr<CConstraint> m_pConstraint;
void destroy();
void init();
bool desktopComponent();
DYNLISTENER(destroy);
DYNLISTENER(commit);
friend class CConstraint;
};