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.
This commit is contained in:
Kirill Chibisov 2022-04-10 03:56:01 +03:00 committed by GitHub
parent 485e82dcb1
commit c57294b41a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,12 +145,6 @@ impl Window {
} else { } else {
window.set_decorate(Decorations::None); 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. // Min dimensions.
let min_size = attributes 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))); let size = Arc::new(Mutex::new(LogicalSize::new(width, height)));
// We should trigger redraw and commit the surface for the newly created window. // We should trigger redraw and commit the surface for the newly created window.