Improve view_unmap algorithmics

This commit is contained in:
project-repo 2020-07-24 15:29:41 +02:00
commit 5cb26b8063

13
view.c
View file

@ -276,15 +276,12 @@ view_unmap(struct cg_view *view) {
struct cg_view *prev = view_get_prev_view(view);
wlr_output_damage_add_box(view_tile->workspace->output->damage,
&view_tile->tile);
if((view->workspace->server->seat->seat->keyboard_state
.focused_surface == NULL ||
view->workspace->server->seat->seat->keyboard_state
.focused_surface == view->wlr_surface) &&
view->workspace->server->curr_output
->workspaces[view->workspace->server->curr_output
->curr_workspace]
->focused_tile == view_tile) {
if(view == view->workspace->server->seat->focused_view) {
seat_set_focus(view->workspace->server->seat, prev);
} else if(view->workspace->server->seat->seat->keyboard_state
.focused_surface == view->wlr_surface) {
wlr_seat_keyboard_clear_focus(view->workspace->server->seat->seat);
seat_set_focus(view->workspace->server->seat, view->workspace->server->seat->focused_view);
} else {
view_tile->view = prev;
if(prev != NULL) {