summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas James Alexander Thurman <tthurman@src.gnome.org>2009-03-12 01:09:41 +0000
committerThomas Thurman <tthurman@gnome.org>2009-07-06 07:14:49 -0400
commit9a1ff07b551bafa3cb5b0580fd73350ce93463b4 (patch)
tree21e5b7563b81b43a750e7a2042f9865bcce2daa0
parent513e5428af060723eaea873482e4e1fb0da45ef1 (diff)
downloadmetacity-9a1ff07b551bafa3cb5b0580fd73350ce93463b4.tar.gz
fix problem where the previous code ignored callbacks for properties whose
* src/core/window-props.c: fix problem where the previous code ignored callbacks for properties whose values weren't looked up. Closes #572573. svn path=/trunk/; revision=4191
-rw-r--r--ChangeLog10
-rw-r--r--src/core/window-props.c71
2 files changed, 32 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index e68822de..c2a38bbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
-2009-03-16 Thomas Thurman <tthurman@gnome.org>
+2009-07-06 Ori Avtalion <ori@avtalion.name>
- * NEWS: 2.26.0 release.
+ * src/core/window-props.c: fix problem where the previous
+ code ignored callbacks for properties whose values weren't
+ looked up. Closes #572573.
+2009-03-16 Thomas Thurman <tthurman@gnome.org>
+
+ * NEWS: 2.26.0 release.
+
2009-02-04 Neil Jagdish Patel <njpatel@gmail.com>
* src/core/frame.c: queue resize on window undecorate
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 2ef3597a..06eb8874 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -63,12 +63,6 @@ typedef struct MetaWindowPropHooks
ReloadValueFunc reload_func;
} MetaWindowPropHooks;
-static void init_prop_value (MetaDisplay *display,
- Atom property,
- MetaPropValue *value);
-static void reload_prop_value (MetaWindow *window,
- MetaPropValue *value,
- gboolean initial);
static MetaWindowPropHooks* find_hooks (MetaDisplay *display,
Atom property);
@@ -118,23 +112,34 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
g_return_if_fail (n_properties > 0);
values = g_new0 (MetaPropValue, n_properties);
-
- i = 0;
- while (i < n_properties)
+
+ for (i=0; i<n_properties; i++)
{
- init_prop_value (window->display, properties[i], &values[i]);
- ++i;
+ MetaWindowPropHooks *hooks = find_hooks (window->display,
+ properties[i]);
+
+ if (!hooks || hooks->type == META_PROP_VALUE_INVALID)
+ {
+ values[i].type = META_PROP_VALUE_INVALID;
+ values[i].atom = None;
+ }
+ else
+ {
+ values[i].type = hooks->type;
+ values[i].atom = properties[i];
+ }
}
meta_prop_get_values (window->display, xwindow,
values, n_properties);
- i = 0;
- while (i < n_properties)
+ for (i=0; i<n_properties; i++)
{
- reload_prop_value (window, &values[i], initial);
-
- ++i;
+ MetaWindowPropHooks *hooks = find_hooks (window->display,
+ properties[i]);
+
+ if (hooks && hooks->reload_func != NULL)
+ (* hooks->reload_func) (window, &values[i], initial);
}
meta_prop_free_values (values, n_properties);
@@ -142,37 +147,6 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
g_free (values);
}
-/* Fill in the MetaPropValue used to get the value of "property" */
-static void
-init_prop_value (MetaDisplay *display,
- Atom property,
- MetaPropValue *value)
-{
- MetaWindowPropHooks *hooks = find_hooks (display, property);
-
- if (!hooks || hooks->type == META_PROP_VALUE_INVALID)
- {
- value->type = META_PROP_VALUE_INVALID;
- value->atom = None;
- }
- else
- {
- value->type = hooks->type;
- value->atom = property;
- }
-}
-
-static void
-reload_prop_value (MetaWindow *window,
- MetaPropValue *value,
- gboolean initial)
-{
- MetaWindowPropHooks *hooks = find_hooks (window->display, value->atom);
-
- if (hooks && hooks->reload_func != NULL)
- (* hooks->reload_func) (window, value, initial);
-}
-
static void
reload_wm_client_machine (MetaWindow *window,
MetaPropValue *value,
@@ -1469,6 +1443,9 @@ meta_display_free_window_prop_hooks (MetaDisplay *display)
display->prop_hooks_table = NULL;
}
+/**
+ * Finds the hooks for a particular property.
+ */
static MetaWindowPropHooks*
find_hooks (MetaDisplay *display,
Atom property)