forked from AuroraMiddleware/gtk
2ebde276d1
With gtkmm, when using `Application()`, the display is initialized
before we know the application name and therefore, the program class
associated to the display is NULL.
Instead of providing a default value, we set it equal to program name
when NULL. Moreover, we give up on capitalizing the class name to keep
the code super simple. Also, not using a capitalized name is
consistent with `gdk_x11_display_open()`. If someone has a good reason
to use a capitalized name, here is how to do it.
```c
class_hint = XAllocClassHint ();
class_hint->res_name = (char *) g_get_prgname ();
if (display_x11->program_class)
{
class_hint->res_class = (char *) g_strdup (display_x11->program_class);
}
else if (class_hint->res_name && class_hint->res_name[0])
{
class_hint->res_class = (char *) g_strdup (class_hint->res_name);
class_hint->res_class[0] = g_ascii_toupper (class_hint->res_class[0]);
}
XSetClassHint (xdisplay, impl->xid, class_hint);
g_free (class_hint->res_class);
XFree (class_hint);
```
Fix
|
||
---|---|---|
.. | ||
gdkapplaunchcontext-x11.c | ||
gdkasync.c | ||
gdkasync.h | ||
gdkcairocontext-x11.c | ||
gdkcairocontext-x11.h | ||
gdkclipboard-x11.c | ||
gdkclipboard-x11.h | ||
gdkcursor-x11.c | ||
gdkdevice-xi2-private.h | ||
gdkdevice-xi2.c | ||
gdkdevicemanager-x11.c | ||
gdkdevicemanager-xi2.c | ||
gdkdevicemanagerprivate-core.h | ||
gdkdisplay-x11.c | ||
gdkdisplay-x11.h | ||
gdkdrag-x11.c | ||
gdkdrop-x11.c | ||
gdkeventsource.c | ||
gdkeventsource.h | ||
gdkeventtranslator.c | ||
gdkeventtranslator.h | ||
gdkglcontext-egl.c | ||
gdkglcontext-glx.c | ||
gdkglcontext-x11.c | ||
gdkglcontext-x11.h | ||
gdkkeys-x11.c | ||
gdkkeys-x11.h | ||
gdkmain-x11.c | ||
gdkmonitor-x11.c | ||
gdkmonitor-x11.h | ||
gdkprivate-x11.h | ||
gdkproperty-x11.c | ||
gdkscreen-x11.c | ||
gdkscreen-x11.h | ||
gdkselection-x11.c | ||
gdkselectioninputstream-x11.c | ||
gdkselectioninputstream-x11.h | ||
gdkselectionoutputstream-x11.c | ||
gdkselectionoutputstream-x11.h | ||
gdksettings.c | ||
gdksurface-x11.c | ||
gdksurface-x11.h | ||
gdktextlistconverter-x11.c | ||
gdktextlistconverter-x11.h | ||
gdkvulkancontext-x11.c | ||
gdkvulkancontext-x11.h | ||
gdkx11applaunchcontext.h | ||
gdkx11device-xi2.h | ||
gdkx11device.h | ||
gdkx11devicemanager-xi2.h | ||
gdkx11devicemanager.h | ||
gdkx11display.h | ||
gdkx11dnd.h | ||
gdkx11glcontext.h | ||
gdkx11monitor.h | ||
gdkx11property.h | ||
gdkx11screen.h | ||
gdkx11selection.h | ||
gdkx11surface.h | ||
gdkx11utils.h | ||
gdkx-autocleanups.h | ||
gdkx.h | ||
gdkxftdefaults.c | ||
gdkxid.c | ||
meson.build | ||
MwmUtil.h | ||
xsettings-client.c | ||
xsettings-client.h |