[gnome-shell] global: Filter out destroyed actors from get_window_actors()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] global: Filter out destroyed actors from get_window_actors()
- Date: Thu, 11 Sep 2014 15:52:44 +0000 (UTC)
commit 93205eefb9c55828bf96b17ee3bc239d1e847d1c
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Sep 10 22:41:40 2014 +0200
global: Filter out destroyed actors from get_window_actors()
All current code assumes that the list of window actors corresponds to the
list of windows; however as the list returned by meta_get_window_actors()
now includes actors during the destroy animation, that assumption breaks.
Eventually we should make everyone move to a more appropriate API, but
for now make it work again by returning a filtered list of "good"
window actors.
https://bugzilla.gnome.org/show_bug.cgi?id=735927
src/shell-global.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index 1e65530..d90ceaf 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -735,14 +735,21 @@ shell_global_get_display (ShellGlobal *global)
*
* Gets the list of #MetaWindowActor for the plugin's screen
*
- * Return value: (element-type Meta.WindowActor) (transfer none): the list of windows
+ * Return value: (element-type Meta.WindowActor) (transfer container): the list of windows
*/
GList *
shell_global_get_window_actors (ShellGlobal *global)
{
+ GList *filtered = NULL;
+ GList *l;
+
g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL);
- return meta_get_window_actors (global->meta_screen);
+ for (l = meta_get_window_actors (global->meta_screen); l; l = l->next)
+ if (!meta_window_actor_is_destroyed (l->data))
+ filtered = g_list_prepend (filtered, l->data);
+
+ return g_list_reverse (filtered);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]