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,