flicker (&performance) fix ...
- From: Michael Meeks <michael ximian com>
- To: Federico Mena Quintero <federico ximian com>, Jody Goldberg <jgoldberg home com>, Ettore Perazzoli <ettore ximian com>
- Cc: <gnome-components-list gnome org>, Evolution Hackers Mailing List <evolution-hackers ximian com>
- Subject: flicker (&performance) fix ...
- Date: Fri, 14 Dec 2001 19:57:41 -0500 (EST)
Ok, so - I havn't finished this yet - currently it introduces a
slight change of behavior [ cf. comment, with a known fix ], etc. etc.
yada yada.
Anyway - with these patches switching evolution mail folders
doesn't flicker noticably, and response to UI updating etc. is noticably
quicker. It's possible that this will accelerate nautilus & gnumeric
too[1]
I'll fix it up tommorow as advertised in the comment, give it some
more testing with various apps, and commit - unless people find something
really stupid in there.
Halleluja,
Michael.
[1] - in Nautilus you can see the behavioral regression with a dock item
on the root desktop background :-)
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
? bonobo-1.0.10.tar.gz
? bonobo-1.0.11.tar.gz
? bonobo-1.0.13.tar.gz
? bonobo-1.0.15.tar.gz
? total-diff.diff
? nat
? bonobo-1.0.9.tar.gz
? bonobo-1.0.14.tar.gz
? bonobo-1.0.12.tar.gz
? bonobo-1.0.17.tar.gz
? bonobo/scale-cache
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.1150
diff -u -p -u -r1.1150 ChangeLog
--- ChangeLog 2001/11/16 15:56:50 1.1150
+++ ChangeLog 2001/12/15 00:50:51
@@ -1,3 +1,22 @@
+2001-12-15 Michael Meeks <michael ximian com>
+
+ * bonobo/bonobo-ui-xml.c (override_node_with):
+ if we have the same name,
+
+ * bonobo/bonobo-ui-node.c (bonobo_ui_node_transparent):
+ special case the placeholder - separators should not be
+ 'transparent', their ownership matters lots.
+
+2001-12-14 Michael Meeks <michael ximian com>
+
+ * bonobo/bonobo-ui-toolbar-button-item.c
+ (set_icon): don't be constantly destroying and
+ re-creating that icon - just set the new pixbuf.
+
+ * bonobo/bonobo-ui-util.c
+ (bonobo_ui_util_xml_get_icon_pixbuf): impl.
+ a pixbuf cache.
+
2001-11-16 Frederic Crozat <fcrozat mandrakesoft com>
* bonobo/bonobo-arg.c: (bonobo_arg_copy):
Index: bonobo/bonobo-ui-node.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-node.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 bonobo-ui-node.c
--- bonobo/bonobo-ui-node.c 2001/08/20 18:11:59 1.17
+++ bonobo/bonobo-ui-node.c 2001/12/15 00:50:52
@@ -512,7 +512,8 @@ bonobo_ui_node_transparent (BonoboUINode
ret = FALSE;
} else if (!n->properties) {
- ret = TRUE;
+ if (!strcmp (XML_NODE (node)->name, "placeholder"))
+ ret = TRUE;
} else if (!n->properties->next) {
if (!strcmp (n->properties->name, "name"))
Index: bonobo/bonobo-ui-sync-toolbar.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-sync-toolbar.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 bonobo-ui-sync-toolbar.c
--- bonobo/bonobo-ui-sync-toolbar.c 2001/04/03 17:01:32 1.13
+++ bonobo/bonobo-ui-sync-toolbar.c 2001/12/15 00:50:55
@@ -129,13 +129,14 @@ impl_bonobo_ui_sync_toolbar_state (Bonob
bonobo_ui_toolbar_item_set_want_label (
BONOBO_UI_TOOLBAR_ITEM (widget), priority);
+#if 1
icon_pixbuf = cmd_get_toolbar_pixbuf (node, cmd_node);
+#endif
type = bonobo_ui_engine_get_attr (node, cmd_node, "type");
label = bonobo_ui_engine_get_attr (node, cmd_node, "label");
if (!type || !strcmp (type, "toggle")) {
-
if (icon_pixbuf) {
bonobo_ui_toolbar_button_item_set_icon (
BONOBO_UI_TOOLBAR_BUTTON_ITEM (widget), icon_pixbuf);
Index: bonobo/bonobo-ui-toolbar-button-item.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-toolbar-button-item.c,v
retrieving revision 1.9
diff -u -p -u -r1.9 bonobo-ui-toolbar-button-item.c
--- bonobo/bonobo-ui-toolbar-button-item.c 2001/01/04 14:34:49 1.9
+++ bonobo/bonobo-ui-toolbar-button-item.c 2001/12/15 00:50:55
@@ -70,15 +70,20 @@ set_icon (BonoboUIToolbarButtonItem *but
priv = button_item->priv;
- if (priv->icon != NULL)
- gtk_widget_destroy (priv->icon);
-
gtk_widget_push_style (gtk_widget_get_style (GTK_WIDGET (priv->button_widget)));
- if (pixbuf != NULL)
- priv->icon = create_pixmap_widget_from_pixbuf (pixbuf);
- else
- priv->icon = NULL;
+ if (priv->icon != NULL) {
+ if (pixbuf != NULL)
+ bonobo_ui_toolbar_icon_set_pixbuf (
+ BONOBO_UI_TOOLBAR_ICON (priv->icon), pixbuf);
+ else {
+ gtk_widget_destroy (priv->icon);
+ priv->icon = NULL;
+ }
+ } else {
+ if (pixbuf != NULL)
+ priv->icon = create_pixmap_widget_from_pixbuf (pixbuf);
+ }
gtk_widget_pop_style ();
}
Index: bonobo/bonobo-ui-toolbar-icon.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-toolbar-icon.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 bonobo-ui-toolbar-icon.c
--- bonobo/bonobo-ui-toolbar-icon.c 2001/03/14 15:51:19 1.6
+++ bonobo/bonobo-ui-toolbar-icon.c 2001/12/15 00:50:56
@@ -302,8 +302,8 @@ bonobo_ui_toolbar_icon_destroy (GtkObjec
}
static void
-bonobo_ui_toolbar_icon_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+bonobo_ui_toolbar_icon_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
{
/* We base size on the max of all provided images if w,h are -1
else the scaled "main" image size (gpixmap->width, gpixmap->height) */
@@ -541,7 +541,7 @@ set_state_pixbufs(BonoboUIToolbarIcon* g
}
static void
-set_pixbuf(BonoboUIToolbarIcon* gpixmap, GdkPixbuf* pixbuf)
+set_pixbuf (BonoboUIToolbarIcon* gpixmap, GdkPixbuf *pixbuf)
{
if (pixbuf == gpixmap->provided_image)
return;
Index: bonobo/bonobo-ui-util.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-util.c,v
retrieving revision 1.50
diff -u -p -u -r1.50 bonobo-ui-util.c
--- bonobo/bonobo-ui-util.c 2001/11/14 21:39:26 1.50
+++ bonobo/bonobo-ui-util.c 2001/12/15 00:50:56
@@ -432,8 +432,10 @@ find_pixmap_in_path (const gchar *filena
GdkPixbuf *
bonobo_ui_util_xml_get_icon_pixbuf (BonoboUINode *node, gboolean prepend_menu)
{
- GdkPixbuf *icon_pixbuf = NULL;
+ char *key;
char *type, *text;
+ GdkPixbuf *icon_pixbuf = NULL;
+ static GHashTable *pixbuf_cache = NULL;
g_return_val_if_fail (node != NULL, NULL);
@@ -448,6 +450,16 @@ bonobo_ui_util_xml_get_icon_pixbuf (Bono
if (!text)
return NULL;
+ key = g_strdup_printf ("%s!%s!%d", type, text, prepend_menu?1:0);
+
+ if (!pixbuf_cache)
+ pixbuf_cache = g_hash_table_new (g_str_hash, g_str_equal);
+
+ if ((icon_pixbuf = g_hash_table_lookup (pixbuf_cache, key))) {
+ gdk_pixbuf_ref (icon_pixbuf);
+ return icon_pixbuf;
+ }
+
if (!strcmp (type, "stock")) {
if (prepend_menu) {
@@ -477,6 +489,9 @@ bonobo_ui_util_xml_get_icon_pixbuf (Bono
bonobo_ui_node_free_string (text);
bonobo_ui_node_free_string (type);
+
+ gdk_pixbuf_ref (icon_pixbuf);
+ g_hash_table_insert (pixbuf_cache, key, icon_pixbuf);
return icon_pixbuf;
}
Index: bonobo/bonobo-ui-xml.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-xml.c,v
retrieving revision 1.55
diff -u -p -u -r1.55 bonobo-ui-xml.c
--- bonobo/bonobo-ui-xml.c 2001/09/21 03:28:48 1.55
+++ bonobo/bonobo-ui-xml.c 2001/12/15 00:50:56
@@ -437,6 +437,19 @@ override_node_with (BonoboUIXml *tree, B
override = !same && !transparent;
+#if 1
+/* New */
+ /* FIXME: for a better match to old behavior we need
+ * to handle this case differently - by doing an official
+ * override - but moving the widget data across.
+ * this code should move into override_fn */
+ if (override &&
+ !strcmp (bonobo_ui_node_get_name (new),
+ bonobo_ui_node_get_name (old)))
+ override = FALSE;
+/* End of Newness */
+#endif
+
if (override) {
gtk_signal_emit (GTK_OBJECT (tree),
? ettore1.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.832.2.7
diff -u -p -u -r1.832.2.7 ChangeLog
--- ChangeLog 2001/12/14 18:50:04 1.832.2.7
+++ ChangeLog 2001/12/15 00:55:32
@@ -1,3 +1,9 @@
+2001-12-14 Michael Meeks <michael ximian com>
+
+ * e-shell-view.c (set_current_notebook_page): re-order
+ activate / de-activate to minimise flicker switching between
+ identical components.
+
2001-12-12 Ettore Perazzoli <ettore ximian com>
[Fix #17258, shell displays splash even if Evolution is already
Index: e-shell-view.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-view.c,v
retrieving revision 1.217.4.1
diff -u -p -u -r1.217.4.1 e-shell-view.c
--- e-shell-view.c 2001/12/05 22:53:50 1.217.4.1
+++ e-shell-view.c 2001/12/15 00:55:33
@@ -1666,7 +1666,8 @@ set_current_notebook_page (EShellView *s
EShellViewPrivate *priv;
GtkNotebook *notebook;
GtkWidget *current;
- BonoboControlFrame *control_frame;
+ BonoboControlFrame *old_control_frame = NULL;
+ BonoboControlFrame *new_control_frame;
int current_page;
priv = shell_view->priv;
@@ -1678,10 +1679,8 @@ set_current_notebook_page (EShellView *s
if (current_page != -1 && current_page != 0) {
current = gtk_notebook_get_nth_page (notebook, current_page);
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (current));
-
- bonobo_control_frame_set_autoactivate (control_frame, FALSE);
- bonobo_control_frame_control_deactivate (control_frame);
+ old_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (current));
+ bonobo_control_frame_set_autoactivate (old_control_frame, FALSE);
}
e_shell_folder_title_bar_set_folder_bar_label (E_SHELL_FOLDER_TITLE_BAR (priv->folder_title_bar), "");
@@ -1691,10 +1690,12 @@ set_current_notebook_page (EShellView *s
return;
current = gtk_notebook_get_nth_page (notebook, page_num);
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (current));
+ new_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (current));
+ bonobo_control_frame_set_autoactivate (new_control_frame, FALSE);
- bonobo_control_frame_set_autoactivate (control_frame, FALSE);
- bonobo_control_frame_control_activate (control_frame);
+ bonobo_control_frame_control_activate (new_control_frame);
+ if (old_control_frame)
+ bonobo_control_frame_control_deactivate (old_control_frame);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]