mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
wayland/keyboard: Cleanup resource list management
Initialize on init(), unlink and reinitialize the list headers on disable() so that any delayed resource destruction doesn't affect future state. https://bugzilla.gnome.org/show_bug.cgi?id=771646
This commit is contained in:
parent
312f215fc3
commit
578e527869
@ -608,9 +608,6 @@ meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
GSettingsSchema *schema;
|
||||
|
||||
wl_list_init (&keyboard->resource_list);
|
||||
wl_list_init (&keyboard->focus_resource_list);
|
||||
|
||||
keyboard->settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
|
||||
g_signal_connect (keyboard->settings, "changed",
|
||||
G_CALLBACK (settings_changed), keyboard);
|
||||
@ -672,7 +669,10 @@ meta_wayland_keyboard_disable (MetaWaylandKeyboard *keyboard)
|
||||
meta_wayland_keyboard_set_focus (keyboard, NULL);
|
||||
meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
|
||||
|
||||
/* XXX: What about keyboard->resource_list? */
|
||||
wl_list_remove (&keyboard->resource_list);
|
||||
wl_list_init (&keyboard->resource_list);
|
||||
wl_list_remove (&keyboard->focus_resource_list);
|
||||
wl_list_init (&keyboard->focus_resource_list);
|
||||
|
||||
g_clear_object (&keyboard->settings);
|
||||
if (keyboard->gsd_settings)
|
||||
@ -963,6 +963,9 @@ meta_wayland_keyboard_end_grab (MetaWaylandKeyboard *keyboard)
|
||||
static void
|
||||
meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
wl_list_init (&keyboard->resource_list);
|
||||
wl_list_init (&keyboard->focus_resource_list);
|
||||
|
||||
meta_wayland_xkb_info_init (&keyboard->xkb_info);
|
||||
|
||||
keyboard->default_grab.interface = &default_keyboard_grab_interface;
|
||||
|
Loading…
Reference in New Issue
Block a user