mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-26 19:26:32 +00:00
pointerfocus: only use provided surface
if a client is given focus it
This commit is contained in:
parent
1b22ef1616
commit
0815626d4c
1 changed files with 6 additions and 16 deletions
22
dwl.c
22
dwl.c
|
@ -1540,9 +1540,8 @@ 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;
|
||||||
|
|
||||||
/* Use top level surface if nothing more specific given */
|
if (sloppyfocus && !internal_call && c && !client_is_unmanaged(c))
|
||||||
if (c && !surface)
|
focusclient(c, 0);
|
||||||
surface = client_surface(c);
|
|
||||||
|
|
||||||
/* If surface is NULL, clear pointer focus */
|
/* If surface is NULL, clear pointer focus */
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
|
@ -1555,21 +1554,12 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
||||||
time = now.tv_sec * 1000 + now.tv_nsec / 1000000;
|
time = now.tv_sec * 1000 + now.tv_nsec / 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If surface is already focused, only notify of motion */
|
/* Let the client know that the mouse cursor has entered one
|
||||||
if (surface == seat->pointer_state.focused_surface) {
|
* of its surfaces, and make keyboard focus follow if desired.
|
||||||
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
|
* wlroots makes this a no-op if surface is already focused */
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Otherwise, let the client know that the mouse cursor has entered one
|
|
||||||
* of its surfaces, and make keyboard focus follow if desired. */
|
|
||||||
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);
|
||||||
|
|
||||||
if (!c || client_is_unmanaged(c))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (sloppyfocus && !internal_call)
|
|
||||||
focusclient(c, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue