This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Custom icons per window class/name patch


Earle,

Sorry to take this back to a discussion that you guys were having earlier... but I remember that someone wrote something along the lines of, "most window managers include their own set of icons for X apps since most X apps do not set an icon to be shown on the upper-left hand corner of the window".

When taken in the context of standard X window managers, that sounds plausible. However, Exceed and XWin-32, if I recall correctly, seem to display upper-left hand corner icons for most X apps. I sort of doubt that Exceed and XWin-32 come with a set of icons for common X apps, but I could be wrong.

Can anyone concretely prove to me that there is not a way to do app icons without having a icon config file and a set of icon files for common X apps? I would really like to avoid the headaches of distributing icons and a new config file, if at all possible.

I am going to hold off on committing this patch until I am convinced that it is the best way to go.


Thanks for contributing,


Harold

Earle F. Philhower III wrote:

Hi Ralf,

I did some checking in between packing today and it was relatively simple
to get the res_class and res_name of a window in the winCreateWin function,
but the thing is you can't use any XLib calls:  you're the server itself at
that point, and not a client!

I've done a quick-n-easy icon specifier, namely a file called
c:\windows\xwin.ini .  It's a standard old format text INI file with the
[sections] being the class and identifiers=c:\file.ico being the keys.
If a res_name isn't matched, it uses the _default key for the icon.  If
the res_class isn't matched, the default X icon is used...
Ex:
[XLoad]
_default=z:\tmp\xload.ico

[Fig]
_default=z:\tmp\xfig.ico
file_popup=z:\tmp\file.ico

Note you need Windoze paths since I call the API LoadImage() to get the ICO
into a handle.  Use "xprop" to get the res_name and res_class of a window.

There are 2 new small files, I created them in because they need special
includes that the main files don't need or want.

Feel free to use this as a base to add a nicer UI and maybe use XPMs and other
image formats instead of plain Windoze .icos...



-Earle F. Philhower, III earle@ziplabel.com cdrlabel - ZipLabel - FlpLabel http://www.cdrlabel.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]