mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 12:25:59 +01:00
input-capture: Init active property & upstream protocol changes
This commit is contained in:
parent
6c211d49b5
commit
124582b8d2
4 changed files with 7 additions and 8 deletions
|
@ -674,8 +674,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;
|
||||
|
|
|
@ -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) {
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
@ -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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 53a994b2efbcc19862125fc9a8d5a752a24a0f20
|
||||
Subproject commit 479cc226451c264396a4c442710d6b56dce2fa46
|
Loading…
Reference in a new issue