[gtk+] x11: Correctly set icons
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Correctly set icons
- Date: Tue, 7 Nov 2017 11:25:24 +0000 (UTC)
commit 2177b191ba54abb10a13029751f4ae7ed150dfbc
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 7 12:22:48 2017 +0100
x11: Correctly set icons
X11 obviously doesn't use 4 bytes for a 4 bytes pixel. Rather, it uses
unsigned long, which happens to be 8 bytes these days.
gdk/x11/gdkwindow-x11.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index d4be4ef..a9f31fd 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -3241,7 +3241,7 @@ gdk_x11_window_set_icon_list (GdkWindow *window,
gint width, height;
GdkTexture *texture;
GdkDisplay *display;
- gint n;
+ gint i, n;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
@@ -3280,6 +3280,12 @@ gdk_x11_window_set_icon_list (GdkWindow *window,
*p++ = height;
gdk_texture_download (texture, (guchar *) p, width * 4);
+ if (sizeof (gulong) > 4)
+ {
+ i = width * height;
+ while (i-- > 0)
+ p[i] = ((guint32 *) p)[i];
+ }
p += width * height;
n--;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]