summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-23 14:18:38 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-23 15:30:35 -0600
commitbf8cc526deab39e269da219667ae24b6f8adecc7 (patch)
tree34f58e72b3eca19e2b5596877e7ac2f66cfd0e98
parent7a2e0eef746950f6ac0863dcbb5c957836a6d8fc (diff)
set position of the drag icon in startdrag()
-rw-r--r--dwl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/dwl.c b/dwl.c
index ce53dfa..536b4d6 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1415,21 +1415,20 @@ motionnotify(uint32_t time)
double sx = 0, sy = 0;
Client *c = NULL;
struct wlr_surface *surface = NULL;
+ struct wlr_drag_icon *icon;
/* 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 (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 */
if (cursor_mode == CurMove) {
/* Move the grabbed client to the new position. */
@@ -2081,7 +2080,7 @@ startdrag(struct wl_listener *listener, void *data)
return;
drag->icon->data = wlr_scene_subsurface_tree_create(layers[LyrTop], drag->icon->surface);
- wlr_scene_node_raise_to_top(drag->icon->data);
+ motionnotify(0);
wl_signal_add(&drag->icon->events.destroy, &drag_icon_destroy);
}