implement foreign-toplevel-management

This commit is contained in:
wochap 2024-04-28 13:47:06 -05:00
parent 577d8da6d1
commit 09d42d9834
No known key found for this signature in database
GPG key ID: FE4CF844E73095E1
5 changed files with 468 additions and 6 deletions

View file

@ -96,6 +96,9 @@ client_activate_surface(struct wlr_surface *s, int activated)
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
if (activated && xsurface->minimized) {
wlr_xwayland_surface_set_minimized(xsurface, false);
}
wlr_xwayland_surface_activate(xsurface, activated);
return;
}
@ -344,6 +347,19 @@ client_set_fullscreen(Client *c, int fullscreen)
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
}
static inline void
client_set_minimized(struct wlr_surface *s, int minimized)
{
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
int focused = seat->keyboard_state.focused_surface == xsurface->surface;
wlr_xwayland_surface_set_minimized(xsurface, !focused && minimized);
return;
}
#endif
}
static inline uint32_t
client_set_size(Client *c, uint32_t width, uint32_t height)
{