diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-01-16 07:50:40 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-01-16 07:51:10 -0500 |
commit | 3751a1732158546c4fbc203aa34fc4a4a68f1016 (patch) | |
tree | b658695973fe615e5420b92106403b56342247af /rootston/output.c | |
parent | dc701b72fc579776cf10bf7d5ec91c033f9bec8e (diff) |
decorate xwayland views
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 42dbd972..502e72d2 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -144,8 +144,32 @@ static void render_xwayland_children(struct wlr_xwayland_surface *surface, } } +static void render_decorations(struct roots_view *view, + struct roots_desktop *desktop, struct wlr_output *output) { + if (!view->decorated) { + return; + } + struct wlr_box deco_box; + view_get_deco_box(view, &deco_box); + double ox = deco_box.x; + double oy = deco_box.y; + wlr_output_layout_output_coords(desktop->layout, output, &ox, &oy); + ox *= output->scale; + oy *= output->scale; + + float matrix[16]; + wlr_output_get_box_matrix(output, ox, oy, deco_box.width, + deco_box.height, WL_OUTPUT_TRANSFORM_NORMAL, view->rotation, + &matrix); + + float color[4] = { 0.2, 0.2, 0.2, 1 }; + wlr_render_colored_quad(desktop->server->renderer, &color, &matrix); +} + static void render_view(struct roots_view *view, struct roots_desktop *desktop, struct wlr_output *wlr_output, struct timespec *when) { + render_decorations(view, desktop, wlr_output); + switch (view->type) { case ROOTS_XDG_SHELL_V6_VIEW: render_surface(view->wlr_surface, desktop, wlr_output, when, |