summaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 66747a3f..3d8bbff5 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -144,15 +144,16 @@ void output_view_for_each_surface(struct sway_output *output,
.user_iterator = iterator,
.user_data = user_data,
.output = output,
- .ox = view->swayc->current.view_x - output->swayc->current.swayc_x,
- .oy = view->swayc->current.view_y - output->swayc->current.swayc_y,
+ .ox = view->swayc->current.view_x - output->swayc->current.swayc_x
+ - view->geometry.x,
+ .oy = view->swayc->current.view_y - output->swayc->current.swayc_y
+ - view->geometry.y,
.width = view->swayc->current.view_width,
.height = view->swayc->current.view_height,
.rotation = 0, // TODO
};
- view_for_each_surface(view,
- output_for_each_surface_iterator, &data);
+ view_for_each_surface(view, output_for_each_surface_iterator, &data);
}
void output_view_for_each_popup(struct sway_output *output,
@@ -162,8 +163,10 @@ void output_view_for_each_popup(struct sway_output *output,
.user_iterator = iterator,
.user_data = user_data,
.output = output,
- .ox = view->swayc->current.view_x - output->swayc->current.swayc_x,
- .oy = view->swayc->current.view_y - output->swayc->current.swayc_y,
+ .ox = view->swayc->current.view_x - output->swayc->current.swayc_x
+ - view->geometry.x,
+ .oy = view->swayc->current.view_y - output->swayc->current.swayc_y
+ - view->geometry.y,
.width = view->swayc->current.view_width,
.height = view->swayc->current.view_height,
.rotation = 0, // TODO
@@ -303,44 +306,33 @@ struct send_frame_done_data {
static void send_frame_done_container_iterator(struct sway_container *con,
void *_data) {
- struct send_frame_done_data *data = _data;
- if (!sway_assert(con->type == C_VIEW, "expected a view")) {
+ if (con->type != C_VIEW) {
return;
}
-
if (!view_is_visible(con->sway_view)) {
return;
}
+ struct send_frame_done_data *data = _data;
output_view_for_each_surface(data->output, con->sway_view,
send_frame_done_iterator, data->when);
}
-static void send_frame_done_container(struct sway_output *output,
- struct sway_container *con, struct timespec *when) {
- struct send_frame_done_data data = {
- .output = output,
- .when = when,
- };
- container_descendants(con, C_VIEW,
- send_frame_done_container_iterator, &data);
-}
-
static void send_frame_done(struct sway_output *output, struct timespec *when) {
if (output_has_opaque_overlay_layer_surface(output)) {
goto send_frame_overlay;
}
+ struct send_frame_done_data data = {
+ .output = output,
+ .when = when,
+ };
struct sway_container *workspace = output_get_active_workspace(output);
if (workspace->current.ws_fullscreen) {
- if (workspace->current.ws_fullscreen->type == C_VIEW) {
- output_view_for_each_surface(output,
- workspace->current.ws_fullscreen->sway_view,
- send_frame_done_iterator, when);
- } else {
- send_frame_done_container(output, workspace->current.ws_fullscreen,
- when);
- }
+ send_frame_done_container_iterator(
+ workspace->current.ws_fullscreen, &data);
+ container_for_each_child(workspace->current.ws_fullscreen,
+ send_frame_done_container_iterator, &data);
#ifdef HAVE_XWAYLAND
send_frame_done_unmanaged(output,
&root_container.sway_root->xwayland_unmanaged, when);
@@ -351,9 +343,8 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) {
send_frame_done_layer(output,
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], when);
- send_frame_done_container(output, workspace, when);
- send_frame_done_container(output, workspace->sway_workspace->floating,
- when);
+ workspace_for_each_container(workspace,
+ send_frame_done_container_iterator, &data);
#ifdef HAVE_XWAYLAND
send_frame_done_unmanaged(output,