Compare commits

...

13 Commits

Author SHA1 Message Date
drendog 32748932d1
Merge 712916a450 into 9c5dd59d4b 2024-06-28 22:24:24 +00:00
Vaxry 9c5dd59d4b input: fix capabilities enum types passed
hyprland down to the seat protocol impl expects IHID capabilities, not WL_ ones

ref #6702 #6196
2024-06-29 00:23:02 +02:00
Vaxry d16c6aa1db pointer-constraint: set lifetime correctly
ref #6679
2024-06-29 00:18:24 +02:00
drendog 712916a450 refactor: max coords to vector 2024-06-27 21:10:56 +02:00
drendog d26128c705 fix: deal with floating point to clamp to prev value 2024-06-25 21:17:22 +02:00
drendog 367ff516ef
Merge branch 'hyprwm:main' into fix/cursor-min-padding 2024-06-25 09:46:46 +02:00
drendog b81aa11c8b fix: adjusting clamp after getting closest point to fix getting off limit point 2024-06-24 14:09:59 +02:00
drendog fbfb470bde
Merge branch 'hyprwm:main' into fix/cursor-min-padding 2024-06-23 00:27:30 +02:00
drendog e58589f797
Merge branch 'main' into fix/cursor-min-padding 2024-06-16 17:54:23 +02:00
drendog 04fe914737
Merge branch 'hyprwm:main' into fix/cursor-min-padding 2024-06-10 23:41:38 +02:00
drendog 4e753b25a9
Merge branch 'hyprwm:main' into fix/cursor-min-padding 2024-05-23 00:13:55 +02:00
drendog e089662ae2 chore: set default hotspot padding to 0 2024-05-12 00:52:33 +02:00
drendog dc470480a6 fix: change min cursor padding to 0 2024-05-11 23:49:23 +02:00
5 changed files with 16 additions and 17 deletions

View File

@ -525,7 +525,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("cursor:no_hardware_cursors", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:no_break_fs_vrr", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:min_refresh_rate", Hyprlang::INT{24});
m_pConfig->addConfigValue("cursor:hotspot_padding", Hyprlang::INT{1});
m_pConfig->addConfigValue("cursor:hotspot_padding", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:inactive_timeout", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:no_warps", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:persistent_warps", Hyprlang::INT{0});

View File

@ -612,7 +612,7 @@ CBox CPointerManager::getCursorBoxGlobal() {
Vector2D CPointerManager::closestValid(const Vector2D& pos) {
static auto PADDING = CConfigValue<Hyprlang::INT>("cursor:hotspot_padding");
auto CURSOR_PADDING = std::clamp((int)*PADDING, 1, 100); // 1px
auto CURSOR_PADDING = std::clamp((int)*PADDING, 0, 100);
CBox hotBox = {{pos.x - CURSOR_PADDING, pos.y - CURSOR_PADDING}, {2 * CURSOR_PADDING, 2 * CURSOR_PADDING}};
//
@ -637,7 +637,13 @@ Vector2D CPointerManager::closestValid(const Vector2D& pos) {
float distanceSq = __FLT_MAX__;
for (auto& b : currentMonitorLayout.monitorBoxes) {
auto p = b.closestPoint(vec);
auto p = b.closestPoint(vec);
auto maxPoint = Vector2D{std::nextafter(b.x + b.w, -INFINITY), std::nextafter(b.y + b.h, -INFINITY)};
// because closestPoint clamps up to x + w and y + h
p = Vector2D{std::clamp(p.x, b.x, maxPoint.x), std::clamp(p.y, b.y, maxPoint.y)};
auto distSq = p.distanceSq(vec);
if (distSq < distanceSq) {

View File

@ -1473,14 +1473,7 @@ void CInputManager::updateCapabilities() {
if (h.expired())
continue;
auto cap = h->getCapabilities();
if (cap & HID_INPUT_CAPABILITY_KEYBOARD)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
if (cap & HID_INPUT_CAPABILITY_POINTER)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (cap & HID_INPUT_CAPABILITY_TOUCH)
caps |= WL_SEAT_CAPABILITY_TOUCH;
caps |= h->getCapabilities();
}
g_pSeatManager->updateCapabilities(caps);

View File

@ -7,8 +7,8 @@
#define LOGM PROTO::constraints->protoLog
CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime) :
resourceL(resource_), locked(true) {
CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime_) :
resourceL(resource_), locked(true), lifetime(lifetime_) {
if (!resource_->resource())
return;
@ -46,8 +46,8 @@ CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWL
sharedConstructions();
}
CPointerConstraint::CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime) :
resourceC(resource_), locked(false) {
CPointerConstraint::CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime_) :
resourceC(resource_), locked(false), lifetime(lifetime_) {
if (!resource_->resource())
return;

View File

@ -16,8 +16,8 @@ class CWLSurfaceResource;
class CPointerConstraint {
public:
CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime);
CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime);
CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime_);
CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime_);
~CPointerConstraint();
bool good();