mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-03 01:41:28 -05:00
xwayland: abstract override-redirect behind function
This commit is contained in:
parent
16ab37b706
commit
c47eb031c6
3 changed files with 10 additions and 2 deletions
3
view.c
3
view.c
|
|
@ -107,8 +107,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface)
|
||||||
#if CAGE_HAS_XWAYLAND
|
#if CAGE_HAS_XWAYLAND
|
||||||
/* We shouldn't position override-redirect windows. They set
|
/* We shouldn't position override-redirect windows. They set
|
||||||
their own (x,y) coordinates in handle_wayland_surface_new. */
|
their own (x,y) coordinates in handle_wayland_surface_new. */
|
||||||
if (view->type != CAGE_XWAYLAND_VIEW ||
|
if (view->type != CAGE_XWAYLAND_VIEW || xwayland_view_should_manage(view))
|
||||||
!xwayland_view_from_view(view)->xwayland_surface->override_redirect)
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
view_position(view);
|
view_position(view);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,14 @@ xwayland_view_from_view(struct cg_view *view)
|
||||||
return (struct cg_xwayland_view *) view;
|
return (struct cg_xwayland_view *) view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
xwayland_view_should_manage(struct cg_view *view)
|
||||||
|
{
|
||||||
|
struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view);
|
||||||
|
struct wlr_xwayland_surface *xwayland_surface = xwayland_view->xwayland_surface;
|
||||||
|
return !xwayland_surface->override_redirect;
|
||||||
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_title(struct cg_view *view)
|
get_title(struct cg_view *view)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ struct cg_xwayland_view {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cg_xwayland_view *xwayland_view_from_view(struct cg_view *view);
|
struct cg_xwayland_view *xwayland_view_from_view(struct cg_view *view);
|
||||||
|
bool xwayland_view_should_manage(struct cg_view *view);
|
||||||
void handle_xwayland_surface_new(struct wl_listener *listener, void *data);
|
void handle_xwayland_surface_new(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue