core/delete: Avoid warnings when there is no close dialog

The "ensure dialog" function didn't ensure there was a dialog created,
so the function was renamed. The callers was updated to handle the
dialog not being created.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
This commit is contained in:
Jonas Ådahl 2022-12-20 12:41:31 +01:00 committed by Marge Bot
parent 0f4e0cfd52
commit e8e8a63054

View File

@ -46,7 +46,7 @@ close_dialog_response_cb (MetaCloseDialog *dialog,
} }
static void static void
meta_window_ensure_close_dialog (MetaWindow *window) meta_window_maybe_ensure_close_dialog (MetaWindow *window)
{ {
MetaDisplay *display; MetaDisplay *display;
@ -65,7 +65,11 @@ meta_window_ensure_close_dialog (MetaWindow *window)
void void
meta_window_show_close_dialog (MetaWindow *window) meta_window_show_close_dialog (MetaWindow *window)
{ {
meta_window_ensure_close_dialog (window); meta_window_maybe_ensure_close_dialog (window);
if (!window->close_dialog)
return;
meta_close_dialog_show (window->close_dialog); meta_close_dialog_show (window->close_dialog);
if (window->display && if (window->display &&