aboutsummaryrefslogtreecommitdiff
path: root/include/sway/tree
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-05-31 01:37:43 +0200
committerSimon Ser <contact@emersion.fr>2020-06-03 16:41:17 +0200
commitfcd0ab8f331a6e74fde113d665d4aed21bccdfc5 (patch)
treec2f53f827372904f8d7b1356231350652bed8a8d /include/sway/tree
parent613abdda6fa978480067a35c3adc46fb414b0b5c (diff)
downloadsway-fcd0ab8f331a6e74fde113d665d4aed21bccdfc5.tar.xz
view: Save all buffers associated with view
During the execution of a resize transaction, the buffer associated with a view's surface is saved and reused until the client acknowledges the resulting configure event. However, only one the main buffer of the main surface was stored and rendered, meaning that subsurfaces disappear during resize. Iterate over all, store and render buffers from all surfaces in the view to ensure that correct rendering is preserved.
Diffstat (limited to 'include/sway/tree')
-rw-r--r--include/sway/tree/view.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index ab2dc8e4..53c5d34e 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -55,6 +55,13 @@ struct sway_view_impl {
void (*destroy)(struct sway_view *view);
};
+struct sway_saved_buffer {
+ struct wlr_client_buffer *buffer;
+ int x, y;
+ int width, height;
+ struct wl_list link; // sway_view::saved_buffers
+};
+
struct sway_view {
enum sway_view_type type;
const struct sway_view_impl *impl;
@@ -65,9 +72,6 @@ struct sway_view {
pid_t pid;
- double saved_x, saved_y;
- int saved_width, saved_height;
-
// The size the view would want to be if it weren't tiled.
// Used when changing a view from tiled to floating.
int natural_width, natural_height;
@@ -80,8 +84,7 @@ struct sway_view {
bool allow_request_urgent;
struct wl_event_source *urgent_timer;
- struct wlr_client_buffer *saved_buffer;
- int saved_buffer_width, saved_buffer_height;
+ struct wl_list saved_buffers; // sway_saved_buffer::link
// The geometry for whatever the client is committing, regardless of
// transaction state. Updated on every commit.