diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-07 17:40:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-07 17:40:46 -0400 |
commit | 543601e86c24ad6ed630aba0cf615bfb585c19e7 (patch) | |
tree | 52ccde52988a3624ac9c9560ac02e0089c25572f /rootston/output.c | |
parent | 1225a402d044a41be9e61a9a1e45eab2ebda377b (diff) | |
parent | 4f848000af6bdf57a6e861e69a53677f23133202 (diff) |
Merge pull request #183 from acrisci/feature/xdg-popup
xdg-popup
Diffstat (limited to 'rootston/output.c')
-rw-r--r-- | rootston/output.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/rootston/output.c b/rootston/output.c index c6627182..6c7fbf51 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -78,10 +78,34 @@ static void render_surface(struct wlr_surface *surface, } } +static void render_xdg_v6_popups(struct wlr_xdg_surface_v6 *surface, + struct roots_desktop *desktop, struct wlr_output *wlr_output, + struct timespec *when, double base_x, double base_y, float rotation) { + // TODO: make sure this works with view rotation + struct wlr_xdg_surface_v6 *popup; + wl_list_for_each(popup, &surface->popups, popup_link) { + if (!popup->configured) { + continue; + } + + double popup_x = base_x + surface->geometry->x + + popup->popup_state->geometry.x - popup->geometry->x; + double popup_y = base_y + surface->geometry->y + + popup->popup_state->geometry.y - popup->geometry->y; + render_surface(popup->surface, desktop, wlr_output, when, popup_x, + popup_y, rotation); + render_xdg_v6_popups(popup, desktop, wlr_output, when, popup_x, popup_y, rotation); + } +} + 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) { + render_xdg_v6_popups(view->xdg_surface_v6, desktop, wlr_output, + when, view->x, view->y, view->rotation); + } } static void output_frame_notify(struct wl_listener *listener, void *data) { |