commit f6820a6c29b6bcb9a14166793d7f1fba2f98444e
parent 87c4c1f62947d927084e3b2cca224dba72e9f0fb
Author: Leonardo Hernández Hernández <leohdz172@protonmail.com>
Date: Fri, 7 Oct 2022 00:02:29 -0500
fix drag and drop not working
this fixes another issue where the cursor doesn't change when selecting text
but there is still an issue about not changing border color of clients during
dnd operations
Bug: https://github.com/djpohly/dwl/issues/318
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dwl.c b/dwl.c
@@ -1535,7 +1535,7 @@ motionnotify(uint32_t time)
/* Find the client under the pointer and send the event along. */
xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
- if (cursor_mode == CurPressed) {
+ if (cursor_mode == CurPressed && !seat->drag) {
surface = seat->pointer_state.focused_surface;
c = client_from_wlr_surface(surface);
sx = c ? cursor->x - c->geom.x : 0;
@@ -1545,7 +1545,7 @@ motionnotify(uint32_t time)
/* If there's no client surface under the cursor, set the cursor image to a
* default. This is what makes the cursor image appear when you move it
* off of a client or over its border. */
- if (!surface && (!cursor_image || strcmp(cursor_image, "left_ptr")))
+ if (!surface && !seat->drag && (!cursor_image || strcmp(cursor_image, "left_ptr")))
wlr_xcursor_manager_set_cursor_image(cursor_mgr, (cursor_image = "left_ptr"), cursor);
pointerfocus(c, surface, sx, sy, time);
@@ -1906,7 +1906,7 @@ setcursor(struct wl_listener *listener, void *data)
/* If we're "grabbing" the cursor, don't use the client's image, we will
* restore it after "grabbing" sending a leave event, followed by a enter
* event, which will result in the client requesting set the cursor surface */
- if (cursor_mode != CurNormal)
+ if (cursor_mode != CurNormal && cursor_mode != CurPressed)
return;
cursor_image = NULL;
/* This can be sent by any client, so we check to make sure this one is