summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-23 12:13:49 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-23 15:29:32 -0600
commit7a2e0eef746950f6ac0863dcbb5c957836a6d8fc (patch)
tree9dd72995c777edb0264f5eb52aa371c87c8264cd
parent3bace9ce6b9d5fa7c8871a414ed97976e44ecb9c (diff)
Revert "clients now works as expected in drag motion"
This reverts commit 9aec6049ecbefe3618f34002d2239cc9462c07e9. this problem is caused because xytonode() returns the surface of the drag icon
-rw-r--r--dwl.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/dwl.c b/dwl.c
index 65d1381..ce53dfa 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1418,11 +1418,16 @@ motionnotify(uint32_t time)
/* time is 0 in internal calls meant to restore pointer focus. */
if (time) {
+ struct wlr_drag_icon *icon;
wlr_idle_notify_activity(idle, seat);
/* Update selmon (even while dragging a window) */
if (sloppyfocus)
selmon = xytomon(cursor->x, cursor->y);
+
+ if (seat->drag && (icon = seat->drag->icon))
+ wlr_scene_node_set_position(icon->data, cursor->x + icon->surface->sx,
+ cursor->y + icon->surface->sy);
}
/* If we are currently grabbing the mouse, handle and return */
@@ -1561,7 +1566,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
{
struct timespec now;
int internal_call = !time;
- struct wlr_drag_icon *icon;
if (sloppyfocus && !internal_call && c && !client_is_unmanaged(c))
focusclient(c, 0);
@@ -1583,13 +1587,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
- /* If there are is a drag icon, update its position */
- /* For anyone who wants to change this function: for some reason
- * (maybe a wlroots bug?, or is it intended?) if we change the node position
- * before telling the seat for a motion, the clients don't recognize the drag */
- if (seat->drag && (icon = seat->drag->icon))
- wlr_scene_node_set_position(icon->data, cursor->x + icon->surface->sx,
- cursor->y + icon->surface->sy);
}
void