mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 09:40:19 +00:00
Fix accessibility not getting initialized in gtk_init() if a default display is already set
_gtk_accessibility_init() only gets called if the default display changes, but in case gdk_init() is called before gtk_init() the default display is already set and no property notification occurs. This can happen quite easily in pygobject where "from gi.repository import Gdk, Gtk" will call gdk_init() followed by gtk_init() in the Python overrides. This fixes it by checking for a default display in all cases.
This commit is contained in:
parent
ecb0e777fa
commit
263cbd90a0
@ -698,6 +698,8 @@ static void
|
||||
do_post_parse_initialization (int *argc,
|
||||
char ***argv)
|
||||
{
|
||||
GdkDisplayManager *display_manager;
|
||||
|
||||
if (gtk_initialized)
|
||||
return;
|
||||
|
||||
@ -737,7 +739,11 @@ do_post_parse_initialization (int *argc,
|
||||
_gtk_modules_init (argc, argv, NULL);
|
||||
}
|
||||
|
||||
g_signal_connect (gdk_display_manager_get (), "notify::default-display",
|
||||
display_manager = gdk_display_manager_get ();
|
||||
if (gdk_display_manager_get_default_display (display_manager) != NULL)
|
||||
_gtk_accessibility_init ();
|
||||
|
||||
g_signal_connect (display_manager, "notify::default-display",
|
||||
G_CALLBACK (default_display_notify_cb),
|
||||
NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user