[metacity] Revert "fix problem where the previous code ignored callbacks for properties whose"
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] Revert "fix problem where the previous code ignored callbacks for properties whose"
- Date: Sun, 5 Oct 2014 00:17:50 +0000 (UTC)
commit a53865e758ff4981e675f5b7280b237f1bb4bd19
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Sep 30 19:19:54 2014 +0300
Revert "fix problem where the previous code ignored callbacks for properties whose"
This reverts commit 178b5ff626d747026fc9d03c7908c3f203fbd263.
Conflicts:
ChangeLog
src/core/window-props.c | 71 +++++++++++++++++++++++++++++++----------------
1 files changed, 47 insertions(+), 24 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 608e06f..7fb9ee6 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -71,6 +71,12 @@ 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);
@@ -120,34 +126,23 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
g_return_if_fail (n_properties > 0);
values = g_new0 (MetaPropValue, n_properties);
-
- for (i=0; i<n_properties; i++)
+
+ i = 0;
+ while (i < n_properties)
{
- 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];
- }
+ init_prop_value (window->display, properties[i], &values[i]);
+ ++i;
}
meta_prop_get_values (window->display, xwindow,
values, n_properties);
- for (i=0; i<n_properties; i++)
+ i = 0;
+ while (i < n_properties)
{
- MetaWindowPropHooks *hooks = find_hooks (window->display,
- properties[i]);
-
- if (hooks && hooks->reload_func != NULL)
- (* hooks->reload_func) (window, &values[i], initial);
+ reload_prop_value (window, &values[i], initial);
+
+ ++i;
}
meta_prop_free_values (values, n_properties);
@@ -155,6 +150,37 @@ 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,
@@ -1546,9 +1572,6 @@ 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]