mirror of
https://github.com/brl/mutter.git
synced 2025-08-10 10:24:47 +00:00
display: include wayland clients in the tab list
Make sure that meta_display_list_windows() returns wayland windows too, by keeping a separate hash for wayland clients. This fixes a crash in the alt-tab code of gnome-shell. Reviewed by drago01 in IRC.
This commit is contained in:
@@ -607,6 +607,7 @@ meta_display_open (void)
|
||||
|
||||
the_display->xids = g_hash_table_new (meta_unsigned_long_hash,
|
||||
meta_unsigned_long_equal);
|
||||
the_display->wayland_windows = g_hash_table_new (NULL, NULL);
|
||||
|
||||
i = 0;
|
||||
while (i < N_IGNORED_CROSSING_SERIALS)
|
||||
@@ -1048,6 +1049,19 @@ meta_display_list_windows (MetaDisplay *display,
|
||||
winlist = g_slist_prepend (winlist, window);
|
||||
}
|
||||
|
||||
g_hash_table_iter_init (&iter, display->wayland_windows);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
MetaWindow *window = value;
|
||||
|
||||
if (!META_IS_WINDOW (window))
|
||||
continue;
|
||||
|
||||
if (!window->override_redirect ||
|
||||
(flags & META_LIST_INCLUDE_OVERRIDE_REDIRECT) != 0)
|
||||
winlist = g_slist_prepend (winlist, window);
|
||||
}
|
||||
|
||||
/* Uniquify the list, since both frame windows and plain
|
||||
* windows are in the hash
|
||||
*/
|
||||
@@ -3864,6 +3878,20 @@ meta_display_unregister_x_window (MetaDisplay *display,
|
||||
remove_pending_pings_for_window (display, xwindow);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_register_wayland_window (MetaDisplay *display,
|
||||
MetaWindow *window)
|
||||
{
|
||||
g_hash_table_add (display->wayland_windows, window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_unregister_wayland_window (MetaDisplay *display,
|
||||
MetaWindow *window)
|
||||
{
|
||||
g_hash_table_remove (display->wayland_windows, window);
|
||||
}
|
||||
|
||||
#ifdef HAVE_XSYNC
|
||||
/* We store sync alarms in the window ID hash table, because they are
|
||||
* just more types of XIDs in the same global space, but we have
|
||||
|
Reference in New Issue
Block a user