win32: Don't return existing display from gdk_display_open()
Existing code assumes displays are new connections and calls gdk_display_close() on the display when done with whatever it was doing. If we return an existing display, that display gets closed... It's also what the other backends do, including MacOS. Fixes gsk/misc test.
This commit is contained in:
@@ -527,18 +527,16 @@ _gdk_win32_display_open (const char *display_name)
|
|||||||
|
|
||||||
GDK_NOTE (MISC, g_print ("gdk_display_open: %s\n", (display_name ? display_name : "NULL")));
|
GDK_NOTE (MISC, g_print ("gdk_display_open: %s\n", (display_name ? display_name : "NULL")));
|
||||||
|
|
||||||
if (display_name == NULL || g_ascii_strcasecmp (display_name, gdk_display_get_name (display)) == 0)
|
if (display != NULL)
|
||||||
{
|
{
|
||||||
if (display != NULL)
|
GDK_NOTE (MISC, g_print ("... Display is already open\n"));
|
||||||
{
|
return NULL;
|
||||||
GDK_NOTE (MISC, g_print ("... return existing gdkdisplay\n"));
|
|
||||||
return display;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (display_name != NULL)
|
||||||
{
|
{
|
||||||
/* we don't really support multiple GdkDisplay's on Windows at this point */
|
/* we don't really support multiple GdkDisplay's on Windows at this point */
|
||||||
GDK_NOTE (MISC, g_print ("... return NULL\n"));
|
GDK_NOTE (MISC, g_print ("... win32 does not support named displays, but given name was \"%s\"\n", display_name));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user