summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d6cfa6)
raw | patch | inline | side by side (parent: 0d6cfa6)
author | Eric Wertz <ericdwertz@gmail.com> | |
Sun, 25 Jun 2017 04:14:07 +0000 (00:14 -0400) | ||
committer | Eric Wertz <ericdwertz@gmail.com> | |
Sun, 25 Jun 2017 04:14:07 +0000 (00:14 -0400) |
dock_icon.c | patch | blob | history | |
main.c | patch | blob | history | |
pager_item.c | patch | blob | history |
diff --git a/dock_icon.c b/dock_icon.c
index 84634c666fc92083a12c5543c6732a6d4a59f385..5edc24868edfc54725a8b1d07eb1f75f46721c5a 100644 (file)
--- a/dock_icon.c
+++ b/dock_icon.c
icon->class_group = wnck_window_get_class_group( window );
icon->instance_name = wnck_window_get_class_instance_name( window );
icon->icon_pixbuf = get_icon( window, (int)SCALE_VALUE( 32.0 ) );
- g_object_ref( icon->icon_pixbuf );
icon->pager_items = NULL;
icon->icon_state = ICON_STATE_NORMAL;
g_free(stripped);
- return pixbuf;
+ return gdk_pixbuf_copy( pixbuf );
}
/* From matchbox-desktop */
index 884bef2e8a852bcacaeea5bf4c23ee8e82b6a007..f8b08f824f121c45945d76e477a138a0d6ca2a0c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -165,7 +165,9 @@ static gboolean draw_dock_window( GtkWidget* widget, cairo_t* cr, eric_window* w
cairo_fill( cr );
}
if( !GDK_IS_PIXBUF( icon->icon_pixbuf ) )
- icon->icon_pixbuf = wnck_class_group_get_icon( icon->class_group );
+ {
+ icon->icon_pixbuf = gdk_pixbuf_copy( wnck_class_group_get_icon( icon->class_group ) );
+ }
gdk_cairo_set_source_pixbuf( cr, icon->icon_pixbuf, x+SCALE_VALUE( 4.0 ), y );
cairo_paint( cr );
diff --git a/pager_item.c b/pager_item.c
index bc9dbf122cdcf6f1751770c5efb20244cb4fbe9c..ac30af9b8b904ab861214036c79097bc75875e96 100644 (file)
--- a/pager_item.c
+++ b/pager_item.c
void pager_item_icon_changed( WnckWindow* window, pager_item* item )
{
- if( GDK_IS_PIXBUF( item->icon_pixbuf ) )
+ if( item->icon_pixbuf && GDK_IS_PIXBUF( item->icon_pixbuf ) )
+ {
g_object_unref( item->icon_pixbuf );
+ item->icon_pixbuf = NULL;
+ }
+ printf( "Icon changed %s\n", item->name );
item->icon_pixbuf = get_icon( window, (int)SCALE_VALUE( 16.0 ) );
- g_object_ref( item->icon_pixbuf );
+ gtk_widget_queue_draw( dock_window->window );
}
void pager_item_state_changed( WnckWindow* window, WnckWindowState changed_mask, WnckWindowState new_state, pager_item* item )
pager_item* item = malloc( sizeof( pager_item ) );
item->window = window;
strcpy( item->name, wnck_window_get_name( item->window ) );
+
item->icon_pixbuf = get_icon( window, (int)SCALE_VALUE( 16.0 ) );
- g_object_ref( item->icon_pixbuf );
+
item->icon_state = ICON_STATE_NORMAL;
g_signal_connect( G_OBJECT( window ), "name-changed", G_CALLBACK( pager_item_name_changed ), (gpointer)item );
void pager_item_draw( pager_item* item, cairo_t* cr, eric_window* w, cairo_pattern_t* pattern )
{
- if( !GDK_IS_PIXBUF( item->icon_pixbuf ) )
+ if( item->icon_pixbuf && !GDK_IS_PIXBUF( item->icon_pixbuf ) )
{
item->icon_pixbuf = get_icon( item->window, (int)SCALE_VALUE( 16.0 ) );
if( !GDK_IS_PIXBUF( item->icon_pixbuf ) )