Add view_impl .map and .unmap

Hook up iconify button to view->impl->unmap
This commit is contained in:
Johan Malm 2020-09-03 20:50:35 +01:00
parent 98c556be2a
commit bf3e4aa8d5
6 changed files with 79 additions and 49 deletions

View file

@ -140,15 +140,24 @@ static void move_xwayland_decendants_to_front(struct view *parent)
}
}
/**
* Note that if 'view' is not a toplevel view, the 'front' toplevel view
* will be focussed on; but if 'view' is a toplevel view, the 'next'
* will be focussed on.
*/
void view_focus(struct view *view)
{
/* Note: this function only deals with keyboard focus. */
if (!view || !view->surface)
if (!view)
return;
if (!view->mapped) {
view->impl->map(view);
return;
}
struct server *server = view->server;
struct wlr_seat *seat = server->seat;
struct wlr_surface *prev_surface;
prev_surface = seat->keyboard_state.focused_surface;
if (prev_surface == view->surface) {
/* Don't re-focus an already focused surface. */