[gnome-applets/wip/segeiger/windowpicker: 5/17] windowpicker: rename pbuf to pixbuf
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/segeiger/windowpicker: 5/17] windowpicker: rename pbuf to pixbuf
- Date: Sun, 13 Oct 2019 12:55:00 +0000 (UTC)
commit 40e5286c95873af0144ccc196c7dbad7d17099e0
Author: Sebastian Geiger <sbastig gmx net>
Date: Sat Oct 12 15:11:03 2019 +0200
windowpicker: rename pbuf to pixbuf
windowpicker/src/task-item.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/windowpicker/src/task-item.c b/windowpicker/src/task-item.c
index a16987002..29539ca5e 100644
--- a/windowpicker/src/task-item.c
+++ b/windowpicker/src/task-item.c
@@ -207,7 +207,10 @@ task_item_sized_pixbuf_for_window (TaskItem *item,
WnckWindow *window,
gint size)
{
- GdkPixbuf *pbuf = NULL;
+ GdkPixbuf *pixbuf;
+ gint width, height;
+
+ pixbuf = NULL;
g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
if (wnck_window_has_icon_name (window)) {
const gchar *icon_name = wnck_window_get_icon_name (window);
@@ -219,22 +222,26 @@ task_item_sized_pixbuf_for_window (TaskItem *item,
GTK_ICON_LOOKUP_FORCE_SIZE,
NULL
);
- pbuf = gdk_pixbuf_copy (internal);
+ pixbuf = gdk_pixbuf_copy (internal);
g_object_unref (internal);
}
}
- if (!pbuf) {
- pbuf = gdk_pixbuf_copy (wnck_window_get_icon (item->window));
- }
- gint width = gdk_pixbuf_get_width (pbuf);
- gint height = gdk_pixbuf_get_height (pbuf);
+ if (!pixbuf)
+ {
+ pixbuf = gdk_pixbuf_copy (wnck_window_get_icon (item->window));
+ }
+
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+
if (MAX (width, height) != size) {
gdouble scale = (gdouble) size / (gdouble) MAX (width, height);
- GdkPixbuf *tmp = pbuf;
- pbuf = gdk_pixbuf_scale_simple (tmp, (gint) (width * scale), (gint) (height * scale),
GDK_INTERP_HYPER);
+ GdkPixbuf *tmp = pixbuf;
+ pixbuf = gdk_pixbuf_scale_simple (tmp, (gint) (width * scale), (gint) (height * scale),
GDK_INTERP_HYPER);
g_object_unref (tmp);
}
- return pbuf;
+
+ return pixbuf;
}
/* Callback to draw the icon, this function is responsible to draw the different states of the icon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]