summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2021-05-07 22:56:08 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2021-05-07 22:56:08 +0300
commitdaad23cb82efdd3c5c769e7fd2847bb1b0a8ea9a (patch)
tree2be38d249b0de05d32bc69e26bb8a9f52a78f654
parentc1460f7920ff0a41b31e2adfc843df4f3c245141 (diff)
downloadlibwnck-daad23cb82efdd3c5c769e7fd2847bb1b0a8ea9a.tar.gz
xutils: replace width and height with size in get_fallback_icons
Function is always used with same value for width and height. Replace with single parameter.
-rw-r--r--libwnck/class-group.c2
-rw-r--r--libwnck/tasklist.c4
-rw-r--r--libwnck/xutils.c30
-rw-r--r--libwnck/xutils.h12
4 files changed, 16 insertions, 32 deletions
diff --git a/libwnck/class-group.c b/libwnck/class-group.c
index 72513b8..f4afc31 100644
--- a/libwnck/class-group.c
+++ b/libwnck/class-group.c
@@ -457,9 +457,7 @@ set_icon (WnckClassGroup *class_group)
{
_wnck_get_fallback_icons (&icon,
_wnck_get_default_icon_size (),
- _wnck_get_default_icon_size (),
&mini_icon,
- _wnck_get_default_mini_icon_size (),
_wnck_get_default_mini_icon_size ());
icons_reffed = TRUE;
}
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index f14ca62..95f062a 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -3498,8 +3498,8 @@ wnck_task_get_icon (WnckTask *task)
if (pixbuf == NULL)
{
- _wnck_get_fallback_icons (NULL, 0, 0,
- &pixbuf, MINI_ICON_SIZE, MINI_ICON_SIZE);
+ _wnck_get_fallback_icons (NULL, 0,
+ &pixbuf, MINI_ICON_SIZE);
}
#endif
break;
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index d53f190..4617589 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -2305,9 +2305,7 @@ _wnck_read_icons (WnckScreen *screen,
{
_wnck_get_fallback_icons (iconp,
ideal_size,
- ideal_size,
mini_iconp,
- ideal_mini_size,
ideal_mini_size);
replace_cache (icon_cache, USING_FALLBACK_ICON,
@@ -2330,8 +2328,7 @@ _wnck_read_icons (WnckScreen *screen,
}
static GdkPixbuf*
-default_icon_at_size (int width,
- int height)
+default_icon_at_size (int size)
{
GdkPixbuf *base;
@@ -2339,9 +2336,9 @@ default_icon_at_size (int width,
g_assert (base);
- if ((width < 0 && height < 0) ||
- (gdk_pixbuf_get_width (base) == width &&
- gdk_pixbuf_get_height (base) == height))
+ if ((size < 0) ||
+ (gdk_pixbuf_get_width (base) == size &&
+ gdk_pixbuf_get_height (base) == size))
{
return base;
}
@@ -2350,9 +2347,9 @@ default_icon_at_size (int width,
GdkPixbuf *scaled;
scaled = gdk_pixbuf_scale_simple (base,
- width > 0 ? width :
+ size > 0 ? size :
gdk_pixbuf_get_width (base),
- height > 0 ? height :
+ size > 0 ? size :
gdk_pixbuf_get_height (base),
GDK_INTERP_BILINEAR);
@@ -2364,26 +2361,19 @@ default_icon_at_size (int width,
void
_wnck_get_fallback_icons (GdkPixbuf **iconp,
- int ideal_width,
- int ideal_height,
+ int ideal_size,
GdkPixbuf **mini_iconp,
- int ideal_mini_width,
- int ideal_mini_height)
+ int ideal_mini_size)
{
if (iconp)
- *iconp = default_icon_at_size (ideal_width > 0 ? ideal_width :
- (int) _wnck_get_default_icon_size (),
- ideal_height > 0 ? ideal_height :
+ *iconp = default_icon_at_size (ideal_size > 0 ? ideal_size :
(int) _wnck_get_default_icon_size ());
if (mini_iconp)
- *mini_iconp = default_icon_at_size (ideal_mini_width > 0 ? ideal_mini_width :
- (int) _wnck_get_default_mini_icon_size (),
- ideal_mini_height > 0 ? ideal_mini_height :
+ *mini_iconp = default_icon_at_size (ideal_mini_size > 0 ? ideal_mini_size :
(int) _wnck_get_default_mini_icon_size ());
}
-
void
_wnck_get_window_geometry (Screen *screen,
Window xwindow,
diff --git a/libwnck/xutils.h b/libwnck/xutils.h
index b460bcf..e5ef85d 100644
--- a/libwnck/xutils.h
+++ b/libwnck/xutils.h
@@ -178,14 +178,10 @@ gboolean _wnck_read_icons (WnckScreen *screen,
GdkPixbuf **mini_iconp,
int ideal_mini_size);
-void _wnck_get_fallback_icons (GdkPixbuf **iconp,
- int ideal_width,
- int ideal_height,
- GdkPixbuf **mini_iconp,
- int ideal_mini_width,
- int ideal_mini_height);
-
-
+void _wnck_get_fallback_icons (GdkPixbuf **iconp,
+ int ideal_size,
+ GdkPixbuf **mini_iconp,
+ int ideal_mini_size);
void _wnck_get_window_geometry (Screen *screen,
Window xwindow,