mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
view: don't position override-redirect windows
Override-redirect windows are meant to be ignored by the X server, at least as far as position goes. Hence, we detect whether we're dealing with such a window and consequently don't position it. This makes, amongst others, Chromium's popup menus and dmenu appear on the correct position and size.
This commit is contained in:
parent
2543934055
commit
16ab37b706
2 changed files with 14 additions and 1 deletions
10
view.c
10
view.c
|
|
@ -104,7 +104,15 @@ view_map(struct cg_view *view, struct wlr_surface *surface)
|
||||||
{
|
{
|
||||||
view->wlr_surface = surface;
|
view->wlr_surface = surface;
|
||||||
|
|
||||||
view_position(view);
|
#if CAGE_HAS_XWAYLAND
|
||||||
|
/* We shouldn't position override-redirect windows. They set
|
||||||
|
their own (x,y) coordinates in handle_wayland_surface_new. */
|
||||||
|
if (view->type != CAGE_XWAYLAND_VIEW ||
|
||||||
|
!xwayland_view_from_view(view)->xwayland_surface->override_redirect)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
view_position(view);
|
||||||
|
}
|
||||||
|
|
||||||
wl_list_insert(&view->server->views, &view->link);
|
wl_list_insert(&view->server->views, &view->link);
|
||||||
seat_set_focus(view->server->seat, view);
|
seat_set_focus(view->server->seat, view);
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,11 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
view_init(&xwayland_view->view, server, CAGE_XWAYLAND_VIEW, &xwayland_view_impl);
|
view_init(&xwayland_view->view, server, CAGE_XWAYLAND_VIEW, &xwayland_view_impl);
|
||||||
xwayland_view->xwayland_surface = xwayland_surface;
|
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;
|
xwayland_view->map.notify = handle_xwayland_surface_map;
|
||||||
wl_signal_add(&xwayland_surface->events.map, &xwayland_view->map);
|
wl_signal_add(&xwayland_surface->events.map, &xwayland_view->map);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue