x11: fix crash on idle compute size without layout

On x11 toplevel layout is not created before toplevel
is presented, but GTK tries to update it on idle
which leads to a crash due to accessing property
of undefined object. Treat soon to be created layout
as a layout with default values upon creation (resizable).
This commit is contained in:
Rafostar 2021-01-03 18:02:31 +01:00
parent 51a6b29e01
commit 53af35d256
No known key found for this signature in database
GPG Key ID: B6FBB8ADAF40A568

View File

@ -291,7 +291,7 @@ compute_toplevel_size (GdkSurface *surface,
GdkGeometry geometry; GdkGeometry geometry;
GdkSurfaceHints mask; GdkSurfaceHints mask;
if (gdk_toplevel_layout_get_resizable (impl->toplevel_layout)) if (!impl->toplevel_layout || gdk_toplevel_layout_get_resizable (impl->toplevel_layout))
{ {
geometry.min_width = size.min_width; geometry.min_width = size.min_width;
geometry.min_height = size.min_height; geometry.min_height = size.min_height;