mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
xwayland: move override-redirect assignmend to map handler
Some surfaces set their coordinates only when they're mapped, such as current Firefox's menu popup. Hence, we accomodate such clients.
This commit is contained in:
parent
c47eb031c6
commit
75b0f832ed
2 changed files with 6 additions and 6 deletions
2
view.c
2
view.c
|
|
@ -106,7 +106,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface)
|
|||
|
||||
#if CAGE_HAS_XWAYLAND
|
||||
/* 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_map. */
|
||||
if (view->type != CAGE_XWAYLAND_VIEW || xwayland_view_should_manage(view))
|
||||
#endif
|
||||
{
|
||||
|
|
|
|||
10
xwayland.c
10
xwayland.c
|
|
@ -122,6 +122,11 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *data)
|
|||
struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, map);
|
||||
struct cg_view *view = &xwayland_view->view;
|
||||
|
||||
if (!xwayland_view_should_manage(view)) {
|
||||
view->x = xwayland_view->xwayland_surface->x;
|
||||
view->y = xwayland_view->xwayland_surface->y;
|
||||
}
|
||||
|
||||
xwayland_view->ever_been_mapped = true;
|
||||
view_map(view, xwayland_view->xwayland_surface->surface);
|
||||
}
|
||||
|
|
@ -166,11 +171,6 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data)
|
|||
|
||||
view_init(&xwayland_view->view, server, CAGE_XWAYLAND_VIEW, &xwayland_view_impl);
|
||||
xwayland_view->xwayland_surface = xwayland_surface;
|
||||
if (xwayland_surface->override_redirect) {
|
||||
struct cg_view *view = &xwayland_view->view;
|
||||
view->x = xwayland_surface->x;
|
||||
view->y = xwayland_surface->y;
|
||||
}
|
||||
|
||||
xwayland_view->map.notify = handle_xwayland_surface_map;
|
||||
wl_signal_add(&xwayland_surface->events.map, &xwayland_view->map);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue