File surf-icon-smb.diff of Package surf

--- surf.c.smb	2024-02-08 23:03:52.578768784 -0500
+++ surf.c	2024-02-08 23:12:59.807170587 -0500
@@ -40,6 +40,8 @@
 
 enum { AtomFind, AtomGo, AtomUri, AtomUTF8, AtomLast };
 
+enum { Icon16x16, Icon32x32, Icon48x48, IconLast };
+
 enum {
 	OnDoc   = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
 	OnLink  = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK,
@@ -307,6 +309,7 @@
 
 /* configuration, allows nested code to access above variables */
 #include "config.h"
+#include "surf.xpm"
 
 void
 die(const char *errstr, ...)
@@ -332,6 +335,8 @@
 {
 	GIOChannel *gchanin;
 	GdkDisplay *gdpy;
+  GdkPixbuf *gpix;
+  GList *icons = NULL;
 	int i, j;
 
 	/* clean up any zombies immediately */
@@ -421,6 +426,16 @@
 			if (defconfig[j].prio >= uriparams[i].config[j].prio)
 				uriparams[i].config[j] = defconfig[j];
 		}
+    /* set icons */
+    for (i = 0; i < IconLast; i++) {
+      gpix = gdk_pixbuf_new_from_xpm_data(surf_xpm[i]);
+      icons = g_list_prepend(icons, gpix);
+    }
+    gtk_window_set_default_icon_list(icons);
+    for (i = 0; icons != NULL && i < IconLast; i++) {
+      g_object_unref(icons->data);
+      icons = g_list_remove_link(icons, icons);
+    }
 	}
 }
 
openSUSE Build Service is sponsored by