From b60d4c9db018bf64ea2eb1ecf434708a7ee82c67 Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Tue, 29 Sep 2020 17:20:59 +0900 Subject: [PATCH] Fix crash on creating child frames. * src/pgtkfns.c (frame_geometry): Returns nil when no widget. --- src/pgtkfns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pgtkfns.c b/src/pgtkfns.c index c6909ba3d63..4ecb03b91c0 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -3316,6 +3316,8 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute) gtk_window_get_position (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), &left_pos, &top_pos); } else { + if (FRAME_GTK_WIDGET (f) == NULL) + return Qnil; /* This can occur while creating a frame. */ GtkAllocation alloc; gtk_widget_get_allocation (FRAME_GTK_WIDGET (f), &alloc); left_pos = alloc.x; -- 2.39.5