Merge lp:~jassmith/window-picker-applet/pixbuf-fix into lp:window-picker-applet

Proposed by Jason Smith
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jassmith/window-picker-applet/pixbuf-fix
Merge into: lp:window-picker-applet
Diff against target: None lines
To merge this branch: bzr merge lp:~jassmith/window-picker-applet/pixbuf-fix
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+10806@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

Fixes minor issues and bugs related to icons

93. By Jason Smith <jason@t500>

src/task-item.c : fix memory leak

Revision history for this message
Neil J. Patel (njpatel) wrote :

Looks good. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/task-item.c'
2--- src/task-item.c 2009-08-27 06:01:52 +0000
3+++ src/task-item.c 2009-08-27 17:52:25 +0000
4@@ -261,8 +261,8 @@
5 gdk_pixbuf_get_width (pbuf) != size &&
6 gdk_pixbuf_get_height (pbuf) != size)
7 {
8- g_object_unref (pbuf);
9- pbuf = NULL;
10+ g_object_unref (pbuf);
11+ pbuf = NULL;
12 }
13
14 if (active)
15@@ -286,8 +286,6 @@
16 (area.x + (area.width - gdk_pixbuf_get_width (pbuf)) / 2),
17 (area.y + (area.height - gdk_pixbuf_get_height (pbuf)) / 2));
18
19- g_object_unref (pbuf);
20-
21 if (!priv->mouse_over && wnck_window_or_transient_needs_attention (priv->window)) /* urgent */
22 {
23 GTimeVal current_time;
24@@ -443,6 +441,23 @@
25 task_item_set_visibility (item);
26 }
27
28+static void on_window_icon_changed (WnckWindow *window, TaskItem *item)
29+{
30+ TaskItemPrivate *priv;
31+
32+ g_return_if_fail (TASK_IS_ITEM (item));
33+
34+ priv = item->priv;
35+
36+ if (GDK_IS_PIXBUF (priv->pixbuf))
37+ {
38+ g_object_unref (priv->pixbuf);
39+ priv->pixbuf = NULL;
40+ }
41+
42+ gtk_widget_queue_draw (GTK_WIDGET (item));
43+}
44+
45 static void
46 on_screen_active_window_changed (WnckScreen *screen,
47 WnckWindow *old_window,
48@@ -653,6 +668,8 @@
49 G_CALLBACK (on_window_workspace_changed), item);
50 g_signal_connect (window, "state-changed",
51 G_CALLBACK (on_window_state_changed), item);
52+ g_signal_connect (window, "icon-changed",
53+ G_CALLBACK (on_window_icon_changed), item);
54
55 g_signal_connect (item, "button-release-event",
56 G_CALLBACK (on_task_item_button_released), item);

Subscribers

People subscribed via source and target branches

to all changes: