From 59c94887018bdfa578c4371c4275061ca6e71b3e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 3 Jun 2018 16:35:06 +1000 Subject: WIP: Atomic layout updates ground work --- include/sway/tree/view.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 3df38e2d..f47db567 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -29,8 +29,8 @@ struct sway_view_impl { const char *(*get_string_prop)(struct sway_view *view, enum sway_view_prop prop); uint32_t (*get_int_prop)(struct sway_view *view, enum sway_view_prop prop); - void (*configure)(struct sway_view *view, double lx, double ly, int width, - int height); + uint32_t (*configure)(struct sway_view *view, double lx, double ly, + int width, int height); void (*set_activated)(struct sway_view *view, bool activated); void (*set_fullscreen)(struct sway_view *view, bool fullscreen); bool (*wants_floating)(struct sway_view *view); @@ -70,6 +70,12 @@ struct sway_view { list_t *executed_criteria; // struct criteria * list_t *marks; // char * + list_t *instructions; // struct sway_transaction_instruction * + + // If saved_texture is set, the main surface of the view will render this + // texture instead of its own. This is used while waiting for transactions + // to complete. + struct wlr_texture *saved_texture; struct wlr_texture *marks_focused; struct wlr_texture *marks_focused_inactive; @@ -103,8 +109,6 @@ struct sway_xdg_shell_v6_view { struct wl_listener map; struct wl_listener unmap; struct wl_listener destroy; - - int pending_width, pending_height; }; struct sway_xdg_shell_view { @@ -119,8 +123,6 @@ struct sway_xdg_shell_view { struct wl_listener map; struct wl_listener unmap; struct wl_listener destroy; - - int pending_width, pending_height; }; struct sway_xwayland_view { @@ -138,9 +140,6 @@ struct sway_xwayland_view { struct wl_listener map; struct wl_listener unmap; struct wl_listener destroy; - - int pending_lx, pending_ly; - int pending_width, pending_height; }; struct sway_xwayland_unmanaged { @@ -212,7 +211,7 @@ uint32_t view_get_window_type(struct sway_view *view); const char *view_get_shell(struct sway_view *view); -void view_configure(struct sway_view *view, double ox, double oy, int width, +uint32_t view_configure(struct sway_view *view, double lx, double ly, int width, int height); /** -- cgit v1.2.3 From bb66e6d578fdc68fb33d0fde921390d74f20bb31 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 6 Jun 2018 22:57:34 +1000 Subject: 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. --- include/sway/tree/view.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index f47db567..d0093db5 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -214,6 +214,11 @@ const char *view_get_shell(struct sway_view *view); uint32_t view_configure(struct sway_view *view, double lx, double ly, int width, int height); +/** + * Center the view in its workspace and build the swayc decorations around it. + */ +void view_init_floating(struct sway_view *view); + /** * Configure the view's position and size based on the swayc's position and * size, taking borders into consideration. -- cgit v1.2.3 From 1c89f32533534f6e78c81c95578f40df45bb9016 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 18 Jun 2018 20:42:12 +1000 Subject: Preserve buffers during transactions * Also fix parts of the rendering where it was rendering the pending state instead of current. --- include/sway/tree/view.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index d0093db5..fc4c8df9 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -72,10 +72,11 @@ struct sway_view { list_t *marks; // char * list_t *instructions; // struct sway_transaction_instruction * - // If saved_texture is set, the main surface of the view will render this - // texture instead of its own. This is used while waiting for transactions - // to complete. - struct wlr_texture *saved_texture; + // If saved_buffer is set, the main surface of the view will render this + // buffer/texture instead of its own. This is used while waiting for + // transactions to complete. + struct wlr_buffer *saved_buffer; + int saved_surface_width, saved_surface_height; struct wlr_texture *marks_focused; struct wlr_texture *marks_focused_inactive; -- cgit v1.2.3 From 38398e2d77d57dc06b67ec88a54091c897915602 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 23 Jun 2018 16:24:11 +1000 Subject: Implement atomic layout updates for tree operations This implements atomic layout updates for when views map, reparent or unmap. --- include/sway/tree/view.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index fc4c8df9..5a615b43 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -37,7 +37,7 @@ struct sway_view_impl { void (*for_each_surface)(struct sway_view *view, wlr_surface_iterator_func_t iterator, void *user_data); void (*close)(struct sway_view *view); - void (*destroy)(struct sway_view *view); + void (*free)(struct sway_view *view); }; struct sway_view { @@ -68,15 +68,10 @@ struct sway_view { bool border_left; bool border_right; + bool destroying; + list_t *executed_criteria; // struct criteria * list_t *marks; // char * - list_t *instructions; // struct sway_transaction_instruction * - - // If saved_buffer is set, the main surface of the view will render this - // buffer/texture instead of its own. This is used while waiting for - // transactions to complete. - struct wlr_buffer *saved_buffer; - int saved_surface_width, saved_surface_height; struct wlr_texture *marks_focused; struct wlr_texture *marks_focused_inactive; @@ -244,11 +239,16 @@ void view_for_each_surface(struct sway_view *view, void view_init(struct sway_view *view, enum sway_view_type type, const struct sway_view_impl *impl); +void view_free(struct sway_view *view); + void view_destroy(struct sway_view *view); void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); -void view_unmap(struct sway_view *view); +/** + * Unmap the view and return the surviving parent (after reaping). + */ +struct sway_container *view_unmap(struct sway_view *view); void view_update_position(struct sway_view *view, double lx, double ly); -- cgit v1.2.3 From 7a922c65aab27c5f4282cf15de52d240e5ac8052 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 26 Jun 2018 13:15:45 +1000 Subject: Damage output when a fullscreen view unmaps Also moved the arranging into view_unmap to avoid excessive code duplication. --- include/sway/tree/view.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 5a615b43..0e6f5292 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -245,10 +245,7 @@ void view_destroy(struct sway_view *view); void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); -/** - * Unmap the view and return the surviving parent (after reaping). - */ -struct sway_container *view_unmap(struct sway_view *view); +void view_unmap(struct sway_view *view); void view_update_position(struct sway_view *view, double lx, double ly); -- cgit v1.2.3 From 50190bc7609d981c45d26cd0b7d6d0fbf66feb05 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 26 Jun 2018 13:18:33 +1000 Subject: Rename view's free callback to destroy --- include/sway/tree/view.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sway/tree/view.h') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 0e6f5292..1bcb0582 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -37,7 +37,7 @@ struct sway_view_impl { void (*for_each_surface)(struct sway_view *view, wlr_surface_iterator_func_t iterator, void *user_data); void (*close)(struct sway_view *view); - void (*free)(struct sway_view *view); + void (*destroy)(struct sway_view *view); }; struct sway_view { -- cgit v1.2.3