From f6820a6c29b6bcb9a14166793d7f1fba2f98444e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Fri, 7 Oct 2022 00:02:29 -0500 Subject: [PATCH] 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 --- dwl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwl.c b/dwl.c index 5f9cbcd..fc8f7b2 100644 --- 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