Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cursor edge detection in fullscreen #6604

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/managers/PointerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ void CPointerManager::setCursorBuffer(wlr_buffer* buf, const Vector2D& hotspot,
currentCursorImage.size = {buf->width, buf->height};
currentCursorImage.pBuffer = wlr_buffer_lock(buf);

currentCursorImage.hyprListener_destroyBuffer.initCallback(
&buf->events.destroy, [this](void* owner, void* data) { resetCursorImage(); }, this, "CPointerManager");
currentCursorImage.hyprListener_destroyBuffer.initCallback(&buf->events.destroy, [this](void* owner, void* data) { resetCursorImage(); }, this, "CPointerManager");
}

currentCursorImage.hotspot = hotspot;
Expand Down Expand Up @@ -610,8 +609,9 @@ 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
CBox hotBox = {{pos.x - CURSOR_PADDING, pos.y - CURSOR_PADDING}, {2 * CURSOR_PADDING, 2 * CURSOR_PADDING}};
auto CURSOR_PADDING =
std::clamp((int)*PADDING, 0, 100); // some applications (like firefox) need this to be 0px so they properly detect when the cursor reaches the monitor edge
CBox hotBox = {{pos.x - CURSOR_PADDING, pos.y - CURSOR_PADDING}, {2 * CURSOR_PADDING, 2 * CURSOR_PADDING}};

//
static auto INSIDE_LAYOUT = [this](const CBox& box) -> bool {
Expand Down
Loading