aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-15 07:53:32 -0500
committerGitHub <noreply@github.com>2018-01-15 07:53:32 -0500
commitc690420501a35ee83bf6afeb52139b3da2c455c2 (patch)
tree2631df62e96140109d2c563cdd160824e37af95a /rootston
parent38887a09dc24c662f5f2530d225d89d5fd73f32b (diff)
parent65b28b3823f42ba04629defbde136e04619c63a9 (diff)
Merge pull request #562 from emersion/xwayland-fullscreen-render-children
xwayland: render children window in fullscreen
Diffstat (limited to 'rootston')
-rw-r--r--rootston/output.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 10450df3..9048766f 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -169,6 +169,19 @@ static void render_wl_shell_surface(struct wlr_wl_shell_surface *surface,
}
}
+static void render_xwayland_children(struct wlr_xwayland_surface *surface,
+ struct roots_desktop *desktop, struct wlr_output *wlr_output,
+ struct timespec *when) {
+ struct wlr_xwayland_surface *child;
+ wl_list_for_each(child, &surface->children, parent_link) {
+ if (child->surface != NULL && child->added) {
+ render_surface(child->surface, desktop, wlr_output, when,
+ child->x, child->y, 0);
+ }
+ render_xwayland_children(child, desktop, wlr_output, when);
+ }
+}
+
static void render_view(struct roots_view *view, struct roots_desktop *desktop,
struct wlr_output *wlr_output, struct timespec *when) {
switch (view->type) {
@@ -200,7 +213,7 @@ static bool has_standalone_surface(struct roots_view *view) {
case ROOTS_WL_SHELL_VIEW:
return wl_list_empty(&view->wl_shell_surface->popups);
case ROOTS_XWAYLAND_VIEW:
- return true;
+ return wl_list_empty(&view->xwayland_surface->children);
}
return true;
}
@@ -218,27 +231,36 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
wlr_renderer_begin(server->renderer, wlr_output);
if (output->fullscreen_view != NULL) {
+ struct roots_view *view = output->fullscreen_view;
+
// Make sure the view is centered on screen
const struct wlr_box *output_box =
wlr_output_layout_get_box(desktop->layout, wlr_output);
struct wlr_box view_box;
- view_get_box(output->fullscreen_view, &view_box);
+ view_get_box(view, &view_box);
double view_x = (double)(output_box->width - view_box.width) / 2 +
output_box->x;
double view_y = (double)(output_box->height - view_box.height) / 2 +
output_box->y;
- view_move(output->fullscreen_view, view_x, view_y);
+ view_move(view, view_x, view_y);
- if (has_standalone_surface(output->fullscreen_view)) {
- wlr_output_set_fullscreen_surface(wlr_output,
- output->fullscreen_view->wlr_surface);
+ if (has_standalone_surface(view)) {
+ wlr_output_set_fullscreen_surface(wlr_output, view->wlr_surface);
} else {
wlr_output_set_fullscreen_surface(wlr_output, NULL);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
- render_view(output->fullscreen_view, desktop, wlr_output, &now);
+ render_view(view, desktop, wlr_output, &now);
+
+ // During normal rendering the xwayland window tree isn't traversed
+ // because all windows are rendered. Here we only want to render
+ // the fullscreen window's children so we have to traverse the tree.
+ if (view->type == ROOTS_XWAYLAND_VIEW) {
+ render_xwayland_children(view->xwayland_surface, desktop,
+ wlr_output, &now);
+ }
}
wlr_renderer_end(server->renderer);
wlr_output_swap_buffers(wlr_output);