Merge branch 'fix/wm_class2' into 'master'

x11: ensure WM class is not null even if display is initialized early

See merge request GNOME/gtk!3808
This commit is contained in:
Matthias Clasen 2021-08-18 18:24:37 +00:00
commit 03031b3dc1
2 changed files with 4 additions and 4 deletions

View File

@ -204,9 +204,6 @@ static void
gdk_x11_display_init (GdkX11Display *self)
{
self->monitors = g_list_store_new (GDK_TYPE_MONITOR);
self->program_class = g_strdup (g_get_prgname ());
if (self->program_class && self->program_class[0])
self->program_class[0] = g_ascii_toupper (self->program_class[0]);
}
static void

View File

@ -1282,7 +1282,10 @@ _gdk_x11_display_create_surface (GdkDisplay *display,
class_hint = XAllocClassHint ();
class_hint->res_name = (char *) g_get_prgname ();
class_hint->res_class = (char *) display_x11->program_class;
if (display_x11->program_class)
class_hint->res_class = (char *) display_x11->program_class;
else
class_hint->res_class = class_hint->res_name;
XSetClassHint (xdisplay, impl->xid, class_hint);
XFree (class_hint);