Merge branch 'andyholmes/get-default-size' into 'main'

gtk: fix NULL pointer dereference

See merge request GNOME/gtk!6559
This commit is contained in:
Benjamin Otte 2023-11-14 11:08:53 +00:00
commit 7299c9baa9

View File

@ -397,10 +397,6 @@ static int gtk_window_focus (GtkWidget *widget,
static void gtk_window_move_focus (GtkWidget *widget,
GtkDirectionType dir);
static void gtk_window_get_remembered_size (GtkWindow *window,
int *width,
int *height);
static void gtk_window_real_activate_default (GtkWindow *window);
static void gtk_window_real_activate_focus (GtkWindow *window);
static void gtk_window_keys_changed (GtkWindow *window);
@ -3659,9 +3655,15 @@ gtk_window_get_default_size (GtkWindow *window,
int *width,
int *height)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
g_return_if_fail (GTK_IS_WINDOW (window));
gtk_window_get_remembered_size (window, width, height);
if (width != NULL)
*width = priv->default_width;
if (height != NULL)
*height = priv->default_height;
}
static gboolean
@ -3984,17 +3986,6 @@ gtk_window_unmap (GtkWidget *widget)
gtk_widget_unmap (child);
}
static void
gtk_window_get_remembered_size (GtkWindow *window,
int *width,
int *height)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
*width = priv->default_width;
*height = priv->default_height;
}
static void
check_scale_changed (GtkWindow *window)
{