| 1 |
--- trunk/src/core/window-props.c 2009/03/11 14:21:33 4190
|
| 2 |
+++ trunk/src/core/window-props.c 2009/03/12 01:09:41 4191
|
| 3 |
@@ -73,12 +73,6 @@
|
| 4 |
ReloadValueFunc reload_func;
|
| 5 |
} MetaWindowPropHooks;
|
| 6 |
|
| 7 |
-static void init_prop_value (MetaDisplay *display,
|
| 8 |
- Atom property,
|
| 9 |
- MetaPropValue *value);
|
| 10 |
-static void reload_prop_value (MetaWindow *window,
|
| 11 |
- MetaPropValue *value,
|
| 12 |
- gboolean initial);
|
| 13 |
static MetaWindowPropHooks* find_hooks (MetaDisplay *display,
|
| 14 |
Atom property);
|
| 15 |
|
| 16 |
@@ -128,23 +122,34 @@
|
| 17 |
g_return_if_fail (n_properties > 0);
|
| 18 |
|
| 19 |
values = g_new0 (MetaPropValue, n_properties);
|
| 20 |
-
|
| 21 |
- i = 0;
|
| 22 |
- while (i < n_properties)
|
| 23 |
+
|
| 24 |
+ for (i=0; i<n_properties; i++)
|
| 25 |
{
|
| 26 |
- init_prop_value (window->display, properties[i], &values[i]);
|
| 27 |
- ++i;
|
| 28 |
+ MetaWindowPropHooks *hooks = find_hooks (window->display,
|
| 29 |
+ properties[i]);
|
| 30 |
+
|
| 31 |
+ if (!hooks || hooks->type == META_PROP_VALUE_INVALID)
|
| 32 |
+ {
|
| 33 |
+ values[i].type = META_PROP_VALUE_INVALID;
|
| 34 |
+ values[i].atom = None;
|
| 35 |
+ }
|
| 36 |
+ else
|
| 37 |
+ {
|
| 38 |
+ values[i].type = hooks->type;
|
| 39 |
+ values[i].atom = properties[i];
|
| 40 |
+ }
|
| 41 |
}
|
| 42 |
|
| 43 |
meta_prop_get_values (window->display, xwindow,
|
| 44 |
values, n_properties);
|
| 45 |
|
| 46 |
- i = 0;
|
| 47 |
- while (i < n_properties)
|
| 48 |
+ for (i=0; i<n_properties; i++)
|
| 49 |
{
|
| 50 |
- reload_prop_value (window, &values[i], initial);
|
| 51 |
-
|
| 52 |
- ++i;
|
| 53 |
+ MetaWindowPropHooks *hooks = find_hooks (window->display,
|
| 54 |
+ properties[i]);
|
| 55 |
+
|
| 56 |
+ if (hooks && hooks->reload_func != NULL)
|
| 57 |
+ (* hooks->reload_func) (window, &values[i], initial);
|
| 58 |
}
|
| 59 |
|
| 60 |
meta_prop_free_values (values, n_properties);
|
| 61 |
@@ -152,37 +157,6 @@
|
| 62 |
g_free (values);
|
| 63 |
}
|
| 64 |
|
| 65 |
-/* Fill in the MetaPropValue used to get the value of "property" */
|
| 66 |
-static void
|
| 67 |
-init_prop_value (MetaDisplay *display,
|
| 68 |
- Atom property,
|
| 69 |
- MetaPropValue *value)
|
| 70 |
-{
|
| 71 |
- MetaWindowPropHooks *hooks = find_hooks (display, property);
|
| 72 |
-
|
| 73 |
- if (!hooks || hooks->type == META_PROP_VALUE_INVALID)
|
| 74 |
- {
|
| 75 |
- value->type = META_PROP_VALUE_INVALID;
|
| 76 |
- value->atom = None;
|
| 77 |
- }
|
| 78 |
- else
|
| 79 |
- {
|
| 80 |
- value->type = hooks->type;
|
| 81 |
- value->atom = property;
|
| 82 |
- }
|
| 83 |
-}
|
| 84 |
-
|
| 85 |
-static void
|
| 86 |
-reload_prop_value (MetaWindow *window,
|
| 87 |
- MetaPropValue *value,
|
| 88 |
- gboolean initial)
|
| 89 |
-{
|
| 90 |
- MetaWindowPropHooks *hooks = find_hooks (window->display, value->atom);
|
| 91 |
-
|
| 92 |
- if (hooks && hooks->reload_func != NULL)
|
| 93 |
- (* hooks->reload_func) (window, value, initial);
|
| 94 |
-}
|
| 95 |
-
|
| 96 |
static void
|
| 97 |
reload_wm_client_machine (MetaWindow *window,
|
| 98 |
MetaPropValue *value,
|
| 99 |
@@ -1566,6 +1540,9 @@
|
| 100 |
display->prop_hooks_table = NULL;
|
| 101 |
}
|
| 102 |
|
| 103 |
+/**
|
| 104 |
+ * Finds the hooks for a particular property.
|
| 105 |
+ */
|
| 106 |
static MetaWindowPropHooks*
|
| 107 |
find_hooks (MetaDisplay *display,
|
| 108 |
Atom property)
|
| 109 |
|