From c57294b41ada60536faf88ba91d7961a2b07a36f Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 10 Apr 2022 03:56:01 +0300 Subject: [PATCH] On Wayland commit after setting all startup props The commit without buffer attached should be done after setting all top level size/application related properties. While c4df7ad7a added commit after setting decorations, it accounted just for decorations, however we should account for the min/max size and other attributes. --- src/platform_impl/linux/wayland/window/mod.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/platform_impl/linux/wayland/window/mod.rs b/src/platform_impl/linux/wayland/window/mod.rs index fa48c573..cda1fc6e 100644 --- a/src/platform_impl/linux/wayland/window/mod.rs +++ b/src/platform_impl/linux/wayland/window/mod.rs @@ -145,12 +145,6 @@ impl Window { } else { window.set_decorate(Decorations::None); } - // Without this commit here at least on kwin 5.23.3 the initial configure - // will have a size (1,1), the second configure including the decoration - // mode will have the min_size as its size. With this commit the initial - // configure will have no size, the application will draw it's content - // with the initial size and everything works as expected afterwards. - window.surface().commit(); // Min dimensions. let min_size = attributes @@ -198,6 +192,16 @@ impl Window { } } + // Without this commit here at least on kwin 5.23.3 the initial configure + // will have a size (1,1), the second configure including the decoration + // mode will have the min_size as its size. With this commit the initial + // configure will have no size, the application will draw it's content + // with the initial size and everything works as expected afterwards. + // + // The window commit must be after setting on top level properties, but right before any + // buffer attachments commits. + window.surface().commit(); + let size = Arc::new(Mutex::new(LogicalSize::new(width, height))); // We should trigger redraw and commit the surface for the newly created window.