mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
redo window sizes/appearance when the theme changes
2002-02-06 Havoc Pennington <hp@pobox.com> * src/main.c (prefs_changed_callback): redo window sizes/appearance when the theme changes * src/display.c (meta_display_retheme_all): new function * src/theme-parser.c (locate_attributes): remove error handling for MAX_ATTRS reached, add an assert instead, the way this code ended up the attrs in the array depend on the code not the theme file.
This commit is contained in:
parent
8ae714eeae
commit
84c3050a7c
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2002-02-06 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
|
* src/main.c (prefs_changed_callback): redo window
|
||||||
|
sizes/appearance when the theme changes
|
||||||
|
|
||||||
|
* src/display.c (meta_display_retheme_all): new function
|
||||||
|
|
||||||
|
* src/theme-parser.c (locate_attributes): remove error handling
|
||||||
|
for MAX_ATTRS reached, add an assert instead, the way this code
|
||||||
|
ended up the attrs in the array depend on the code not the theme
|
||||||
|
file.
|
||||||
|
|
||||||
2002-02-06 Havoc Pennington <hp@pobox.com>
|
2002-02-06 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
* src/main.c (main): disable custom log handler and fatal mask for
|
* src/main.c (main): disable custom log handler and fatal mask for
|
||||||
|
@ -1112,6 +1112,7 @@ event_callback (XEvent *event,
|
|||||||
meta_verbose ("Received reload theme request\n");
|
meta_verbose ("Received reload theme request\n");
|
||||||
meta_ui_set_current_theme (meta_prefs_get_theme (),
|
meta_ui_set_current_theme (meta_prefs_get_theme (),
|
||||||
TRUE);
|
TRUE);
|
||||||
|
meta_display_retheme_all ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2067,6 +2068,42 @@ meta_display_unshow_desktop (MetaDisplay *display)
|
|||||||
queue_windows_showing (display);
|
queue_windows_showing (display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_display_queue_retheme_all_windows (MetaDisplay *display)
|
||||||
|
{
|
||||||
|
GSList* windows;
|
||||||
|
GSList *tmp;
|
||||||
|
|
||||||
|
windows = meta_display_list_windows (display);
|
||||||
|
tmp = windows;
|
||||||
|
while (tmp != NULL)
|
||||||
|
{
|
||||||
|
MetaWindow *window = tmp->data;
|
||||||
|
|
||||||
|
meta_window_queue_move_resize (window);
|
||||||
|
if (window->frame)
|
||||||
|
meta_frame_queue_draw (window->frame);
|
||||||
|
|
||||||
|
tmp = tmp->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slist_free (windows);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_display_retheme_all (void)
|
||||||
|
{
|
||||||
|
GSList *tmp;
|
||||||
|
|
||||||
|
tmp = meta_displays_list ();
|
||||||
|
while (tmp != NULL)
|
||||||
|
{
|
||||||
|
MetaDisplay *display = tmp->data;
|
||||||
|
meta_display_queue_retheme_all_windows (display);
|
||||||
|
tmp = tmp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean is_syncing = FALSE;
|
static gboolean is_syncing = FALSE;
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -228,4 +228,7 @@ guint32 meta_display_get_current_time (MetaDisplay *display);
|
|||||||
const char* meta_focus_mode_to_string (int m);
|
const char* meta_focus_mode_to_string (int m);
|
||||||
const char* meta_focus_detail_to_string (int d);
|
const char* meta_focus_detail_to_string (int d);
|
||||||
|
|
||||||
|
void meta_display_queue_retheme_all_windows (MetaDisplay *display);
|
||||||
|
void meta_display_retheme_all (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -310,6 +310,7 @@ prefs_changed_callback (MetaPreference pref,
|
|||||||
{
|
{
|
||||||
case META_PREF_THEME:
|
case META_PREF_THEME:
|
||||||
meta_ui_set_current_theme (meta_prefs_get_theme (), FALSE);
|
meta_ui_set_current_theme (meta_prefs_get_theme (), FALSE);
|
||||||
|
meta_display_retheme_all ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -356,14 +356,7 @@ locate_attributes (GMarkupParseContext *context,
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (retloc != NULL, FALSE);
|
g_return_val_if_fail (retloc != NULL, FALSE);
|
||||||
|
|
||||||
if (n_attrs == MAX_ATTRS)
|
g_assert (n_attrs < MAX_ATTRS);
|
||||||
{
|
|
||||||
set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
|
|
||||||
_("Element <%s> has more than %d attributes, can't possibly be valid"),
|
|
||||||
element_name, MAX_ATTRS);
|
|
||||||
retval = FALSE;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
attrs[n_attrs].name = name;
|
attrs[n_attrs].name = name;
|
||||||
attrs[n_attrs].retloc = retloc;
|
attrs[n_attrs].retloc = retloc;
|
||||||
@ -374,7 +367,6 @@ locate_attributes (GMarkupParseContext *context,
|
|||||||
retloc = va_arg (args, const char**);
|
retloc = va_arg (args, const char**);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
if (!retval)
|
if (!retval)
|
||||||
@ -402,7 +394,7 @@ locate_attributes (GMarkupParseContext *context,
|
|||||||
_("Attribute \"%s\" repeated twice on the same <%s> element"),
|
_("Attribute \"%s\" repeated twice on the same <%s> element"),
|
||||||
attrs[j].name, element_name);
|
attrs[j].name, element_name);
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
goto out2;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
*retloc = attribute_values[i];
|
*retloc = attribute_values[i];
|
||||||
@ -420,13 +412,13 @@ locate_attributes (GMarkupParseContext *context,
|
|||||||
_("Attribute \"%s\" is invalid on <%s> element in this context"),
|
_("Attribute \"%s\" is invalid on <%s> element in this context"),
|
||||||
attribute_names[i], element_name);
|
attribute_names[i], element_name);
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
goto out2;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
out2:
|
out:
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user