mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-26 11:16:30 +00:00
clients now works as expected in drag motion
This commit is contained in:
parent
f2be10fd43
commit
d8ab893dab
1 changed files with 8 additions and 5 deletions
13
dwl.c
13
dwl.c
|
@ -1289,16 +1289,11 @@ motionnotify(uint32_t time)
|
||||||
|
|
||||||
/* time is 0 in internal calls meant to restore pointer focus. */
|
/* time is 0 in internal calls meant to restore pointer focus. */
|
||||||
if (time) {
|
if (time) {
|
||||||
struct wlr_drag_icon *icon;
|
|
||||||
wlr_idle_notify_activity(idle, seat);
|
wlr_idle_notify_activity(idle, seat);
|
||||||
|
|
||||||
/* Update selmon (even while dragging a window) */
|
/* Update selmon (even while dragging a window) */
|
||||||
if (sloppyfocus)
|
if (sloppyfocus)
|
||||||
selmon = xytomon(cursor->x, cursor->y);
|
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 */
|
/* If we are currently grabbing the mouse, handle and return */
|
||||||
|
@ -1437,6 +1432,7 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
||||||
{
|
{
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
int internal_call = !time;
|
int internal_call = !time;
|
||||||
|
struct wlr_drag_icon *icon;
|
||||||
|
|
||||||
if (sloppyfocus && !internal_call && c && !client_is_unmanaged(c))
|
if (sloppyfocus && !internal_call && c && !client_is_unmanaged(c))
|
||||||
focusclient(c, 0);
|
focusclient(c, 0);
|
||||||
|
@ -1458,6 +1454,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
||||||
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
|
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
|
||||||
wlr_seat_pointer_notify_motion(seat, time, 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
|
void
|
||||||
|
|
Loading…
Reference in a new issue