Refactor everything that needs to arrange windows

* The arrange_foo functions are now replaced with arrange_and_commit, or
with manually created transactions and arrange_windows x2.
* The arrange functions are now only called from the highest level
functions rather than from both high level and low level functions.
* Due to the previous point, view_set_fullscreen_raw and
view_set_fullscreen are both merged into one function again.
* Floating and fullscreen are now working with transactions.
This commit is contained in:
Ryan Dwyer 2018-06-06 22:57:34 +10:00
parent f9e6d703d2
commit bb66e6d578
24 changed files with 192 additions and 171 deletions

View file

@ -1238,13 +1238,13 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
static void handle_mode(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, mode);
arrange_layers(output);
arrange_output(output->swayc);
arrange_and_commit(output->swayc);
}
static void handle_transform(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, transform);
arrange_layers(output);
arrange_output(output->swayc);
arrange_and_commit(output->swayc);
}
static void handle_scale_iterator(struct sway_container *view, void *data) {
@ -1254,8 +1254,8 @@ static void handle_scale_iterator(struct sway_container *view, void *data) {
static void handle_scale(struct wl_listener *listener, void *data) {
struct sway_output *output = wl_container_of(listener, output, scale);
arrange_layers(output);
arrange_output(output->swayc);
container_descendants(output->swayc, C_VIEW, handle_scale_iterator, NULL);
arrange_and_commit(output->swayc);
}
void handle_new_output(struct wl_listener *listener, void *data) {
@ -1314,5 +1314,5 @@ void output_enable(struct sway_output *output) {
output->damage_destroy.notify = damage_handle_destroy;
arrange_layers(output);
arrange_root();
arrange_and_commit(&root_container);
}