diff --git a/src/swvkc.c b/src/swvkc.c index 0792bf5..25f4969 100644 --- a/src/swvkc.c +++ b/src/swvkc.c @@ -599,11 +599,23 @@ void input_key_notify(struct aaa *e, void *user_data) { } struct surface_node *match; if( e->key == KEY_TAB) { - match = wl_container_of(server->mapped_surfaces_list.next->next, match, link); - errlog("match %p", (void*)match); + struct wl_list *current_surface; + current_surface = server->mapped_surfaces_list.next; + for(uint8_t c=0; cnext; + } else { + break; + } + } if(server->mapped_surfaces_list.next->prev!=server->mapped_surfaces_list.next->next) { + if(current_surface!=&server->mapped_surfaces_list){ + match = wl_container_of(current_surface, match, link); + errlog("match %p", (void*)match); server_change_focus(server, match); } + } + i++; break; } errlog("the key '%s' was pressed", e->name);