diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index dbf80b15..6e5ebbca 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1263,6 +1263,7 @@ struct weston_compositor { struct wl_list plugin_api_list; /* struct weston_plugin_api::link */ uint32_t output_id_pool; + bool output_flow_dirty; struct xkb_rule_names xkb_names; struct xkb_context *xkb_context; diff --git a/libweston/compositor.c b/libweston/compositor.c index 5448e8ac..6282901a 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -6253,6 +6253,9 @@ weston_head_get_destroy_listener(struct weston_head *head, return wl_signal_get(&head->destroy_signal, notify); } +static void +weston_output_set_position(struct weston_output *output, int x, int y); + /* Move other outputs when one is resized so the space remains contiguous. */ static void weston_compositor_reflow_outputs(struct weston_compositor *compositor, @@ -6261,6 +6264,9 @@ weston_compositor_reflow_outputs(struct weston_compositor *compositor, struct weston_output *output; bool start_resizing = false; + if (compositor->output_flow_dirty) + return; + if (!delta_width) return; @@ -6271,7 +6277,7 @@ weston_compositor_reflow_outputs(struct weston_compositor *compositor, } if (start_resizing) { - weston_output_move(output, output->x + delta_width, output->y); + weston_output_set_position(output, output->x + delta_width, output->y); output->dirty = 1; } } @@ -6377,8 +6383,8 @@ weston_output_init_geometry(struct weston_output *output, int x, int y) /** * \ingroup output */ -WL_EXPORT void -weston_output_move(struct weston_output *output, int x, int y) +static void +weston_output_set_position(struct weston_output *output, int x, int y) { struct weston_head *head; struct wl_resource *resource; @@ -6424,6 +6430,16 @@ weston_output_move(struct weston_output *output, int x, int y) } } +/** + * \ingroup output + */ +WL_EXPORT void +weston_output_move(struct weston_output *output, int x, int y) +{ + output->compositor->output_flow_dirty = true; + weston_output_set_position(output, x, y); +} + /** Signal that a pending output is taken into use. * * Removes the output from the pending list and adds it to the compositor's