Skip to content

Commit

Permalink
input-capture: Init active property & upstream protocol changes
Browse files Browse the repository at this point in the history
  • Loading branch information
3l0w committed Sep 30, 2024
1 parent a0869bb commit d22653e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/managers/PointerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ void CPointerManager::move(const Vector2D& deltaLogical) {
const auto oldPos = pointerPos;
auto newPos = oldPos + Vector2D{std::isnan(deltaLogical.x) ? 0.0 : deltaLogical.x, std::isnan(deltaLogical.y) ? 0.0 : deltaLogical.y};

PROTO::inputCapture->sendAbsoluteMotion(newPos, deltaLogical);
PROTO::inputCapture->sendMotion(newPos, deltaLogical);

if (PROTO::inputCapture->isCaptured())
return;
Expand Down
6 changes: 3 additions & 3 deletions src/protocols/InputCapture.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "InputCapture.hpp"

CInputCaptureProtocol::CInputCaptureProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
active = false;
;
}

void CInputCaptureProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
Expand Down Expand Up @@ -31,9 +31,9 @@ bool CInputCaptureProtocol::isCaptured() {
return active;
}

void CInputCaptureProtocol::sendAbsoluteMotion(const Vector2D& absolutePosition, const Vector2D& delta) {
void CInputCaptureProtocol::sendMotion(const Vector2D& absolutePosition, const Vector2D& delta) {
for (const UP<CHyprlandInputCaptureManagerV1>& manager : m_vManagers) {
manager->sendAbsoluteMotion(wl_fixed_from_double(absolutePosition.x), wl_fixed_from_double(absolutePosition.y), wl_fixed_from_double(delta.x),
manager->sendMotion(wl_fixed_from_double(absolutePosition.x), wl_fixed_from_double(absolutePosition.y), wl_fixed_from_double(delta.x),
wl_fixed_from_double(delta.y));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/InputCapture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CInputCaptureProtocol : public IWaylandProtocol {
bool isCaptured();

//
void sendAbsoluteMotion(const Vector2D& absolutePosition, const Vector2D& delta);
void sendMotion(const Vector2D& absolutePosition, const Vector2D& delta);
void sendKey(uint32_t keyCode, hyprlandInputCaptureManagerV1KeyState state);
void sendButton(uint32_t button, hyprlandInputCaptureManagerV1ButtonState state);
void sendAxis(hyprlandInputCaptureManagerV1Axis axis, double value);
Expand All @@ -22,7 +22,7 @@ class CInputCaptureProtocol : public IWaylandProtocol {
void sendFrame();

private:
bool active;
bool active = false;

void onManagerResourceDestroy(wl_resource* res);
void onCapture(CHyprlandInputCaptureManagerV1* pMgr);
Expand Down
2 changes: 1 addition & 1 deletion subprojects/hyprland-protocols

0 comments on commit d22653e

Please sign in to comment.