From 1fbed28fa0f30f7257a64f8ae5cfca5856aa00f0 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sat, 8 Aug 2020 11:09:24 +0200 Subject: wncklet: Check the length of the pixel data for empty thumbnails --- applets/wncklet/window-list.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index a20f6559..04be002d 100644 --- a/applets/wncklet/window-list.c +++ b/applets/wncklet/window-list.c @@ -164,7 +164,6 @@ static GdkPixbuf *preview_window_thumbnail (WnckWindow *wnck_window, TasklistDat GdkWindow *window; GdkPixbuf *screenshot; GdkPixbuf *thumbnail; - guchar *pixels; double ratio; int width, height; int scale; @@ -186,8 +185,7 @@ static GdkPixbuf *preview_window_thumbnail (WnckWindow *wnck_window, TasklistDat return NULL; /* Determine whether the contents of the screenshot are empty */ - pixels = gdk_pixbuf_get_pixels (screenshot); - if (!g_strcmp0 ((const char *)pixels, "")) + if (gdk_pixbuf_get_byte_length (screenshot) == 0) { g_object_unref (screenshot); return NULL; -- cgit v1.2.1