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
This commit is contained in:
parent
c47f7c2806
commit
178b5ff626
@ -1,3 +1,9 @@
|
|||||||
|
2009-03-11 Ori Avtalion <ori@avtalion.name>
|
||||||
|
|
||||||
|
* 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-06 Thomas Thurman <tthurman@gnome.org>
|
2009-03-06 Thomas Thurman <tthurman@gnome.org>
|
||||||
|
|
||||||
* configure.in: add optional dependency on gtop.
|
* configure.in: add optional dependency on gtop.
|
||||||
|
@ -73,12 +73,6 @@ typedef struct MetaWindowPropHooks
|
|||||||
ReloadValueFunc reload_func;
|
ReloadValueFunc reload_func;
|
||||||
} MetaWindowPropHooks;
|
} 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,
|
static MetaWindowPropHooks* find_hooks (MetaDisplay *display,
|
||||||
Atom property);
|
Atom property);
|
||||||
|
|
||||||
@ -128,23 +122,34 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
|
|||||||
g_return_if_fail (n_properties > 0);
|
g_return_if_fail (n_properties > 0);
|
||||||
|
|
||||||
values = g_new0 (MetaPropValue, n_properties);
|
values = g_new0 (MetaPropValue, n_properties);
|
||||||
|
|
||||||
i = 0;
|
for (i=0; i<n_properties; i++)
|
||||||
while (i < n_properties)
|
|
||||||
{
|
{
|
||||||
init_prop_value (window->display, properties[i], &values[i]);
|
MetaWindowPropHooks *hooks = find_hooks (window->display,
|
||||||
++i;
|
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,
|
meta_prop_get_values (window->display, xwindow,
|
||||||
values, n_properties);
|
values, n_properties);
|
||||||
|
|
||||||
i = 0;
|
for (i=0; i<n_properties; i++)
|
||||||
while (i < n_properties)
|
|
||||||
{
|
{
|
||||||
reload_prop_value (window, &values[i], initial);
|
MetaWindowPropHooks *hooks = find_hooks (window->display,
|
||||||
|
properties[i]);
|
||||||
++i;
|
|
||||||
|
if (hooks && hooks->reload_func != NULL)
|
||||||
|
(* hooks->reload_func) (window, &values[i], initial);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_prop_free_values (values, n_properties);
|
meta_prop_free_values (values, n_properties);
|
||||||
@ -152,37 +157,6 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
|
|||||||
g_free (values);
|
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
|
static void
|
||||||
reload_wm_client_machine (MetaWindow *window,
|
reload_wm_client_machine (MetaWindow *window,
|
||||||
MetaPropValue *value,
|
MetaPropValue *value,
|
||||||
@ -1566,6 +1540,9 @@ meta_display_free_window_prop_hooks (MetaDisplay *display)
|
|||||||
display->prop_hooks_table = NULL;
|
display->prop_hooks_table = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the hooks for a particular property.
|
||||||
|
*/
|
||||||
static MetaWindowPropHooks*
|
static MetaWindowPropHooks*
|
||||||
find_hooks (MetaDisplay *display,
|
find_hooks (MetaDisplay *display,
|
||||||
Atom property)
|
Atom property)
|
||||||
|
Loading…
Reference in New Issue
Block a user