No, you can't add a GtkStyle * to a list of GtkRcNode *. (Fixes huge
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtkrc.c: No, you can't add a GtkStyle * to a list of GtkRcNode *. (Fixes huge performance problem) Plus, don't bother creating a new style unless style actually has bg pixmaps.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
|
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a
|
||||||
|
list of GtkRcNode *. (Fixes huge performance problem)
|
||||||
|
Plus, don't bother creating a new style unless style
|
||||||
|
actually has bg pixmaps.
|
||||||
|
|
||||||
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
|
||||||
|
|
||||||
* gtk/gtktext.c:
|
* gtk/gtktext.c:
|
||||||
|
29
gtk/gtkrc.c
29
gtk/gtkrc.c
@ -483,27 +483,45 @@ static GtkStyle *
|
|||||||
gtk_rc_style_init (GtkRcStyle *rc_style, GdkColormap *cmap)
|
gtk_rc_style_init (GtkRcStyle *rc_style, GdkColormap *cmap)
|
||||||
{
|
{
|
||||||
GdkFont *old_font;
|
GdkFont *old_font;
|
||||||
|
gboolean match_cmap = FALSE;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
GtkStyle *style = NULL;
|
GtkStyle *style = NULL;
|
||||||
|
GtkRcNode *node;
|
||||||
|
|
||||||
tmp_list = rc_style->styles;
|
tmp_list = rc_style->styles;
|
||||||
|
|
||||||
|
for (i=0; i<5; i++)
|
||||||
|
if (rc_style->bg_pixmap_name[i])
|
||||||
|
match_cmap = TRUE;
|
||||||
|
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
GtkRcNode *node = (GtkRcNode *)tmp_list->data;
|
node = (GtkRcNode *)tmp_list->data;
|
||||||
|
|
||||||
if (node->cmap == cmap)
|
if (!match_cmap || (node->cmap == cmap))
|
||||||
|
{
|
||||||
style = node->style;
|
style = node->style;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!style)
|
if (!style)
|
||||||
{
|
{
|
||||||
|
node = g_new (GtkRcNode, 1);
|
||||||
style = gtk_style_copy (rc_style->proto_style);
|
style = gtk_style_copy (rc_style->proto_style);
|
||||||
|
|
||||||
|
/* FIXME, this leaks colormaps, but if we don't do this, then we'll
|
||||||
|
* be screwed, because we identify colormaps by address equality
|
||||||
|
*/
|
||||||
|
gdk_colormap_ref (cmap);
|
||||||
|
|
||||||
|
node->style = style;
|
||||||
|
node->cmap = cmap;
|
||||||
|
|
||||||
if (rc_style->fontset_name)
|
if (rc_style->fontset_name)
|
||||||
{
|
{
|
||||||
old_font = style->font;
|
old_font = style->font;
|
||||||
@ -536,12 +554,7 @@ gtk_rc_style_init (GtkRcStyle *rc_style, GdkColormap *cmap)
|
|||||||
rc_style->bg_pixmap_name[i]);
|
rc_style->bg_pixmap_name[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc_style->styles = g_list_append (rc_style->styles, style);
|
rc_style->styles = g_list_append (rc_style->styles, node);
|
||||||
|
|
||||||
/* FIXME, this leaks colormaps, but if we don't do this, then we'll
|
|
||||||
* be screwed, because we identify colormaps by address equality
|
|
||||||
*/
|
|
||||||
gdk_colormap_ref (cmap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return style;
|
return style;
|
||||||
|
Reference in New Issue
Block a user