mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-25 01:41:06 -05:00
Merge 14ba8d3365 into dcd64ae48b
This commit is contained in:
commit
ab7e34b81a
3 changed files with 32 additions and 13 deletions
21
view.c
21
view.c
|
|
@ -96,6 +96,17 @@ view_position(struct cg_view *view)
|
|||
struct wlr_box layout_box;
|
||||
wlr_output_layout_get_box(view->server->output_layout, NULL, &layout_box);
|
||||
|
||||
#if CAGE_HAS_XWAYLAND
|
||||
/* We shouldn't position override-redirect windows. They set
|
||||
their own (x,y) coordinates in handle_xwayland_surface_set_geometry. */
|
||||
if (view->type == CAGE_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) {
|
||||
/* The scene is created in .map, but .set_geometry can come
|
||||
* before that. */
|
||||
if (view->scene_tree != NULL) {
|
||||
wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (view_is_primary(view) || view_extends_output_layout(view, &layout_box)) {
|
||||
view_maximize(view, &layout_box);
|
||||
} else {
|
||||
|
|
@ -123,6 +134,7 @@ view_unmap(struct cg_view *view)
|
|||
view->foreign_toplevel_handle = NULL;
|
||||
|
||||
wlr_scene_node_destroy(&view->scene_tree->node);
|
||||
view->scene_tree = NULL;
|
||||
|
||||
view->wlr_surface->data = NULL;
|
||||
view->wlr_surface = NULL;
|
||||
|
|
@ -155,14 +167,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface)
|
|||
view->wlr_surface = surface;
|
||||
surface->data = view;
|
||||
|
||||
#if CAGE_HAS_XWAYLAND
|
||||
/* We shouldn't position override-redirect windows. They set
|
||||
their own (x,y) coordinates in handle_wayland_surface_map. */
|
||||
if (view->type != CAGE_XWAYLAND_VIEW || xwayland_view_should_manage(view))
|
||||
#endif
|
||||
{
|
||||
view_position(view);
|
||||
}
|
||||
view_position(view);
|
||||
|
||||
wl_list_insert(&view->server->views, &view->link);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue