wl-shell: render popups in the right place

This commit is contained in:
Tony Crisci 2017-10-08 16:49:37 -04:00
parent fbddc81b59
commit cd1204f71f
3 changed files with 84 additions and 9 deletions

View file

@ -97,13 +97,39 @@ static void render_xdg_v6_popups(struct wlr_xdg_surface_v6 *surface,
}
}
static void render_wl_shell_surface(struct wlr_wl_shell_surface *surface, struct roots_desktop *desktop,
struct wlr_output *wlr_output, struct timespec *when, double lx,
double ly, float rotation, bool is_child) {
if (is_child || !wlr_wl_shell_surface_is_transient(surface)) {
render_surface(surface->surface, desktop, wlr_output, when,
lx, ly, rotation);
struct wlr_wl_shell_surface *child;
wl_list_for_each(child, &surface->children, child_link) {
render_wl_shell_surface(child, desktop, wlr_output, when,
lx + child->transient_state->x,
ly + child->transient_state->y,
rotation, true);
}
}
}
static void render_view(struct roots_view *view, struct roots_desktop *desktop,
struct wlr_output *wlr_output, struct timespec *when) {
render_surface(view->wlr_surface, desktop, wlr_output, when,
view->x, view->y, view->rotation);
if (view->type == ROOTS_XDG_SHELL_V6_VIEW) {
switch (view->type) {
case ROOTS_XDG_SHELL_V6_VIEW:
render_surface(view->wlr_surface, desktop, wlr_output, when,
view->x, view->y, view->rotation);
render_xdg_v6_popups(view->xdg_surface_v6, desktop, wlr_output,
when, view->x, view->y, view->rotation);
break;
case ROOTS_WL_SHELL_VIEW:
render_wl_shell_surface(view->wl_shell_surface, desktop, wlr_output,
when, view->x, view->y, view->rotation, false);
break;
case ROOTS_XWAYLAND_VIEW:
render_surface(view->wlr_surface, desktop, wlr_output, when,
view->x, view->y, view->rotation);
break;
}
}