GDK_NO_XSETTINGS leaves the settings of the desktop unread, GTK_LOCALEDIR points to the translations of GTK+ (from Ardour's YTK)

This commit is contained in:
Daemonratte 2026-10-17 17:22:24 +02:00
commit b024119172
No known key found for this signature in database
2 changed files with 16 additions and 3 deletions

View file

@ -190,6 +190,11 @@ _gdk_x11_events_init_screen (GdkScreen *screen)
{
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
/* GDK_NO_XSETTINGS: the settings of the desktop are not read, to see
* what a program does without them (as Ardour's YDK has it) */
if (g_getenv ("GDK_NO_XSETTINGS"))
return;
/* Keep a flag to avoid extra notifies that we don't need
*/
screen_x11->xsettings_in_init = TRUE;
@ -3191,7 +3196,7 @@ gdk_screen_get_setting (GdkScreen *screen,
break;
}
if (!xsettings_name)
if (!xsettings_name || !screen_x11->xsettings_client)
goto out;
result = xsettings_client_get_setting (screen_x11->xsettings_client,

View file

@ -723,8 +723,16 @@ gettext_initialization (void)
setlocale_initialization ();
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, GTK_LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE "-properties", GTK_LOCALEDIR);
/* GTK_LOCALEDIR: the translations of GTK+ elsewhere, for programs
* that bring GTK+ along (as Ardour's YTK has it) */
{
const gchar *localedir = g_getenv ("GTK_LOCALEDIR");
if (localedir == NULL || localedir[0] == '\0')
localedir = GTK_LOCALEDIR;
bindtextdomain (GETTEXT_PACKAGE, localedir);
bindtextdomain (GETTEXT_PACKAGE "-properties", localedir);
}
# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
bind_textdomain_codeset (GETTEXT_PACKAGE "-properties", "UTF-8");