aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/tree/view.h
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 15:10:06 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-18 15:10:06 +1000
commitb0a5f3a25f52bc1d48d771cb02820042006d8d9e (patch)
treee7a2e4c60e562589e3b9a54c6ce559a41dcf7534 /include/sway/tree/view.h
parentSet current size when a floating xwayland view resizes (diff)
downloadsway-b0a5f3a25f52bc1d48d771cb02820042006d8d9e.tar.gz
sway-b0a5f3a25f52bc1d48d771cb02820042006d8d9e.tar.zst
sway-b0a5f3a25f52bc1d48d771cb02820042006d8d9e.zip
Store geometry in the view and handle any floating view resizing
Diffstat (limited to 'include/sway/tree/view.h')
-rw-r--r--include/sway/tree/view.h14
1 files changed, 10 insertions, 4 deletions
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 {
38 const char *(*get_string_prop)(struct sway_view *view, 38 const char *(*get_string_prop)(struct sway_view *view,
39 enum sway_view_prop prop); 39 enum sway_view_prop prop);
40 uint32_t (*get_int_prop)(struct sway_view *view, enum sway_view_prop prop); 40 uint32_t (*get_int_prop)(struct sway_view *view, enum sway_view_prop prop);
41 void (*get_geometry)(struct sway_view *view, struct wlr_box *box);
42 uint32_t (*configure)(struct sway_view *view, double lx, double ly, 41 uint32_t (*configure)(struct sway_view *view, double lx, double ly,
43 int width, int height); 42 int width, int height);
44 void (*set_activated)(struct sway_view *view, bool activated); 43 void (*set_activated)(struct sway_view *view, bool activated);
@@ -88,7 +87,14 @@ struct sway_view {
88 87
89 struct wlr_buffer *saved_buffer; 88 struct wlr_buffer *saved_buffer;
90 int saved_buffer_width, saved_buffer_height; 89 int saved_buffer_width, saved_buffer_height;
91 struct wlr_box saved_geometry; // The "old" geometry during a transaction 90
91 // The geometry for whatever the client is committing, regardless of
92 // transaction state. Updated on every commit.
93 struct wlr_box geometry;
94
95 // The "old" geometry during a transaction. Used to damage the old location
96 // when a transaction is applied.
97 struct wlr_box saved_geometry;
92 98
93 bool destroying; 99 bool destroying;
94 100
@@ -243,8 +249,6 @@ const char *view_get_shell(struct sway_view *view);
243void view_get_constraints(struct sway_view *view, double *min_width, 249void view_get_constraints(struct sway_view *view, double *min_width,
244 double *max_width, double *min_height, double *max_height); 250 double *max_width, double *min_height, double *max_height);
245 251
246void view_get_geometry(struct sway_view *view, struct wlr_box *box);
247
248uint32_t view_configure(struct sway_view *view, double lx, double ly, int width, 252uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
249 int height); 253 int height);
250 254
@@ -289,6 +293,8 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface);
289 293
290void view_unmap(struct sway_view *view); 294void view_unmap(struct sway_view *view);
291 295
296void view_update_size(struct sway_view *view, int width, int height);
297
292void view_child_init(struct sway_view_child *child, 298void view_child_init(struct sway_view_child *child,
293 const struct sway_view_child_impl *impl, struct sway_view *view, 299 const struct sway_view_child_impl *impl, struct sway_view *view,
294 struct wlr_surface *surface); 300 struct wlr_surface *surface);