Skip to content

Commit

Permalink
Make working with more than 2 windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Unesty committed Nov 7, 2020
1 parent 8475741 commit c30a160
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/swvkc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; c<i+1;c++){
if(current_surface!=NULL) {
current_surface = current_surface->next;
} 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);
Expand Down

0 comments on commit c30a160

Please sign in to comment.