diff options
author | Drew DeVault <[email protected]> | 2018-03-31 11:40:34 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2018-03-31 11:40:34 -0400 |
commit | 89ca6676bedca3580a2db45a2f60f34c136cd3d0 (patch) | |
tree | 8131a6e50f159d30b6bc936384fdd3fb460e95b3 /sway/desktop/output.c | |
parent | a1e7ffd857b27a430989718c7328e7b969a99ca3 (diff) | |
parent | 98b67e2399df70d1e8354d5641744d1730a60189 (diff) |
Merge pull request #1681 from emersion/xwayland-configure-position
Fix various xwayland issues
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index c248b29e..0d706c52 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -243,14 +243,25 @@ static void render_output(struct sway_output *output, struct timespec *when, struct sway_view *view; wl_list_for_each(view, &root_container.sway_root->unmanaged_views, unmanaged_view_link) { - if (view->type == SWAY_XWAYLAND_VIEW) { - // the only kind of unamanged view right now is xwayland override - // redirect - int view_x = view->wlr_xwayland_surface->x; - int view_y = view->wlr_xwayland_surface->y; - render_surface(view->surface, wlr_output, &output->last_frame, - view_x, view_y, 0); + if (view->type != SWAY_XWAYLAND_VIEW) { + continue; } + + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; + + const struct wlr_box view_box = { + .x = xsurface->x, + .y = xsurface->y, + .width = xsurface->width, + .height = xsurface->height, + }; + struct wlr_box intersection; + if (!wlr_box_intersection(&view_box, output_box, &intersection)) { + continue; + } + + render_surface(view->surface, wlr_output, &output->last_frame, + view_box.x - output_box->x, view_box.y - output_box->y, 0); } // TODO: Consider revising this when fullscreen windows are supported |