diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/display.c | 37 | ||||
-rw-r--r-- | src/display.h | 3 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/theme-parser.c | 16 |
5 files changed, 57 insertions, 12 deletions
@@ -1,5 +1,17 @@ 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> + * src/main.c (main): disable custom log handler and fatal mask for now diff --git a/src/display.c b/src/display.c index 073232d..354055a 100644 --- a/src/display.c +++ b/src/display.c @@ -1112,6 +1112,7 @@ event_callback (XEvent *event, meta_verbose ("Received reload theme request\n"); meta_ui_set_current_theme (meta_prefs_get_theme (), TRUE); + meta_display_retheme_all (); } } } @@ -2067,6 +2068,42 @@ meta_display_unshow_desktop (MetaDisplay *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; gboolean diff --git a/src/display.h b/src/display.h index f1ef424..e9642bd 100644 --- a/src/display.h +++ b/src/display.h @@ -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_detail_to_string (int d); +void meta_display_queue_retheme_all_windows (MetaDisplay *display); +void meta_display_retheme_all (void); + #endif @@ -310,6 +310,7 @@ prefs_changed_callback (MetaPreference pref, { case META_PREF_THEME: meta_ui_set_current_theme (meta_prefs_get_theme (), FALSE); + meta_display_retheme_all (); break; default: diff --git a/src/theme-parser.c b/src/theme-parser.c index dfeed94..bc7805c 100644 --- a/src/theme-parser.c +++ b/src/theme-parser.c @@ -356,14 +356,7 @@ locate_attributes (GMarkupParseContext *context, { g_return_val_if_fail (retloc != NULL, FALSE); - if (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; - } + g_assert (n_attrs < MAX_ATTRS); attrs[n_attrs].name = name; attrs[n_attrs].retloc = retloc; @@ -374,7 +367,6 @@ locate_attributes (GMarkupParseContext *context, retloc = va_arg (args, const char**); } - out: va_end (args); if (!retval) @@ -402,7 +394,7 @@ locate_attributes (GMarkupParseContext *context, _("Attribute \"%s\" repeated twice on the same <%s> element"), attrs[j].name, element_name); retval = FALSE; - goto out2; + goto out; } *retloc = attribute_values[i]; @@ -420,13 +412,13 @@ locate_attributes (GMarkupParseContext *context, _("Attribute \"%s\" is invalid on <%s> element in this context"), attribute_names[i], element_name); retval = FALSE; - goto out2; + goto out; } ++i; } - out2: + out: return retval; } |