From b0a5f3a25f52bc1d48d771cb02820042006d8d9e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 18 Aug 2018 15:10:06 +1000 Subject: Store geometry in the view and handle any floating view resizing --- include/sway/desktop.h | 5 +++++ include/sway/tree/view.h | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'include/sway') diff --git a/include/sway/desktop.h b/include/sway/desktop.h index 348fb187..c969a76b 100644 --- a/include/sway/desktop.h +++ b/include/sway/desktop.h @@ -1,8 +1,13 @@ #include struct sway_container; +struct sway_view; void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly, bool whole); void desktop_damage_whole_container(struct sway_container *con); + +void desktop_damage_box(struct wlr_box *box); + +void desktop_damage_view(struct sway_view *view); diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 0e7f166c..2747e7c4 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -38,7 +38,6 @@ 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 (*get_geometry)(struct sway_view *view, struct wlr_box *box); uint32_t (*configure)(struct sway_view *view, double lx, double ly, int width, int height); void (*set_activated)(struct sway_view *view, bool activated); @@ -88,7 +87,14 @@ struct sway_view { struct wlr_buffer *saved_buffer; int saved_buffer_width, saved_buffer_height; - struct wlr_box saved_geometry; // The "old" geometry during a transaction + + // The geometry for whatever the client is committing, regardless of + // transaction state. Updated on every commit. + struct wlr_box geometry; + + // The "old" geometry during a transaction. Used to damage the old location + // when a transaction is applied. + struct wlr_box saved_geometry; bool destroying; @@ -243,8 +249,6 @@ const char *view_get_shell(struct sway_view *view); void view_get_constraints(struct sway_view *view, double *min_width, double *max_width, double *min_height, double *max_height); -void view_get_geometry(struct sway_view *view, struct wlr_box *box); - uint32_t view_configure(struct sway_view *view, double lx, double ly, int width, int height); @@ -289,6 +293,8 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); void view_unmap(struct sway_view *view); +void view_update_size(struct sway_view *view, int width, int height); + void view_child_init(struct sway_view_child *child, const struct sway_view_child_impl *impl, struct sway_view *view, struct wlr_surface *surface); -- cgit v1.2.3-54-g00ecf