diff options
author | johannes hanika <[email protected]> | 2024-11-18 15:02:34 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-11-18 14:26:44 +0000 |
commit | 53e8513000e0d046d687f8226d1db60edac1c83d (patch) | |
tree | c89646694a955166f2e73e2e197dc9b967d8e0bb /src | |
parent | 7976bfa2df502668ea0b5b623c81c5ca0b48e957 (diff) | |
download | Hyprland-53e8513000e0d046d687f8226d1db60edac1c83d.tar.gz Hyprland-53e8513000e0d046d687f8226d1db60edac1c83d.zip |
constraints: don't warp pointer position on release (#8491)
this was annoying for nuklear properties/ui slider elements that grab
the pointer via GLFW_CURSOR_DISABLE to allow more range and finer control.
upon mouse release, the pointer is reset to the middle of the window
without this patch, making long mouse movements necessary to go back
to the original position for readjustments. fwiw the new behaviour
is consistent with x11 and weston.
Diffstat (limited to 'src')
-rw-r--r-- | src/protocols/PointerConstraints.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/protocols/PointerConstraints.cpp b/src/protocols/PointerConstraints.cpp index 0f2dd991..7f08a7df 100644 --- a/src/protocols/PointerConstraints.cpp +++ b/src/protocols/PointerConstraints.cpp @@ -188,7 +188,7 @@ Vector2D CPointerConstraint::logicPositionHint() { const auto SURFBOX = pHLSurface->getSurfaceBoxGlobal(); const auto CONSTRAINTPOS = SURFBOX.has_value() ? SURFBOX->pos() : Vector2D{}; - return hintSet ? CONSTRAINTPOS + positionHint : (locked ? CONSTRAINTPOS + SURFBOX->size() / 2.f : cursorPosOnActivate); + return hintSet ? CONSTRAINTPOS + positionHint : cursorPosOnActivate; } CPointerConstraintsProtocol::CPointerConstraintsProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { |