Fix potential npd

This commit is contained in:
project-repo 2023-02-02 20:18:48 +01:00
commit 0ccbd554d3

8
seat.c
View file

@ -214,8 +214,10 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym,
wlr_scene_buffer_from_node(node));
if(scene_surface != NULL) {
surface = scene_surface->surface;
if(surface!=NULL) {
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
}
}
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
}
}
}
@ -701,8 +703,10 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) {
wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node));
if(scene_surface != NULL) {
surface = scene_surface->surface;
if(surface!=NULL) {
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
}
}
wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy);
bool focus_changed = wlr_seat->pointer_state.focused_surface != surface;
if(!focus_changed && time > 0) {