aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-30 14:30:14 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-30 14:30:14 +1000
commit96c8c024830f13a27790d4ea36b640df383a7f49 (patch)
tree1dfb16aaaf34793103d4fcb88ced9c12e4d06505 /sway/desktop/transaction.c
parentRender saved buffers with the surface's dimensions (diff)
downloadsway-96c8c024830f13a27790d4ea36b640df383a7f49.tar.gz
sway-96c8c024830f13a27790d4ea36b640df383a7f49.tar.zst
sway-96c8c024830f13a27790d4ea36b640df383a7f49.zip
Fix flash of background when xwayland views are mapped
A flash of background was happening for two reasons: 1) We were using the xsurface's dimensions to check if the surface is ready, but these are pending dimensions. 2) In my particular setup, the default geometry of the xsurface does not intersect any output, which prevented it from receiving a frame done event. This made the transaction time out and the client would only redraw once it's been rendered.
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 7c5a9b8f..d2932c87 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -298,6 +298,13 @@ void transaction_commit(struct sway_transaction *transaction) {
298 instruction->state.view_width, 298 instruction->state.view_width,
299 instruction->state.view_height); 299 instruction->state.view_height);
300 ++transaction->num_waiting; 300 ++transaction->num_waiting;
301
302 // From here on we are rendering a saved buffer of the view, which
303 // means we can send a frame done event to make the client redraw it
304 // as soon as possible. Additionally, this is required if a view is
305 // mapping and its default geometry doesn't intersect an output.
306 struct timespec when;
307 wlr_surface_send_frame_done(con->sway_view->surface, &when);
301 } 308 }
302 list_add(con->instructions, instruction); 309 list_add(con->instructions, instruction);
303 } 310 }