macos: Don't set NULL as a display name
authorBilal Elmoussaoui <belmouss@redhat.com>
Tue, 8 Feb 2022 12:38:33 +0000 (13:38 +0100)
committerBilal Elmoussaoui <belmouss@redhat.com>
Tue, 8 Feb 2022 12:38:33 +0000 (13:38 +0100)
Other GDK backends ensure there is always a default name set.
Fixes https://github.com/gtk-rs/gtk4-rs/issues/868

gdk/macos/gdkmacosdisplay.c

index 657fb57558e8a2f81fe0bf4d3b7e6cd945acd109..8d3aa0224e42036c5cd5781415b67d2ad43e70e3 100644 (file)
@@ -730,7 +730,8 @@ _gdk_macos_display_open (const char *display_name)
   if (self != NULL)
     return NULL;
 
-  GDK_NOTE (MISC, g_message ("opening display %s", display_name ? display_name : ""));
+  display_name = display_name ? display_name : "";
+  GDK_NOTE (MISC, g_message ("opening display %s", display_name));
 
   /* Make the current process a foreground application, i.e. an app
    * with a user interface, in case we're not running from a .app bundle