From 96c8c024830f13a27790d4ea36b640df383a7f49 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 30 Jun 2018 14:30:14 +1000 Subject: 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. --- sway/desktop/transaction.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sway/desktop/transaction.c') 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) { instruction->state.view_width, instruction->state.view_height); ++transaction->num_waiting; + + // From here on we are rendering a saved buffer of the view, which + // means we can send a frame done event to make the client redraw it + // as soon as possible. Additionally, this is required if a view is + // mapping and its default geometry doesn't intersect an output. + struct timespec when; + wlr_surface_send_frame_done(con->sway_view->surface, &when); } list_add(con->instructions, instruction); } -- cgit v1.2.3-54-g00ecf