From 558d528f70bece1bcecc1049c862d928d46ba1f6 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Sat, 20 May 2023 17:34:52 +0200 Subject: [PATCH] Fix xdg_toplevel background --- src/state.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 992e8ad..cf786f5 100644 --- a/src/state.rs +++ b/src/state.rs @@ -270,7 +270,7 @@ impl Dispatch for State { match &state.bg_surface.wl_surface { Some(surface) => { let buffer = - singlepixel.create_u32_rgba_buffer(0, 0, 0, 0xFFFFFFFF, qh, ()); + singlepixel.create_u32_rgba_buffer(0, 0, 0, 0xFAFAFAFA, qh, ()); surface.attach(Some(&buffer), 0, 0); surface.damage_buffer(0, 0, 1, 1); } @@ -504,6 +504,14 @@ impl Dispatch for State { } if state.dimensions != (width, height) { + match (&state.bg_surface.wl_surface, &state.bg_surface.viewport) { + (Some(surface), Some(viewport)) => { + viewport.set_destination(width, height); + surface.commit(); + } + _ => todo!("handle early xdg creation"), + } + state.bufmgr.clear_buffers(); state.dimensions = (width, height); state.fonts.resolve();