mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
Add view_impl .map and .unmap
Hook up iconify button to view->impl->unmap
This commit is contained in:
parent
98c556be2a
commit
bf3e4aa8d5
6 changed files with 79 additions and 49 deletions
13
src/view.c
13
src/view.c
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue