From 497f9be61e46fa457a70797414a18ac0a26db745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Nov 2011 01:52:24 +0100 Subject: [PATCH] window: Listen for pref changes The workspaces-only-on-primary preference changes how windows are displayed, so listen for pref changes and update the visibility accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=664853 --- src/core/window.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/window.c b/src/core/window.c index d9c1c13ad..8d6267254 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -179,6 +179,20 @@ enum static guint window_signals[LAST_SIGNAL] = { 0 }; +static void +prefs_changed_callback (MetaPreference pref, + gpointer data) +{ + MetaWindow *window = data; + + if (pref != META_PREF_WORKSPACES_ONLY_ON_PRIMARY) + return; + + meta_window_update_on_all_workspaces (window); + + meta_window_queue (window, META_QUEUE_CALC_SHOWING); +} + static void meta_window_finalize (GObject *object) { @@ -195,6 +209,8 @@ meta_window_finalize (GObject *object) meta_icon_cache_free (&window->icon_cache); + meta_prefs_remove_listener (prefs_changed_callback, window); + g_free (window->sm_client_id); g_free (window->wm_client_machine); g_free (window->startup_id); @@ -475,6 +491,7 @@ meta_window_class_init (MetaWindowClass *klass) static void meta_window_init (MetaWindow *self) { + meta_prefs_add_listener (prefs_changed_callback, self); } #ifdef WITH_VERBOSE_MODE