"Mikael Magnusson" <[EMAIL PROTECTED]> writes:

> +Compile I<afterimage>: Specify image file for the applications
> +icon. Many window managers will show the icon in some sort of taskbar
>
> should be application
>
> +      ASImage *im = file2ASImage(rs [Rs_iconfile], 0xFFFFFFFF,
> SCREEN_GAMMA, 0, NULL);
> +              ARGB32* asbuf=result->alt.argb32;
>
> probably want to be more consistent with spaces around = and (
> urxvt uses a space before ( in function calls, and spaces around =
>
> +              Atom net_wm_icon = XInternAtom(dpy, "_NET_WM_ICON", False);
> +              Atom cardinal = XInternAtom(dpy, "CARDINAL", False);
>
> _NET_WM_ICON should be added as XA_NET_WM_ICON in rxvttoolkit.C and .h
> (in ENABLE_EWMH, which i guess means this code should be under that
> ifdef as well).
> XA_CARDINAL is already defined and used in other places.

Thanks for your input, see attached patch where I included your
suggestions.

Yours,
Frank

-- 
Have you ever considered how much text can fit in eighty columns?  Given that a
signature typically contains up to four lines of text, this space allows you to
attach a tremendous amount of valuable information to your messages.  Seize the
opportunity and don't waste your signature on bullshit that nobody cares about.
Index: doc/rxvt.1.pod
===================================================================
RCS file: /schmorpforge/rxvt-unicode/doc/rxvt.1.pod,v
retrieving revision 1.167
diff -u -r1.167 rxvt.1.pod
--- doc/rxvt.1.pod	15 Oct 2008 14:48:22 -0000	1.167
+++ doc/rxvt.1.pod	1 Nov 2008 21:48:52 -0000
@@ -184,6 +184,12 @@
 on some backgrounds. Maximum radius value is 128. Compile I<afterimage>;
 resource I<blurRadius>.
 
+=item B<-icon> I<file>
+
+Compile I<afterimage>: Specify image file for the application
+icon. Many window managers will show the icon in some sort of taskbar
+or in the window title bar; resource I<iconFile>.
+
 =item B<-bg> I<colour>
 
 Window background colour; resource B<background>.
@@ -718,6 +724,10 @@
 Apply Gaussian Blurr with the specified radius to the transparent
 background image; option B<-blr>.
 
+=item B<iconFile:> I<file>
+
+Set the application icon pixmap; option B<-icon>.
+
 =item B<scrollColor:> I<colour>
 
 Use the specified colour for the scrollbar [default #B2B2B2].
Index: src/init.C
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/init.C,v
retrieving revision 1.253
diff -u -r1.253 init.C
--- src/init.C	15 Jul 2008 16:41:22 -0000	1.253
+++ src/init.C	1 Nov 2008 21:49:02 -0000
@@ -1137,6 +1137,52 @@
 
   XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc,
                       &szHint, &wmHint, &classHint);
+#if ENABLE_FRILLS
+#if ENABLE_EWMH 
+#ifdef HAVE_AFTERIMAGE
+  /*
+   * set up icon hint
+   * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
+   */
+  if (rs [Rs_iconfile] && asv)
+    {
+      ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
+      if (im!=NULL)
+        {
+          int w = im->width;
+          int h = im->height;
+          size_t length = (w*h+2)*sizeof(long);
+          long* buffer = (long*)malloc (length);
+          ASImage *result = scale_asimage (asv, im,
+                                           w,h,ASA_ARGB32,
+                                           100, ASIMAGE_QUALITY_DEFAULT);
+          destroy_asimage (&im);
+          if (buffer && result)
+            {
+              ARGB32 *asbuf = result->alt.argb32;
+              buffer[0] = w;
+              buffer[1] = h;
+              for (unsigned int i = 0; i<w*h; ++i)
+                buffer[i+2] = asbuf[i];
+              destroy_asimage (&result);
+              XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
+                              PropModeReplace, (const unsigned char*) buffer, 2+w*h);
+              free (buffer);
+            }
+          else
+            {
+              if (!buffer)
+                rxvt_warn ("Memory allocation for icon hint failed!\n");
+              if (!result)
+                rxvt_warn ("Image transformation to ARGB of image for icon hint failed!\n");
+            }
+        }
+      else
+        rxvt_warn ("Loading of image for icon hint failed!\n");
+    }
+#endif
+#endif
+#endif
 
 #if ENABLE_FRILLS
   if (mwmhints.flags)
Index: src/rsinc.h
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/rsinc.h,v
retrieving revision 1.26
diff -u -r1.26 rsinc.h
--- src/rsinc.h	15 Jun 2008 13:54:15 -0000	1.26
+++ src/rsinc.h	1 Nov 2008 21:49:02 -0000
@@ -116,4 +116,5 @@
 #ifdef HAVE_AFTERIMAGE
   def (blendtype)
   def (blurradius)
+  def (iconfile)
 #endif
Index: src/rxvttoolkit.C
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/rxvttoolkit.C,v
retrieving revision 1.101
diff -u -r1.101 rxvttoolkit.C
--- src/rxvttoolkit.C	26 Jan 2008 14:35:28 -0000	1.101
+++ src/rxvttoolkit.C	1 Nov 2008 21:49:03 -0000
@@ -61,6 +61,7 @@
   "_NET_WM_NAME",
   "_NET_WM_ICON_NAME",
   "_NET_WM_PING",
+  "_NET_WM_ICON",
 #endif
 #if USE_XIM
   "WM_LOCALE_NAME",
Index: src/rxvttoolkit.h
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/rxvttoolkit.h,v
retrieving revision 1.45
diff -u -r1.45 rxvttoolkit.h
--- src/rxvttoolkit.h	26 Jan 2008 11:37:51 -0000	1.45
+++ src/rxvttoolkit.h	1 Nov 2008 21:49:04 -0000
@@ -61,6 +61,7 @@
   XA_NET_WM_NAME,
   XA_NET_WM_ICON_NAME,
   XA_NET_WM_PING,
+  XA_NET_WM_ICON,
 #endif
 #if USE_XIM
   XA_WM_LOCALE_NAME,
Index: src/xdefaults.C
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/xdefaults.C,v
retrieving revision 1.137
diff -u -r1.137 xdefaults.C
--- src/xdefaults.C	15 Jun 2008 13:54:15 -0000	1.137
+++ src/xdefaults.C	1 Nov 2008 21:49:04 -0000
@@ -264,6 +264,9 @@
 #ifdef HAVE_AFTERIMAGE
               STRG (Rs_blendtype, "blendType", "blt", "string", "background image blending type - alpha, tint, etc..."),
               STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "Gaussian Blur radii to apply to the root background"),
+#if ENABLE_FRILLS 							
+              STRG (Rs_iconfile, "iconFile", "icon", "file", "Filename of icon offered to window manager"),
+#endif
 #endif
               INFO ("e", "command arg ...", "command to execute")
             };
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to