diff --git a/src/swvkc.c b/src/swvkc.c index dfe9c21..5eefd08 100644 --- a/src/swvkc.c +++ b/src/swvkc.c @@ -595,14 +595,39 @@ void input_key_notify(struct aaa *e, void *user_data) { wl_display_terminate(server->display); break; } + struct surface_node *match; + if( e->key == KEY_TAB) { + 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); name[i] = e->name[0]; i++; - struct surface_node *match = match_app_id(server, name); + match = match_app_id(server, name); errlog("match %p", (void*)match); if (match) server_change_focus(server, match); } else if (steal) { + if (e->key == KEY_ESC) { + wl_display_terminate(server->display); + break; + } } else if (!wl_list_empty(&server->mapped_surfaces_list)) { struct wl_resource *keyboard = focused_surface_keyboard(server); if (keyboard) { diff --git a/subprojects/libswvkc-wl/meson.build b/subprojects/libswvkc-wl/meson.build index d0d9be8..02a960e 100644 --- a/subprojects/libswvkc-wl/meson.build +++ b/subprojects/libswvkc-wl/meson.build @@ -4,6 +4,10 @@ add_project_arguments('-pedantic-errors', '-Wno-unused-parameter', '-Wno-unused-function', language: 'c') add_project_link_arguments('-lm', language: 'c') +if get_option('buildtype').startswith('debug') + add_project_arguments('-DDEBUG',language: 'c') +endif + c = 'core/' u = 'util/' x = 'extensions/' diff --git a/subprojects/libswvkc-wl/util/log.c b/subprojects/libswvkc-wl/util/log.c index 39a428e..a163eb7 100644 --- a/subprojects/libswvkc-wl/util/log.c +++ b/subprojects/libswvkc-wl/util/log.c @@ -3,6 +3,7 @@ #include #include +#if defined DEBUG void errlog(const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -27,3 +28,7 @@ void boxlog(const char *fmt, ...) { fprintf(stdout, "\n"); va_end(args); } +#else +void errlog(const char *fmt, ...) {} +void boxlog(const char *fmt, ...) {} +#endif