mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-11-05 06:24:16 +00:00
Make sure to not pass NULL surfaces to these wlr functions
Turns out that this will hit asserts that will abort dwl.
This commit is contained in:
parent
df10c475ad
commit
59e0047d91
8
dwl.c
8
dwl.c
@ -597,7 +597,7 @@ focusclient(Client *c, struct wlr_surface *surface, int lift)
|
|||||||
* automatically send key events to the appropriate clients. If surface
|
* automatically send key events to the appropriate clients. If surface
|
||||||
* is NULL, this will clear focus.
|
* is NULL, this will clear focus.
|
||||||
*/
|
*/
|
||||||
if (surface != psurface) {
|
if (surface && (surface != psurface)) {
|
||||||
kb = wlr_seat_get_keyboard(seat);
|
kb = wlr_seat_get_keyboard(seat);
|
||||||
wlr_seat_keyboard_notify_enter(seat, surface,
|
wlr_seat_keyboard_notify_enter(seat, surface,
|
||||||
kb->keycodes, kb->num_keycodes, &kb->modifiers);
|
kb->keycodes, kb->num_keycodes, &kb->modifiers);
|
||||||
@ -897,8 +897,14 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
|||||||
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
|
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If surface is NULL, clear pointer focus, otherwise let the client
|
/* If surface is NULL, clear pointer focus, otherwise let the client
|
||||||
* know that the mouse cursor has entered one of its surfaces. */
|
* know that the mouse cursor has entered one of its surfaces. */
|
||||||
|
if (!surface) {
|
||||||
|
wlr_seat_pointer_notify_clear_focus(seat);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
|
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
|
||||||
/* If keyboard focus follows mouse, enforce that */
|
/* If keyboard focus follows mouse, enforce that */
|
||||||
if (sloppyfocus && surface)
|
if (sloppyfocus && surface)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user