From 0ccbd554d34ea0efb9f2b77e4106dbd9f2d97264 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 20:18:48 +0100 Subject: [PATCH 1/2] Fix potential npd --- seat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/seat.c b/seat.c index f75ff62..d2b947c 100644 --- a/seat.c +++ b/seat.c @@ -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) { From 15590ab39ac4ac8fd040bd08c261af7fa59fc35f Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 20:22:16 +0100 Subject: [PATCH 2/2] Fix npd --- keybinding.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/keybinding.c b/keybinding.c index fa37619..8661db4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -699,18 +699,20 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { + int curr_id=-1; + int curr_pid=-1; + if(current_view!=NULL && current_view->link.next != curr_workspace->views.next) { + curr_id=current_view->id; + curr_pid=current_view->impl->get_pid(current_view); + } ipc_send_event( curr_workspace->output->server, "{\"event_name\":\"cycle_views\",\"old_view_id\":%d,\"old_view_" "pid\":%d," "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->id, - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->impl->get_pid(current_view), + curr_id, + curr_pid, next_view == NULL ? -1 : (int)next_view->id, next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), next_view->tile->id, curr_workspace->num + 1,