diff options
author | 2020-05-31 01:37:43 +0200 | |
---|---|---|
committer | 2020-06-03 16:41:17 +0200 | |
commit | fcd0ab8f331a6e74fde113d665d4aed21bccdfc5 (patch) | |
tree | c2f53f827372904f8d7b1356231350652bed8a8d /include/sway | |
parent | xwayland: pass focus to previous unmanaged surface on unmap (diff) | |
download | sway-fcd0ab8f331a6e74fde113d665d4aed21bccdfc5.tar.gz sway-fcd0ab8f331a6e74fde113d665d4aed21bccdfc5.tar.zst sway-fcd0ab8f331a6e74fde113d665d4aed21bccdfc5.zip |
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')
-rw-r--r-- | include/sway/tree/view.h | 13 |
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 { | |||
55 | void (*destroy)(struct sway_view *view); | 55 | void (*destroy)(struct sway_view *view); |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct sway_saved_buffer { | ||
59 | struct wlr_client_buffer *buffer; | ||
60 | int x, y; | ||
61 | int width, height; | ||
62 | struct wl_list link; // sway_view::saved_buffers | ||
63 | }; | ||
64 | |||
58 | struct sway_view { | 65 | struct sway_view { |
59 | enum sway_view_type type; | 66 | enum sway_view_type type; |
60 | const struct sway_view_impl *impl; | 67 | const struct sway_view_impl *impl; |
@@ -65,9 +72,6 @@ struct sway_view { | |||
65 | 72 | ||
66 | pid_t pid; | 73 | pid_t pid; |
67 | 74 | ||
68 | double saved_x, saved_y; | ||
69 | int saved_width, saved_height; | ||
70 | |||
71 | // The size the view would want to be if it weren't tiled. | 75 | // The size the view would want to be if it weren't tiled. |
72 | // Used when changing a view from tiled to floating. | 76 | // Used when changing a view from tiled to floating. |
73 | int natural_width, natural_height; | 77 | int natural_width, natural_height; |
@@ -80,8 +84,7 @@ struct sway_view { | |||
80 | bool allow_request_urgent; | 84 | bool allow_request_urgent; |
81 | struct wl_event_source *urgent_timer; | 85 | struct wl_event_source *urgent_timer; |
82 | 86 | ||
83 | struct wlr_client_buffer *saved_buffer; | 87 | struct wl_list saved_buffers; // sway_saved_buffer::link |
84 | int saved_buffer_width, saved_buffer_height; | ||
85 | 88 | ||
86 | // The geometry for whatever the client is committing, regardless of | 89 | // The geometry for whatever the client is committing, regardless of |
87 | // transaction state. Updated on every commit. | 90 | // transaction state. Updated on every commit. |