view: add view_set_activated()

Call wlr_foreign_toplevel_handle_v1_set_activated() from it in support of
issue #73
This commit is contained in:
Johan Malm 2021-10-16 19:24:26 +01:00
parent 54d22a7129
commit 70144ac113
4 changed files with 38 additions and 0 deletions

View file

@ -227,6 +227,19 @@ maximize(struct view *view, bool maximized)
wlr_xwayland_surface_set_maximized(view->xwayland_surface, maximized);
}
static void
set_activated(struct view *view, bool activated)
{
struct wlr_xwayland_surface *surface = view->xwayland_surface;
if (activated && surface->minimized) {
wlr_xwayland_surface_set_minimized(surface, false);
}
wlr_xwayland_surface_activate(surface, activated);
wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE);
}
static void
set_fullscreen(struct view *view, bool fullscreen)
{
@ -240,6 +253,7 @@ static const struct view_impl xwl_view_impl = {
.get_string_prop = get_string_prop,
.map = map,
.move = move,
.set_activated = set_activated,
.set_fullscreen = set_fullscreen,
.unmap = unmap,
.maximize = maximize