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: question about multiwindow mode and application icons


Howdy...

--------------------------------
Ralf Habacker wrote:
I'm already wondering about this, now it is clear.
Let me ask one question: It is possible to get the executable name of an
x-application on the server ?
I'm asking because I have a working solutions using icon dlls for the
application identifing the application by its window title. Using the
application executable name would make this much easier. See the next mail
to
the list with a proposal for this.
--------------------------------

Try checking WM_CLASS properties.  A quick check would be to run xprop
on the window you're interested in.  WM_CLASS is what .Xresources works
off of IIRC.

---------------------------------
> For most of the X Consortium apps I don't think there are icons, alot of
them
> predate WM_HINTS I think!
When I starting thinking about this feature, I took a look into the qt
library
source (see for example
up) and I recognized that for qt and kde applications it should do so. 
(May be
you can find more. Search for "SetIcon". )
---------------------------------

I don't have QT running, but since you do maybe you can write a quick
app that makes a window and just SetIcon()s it over and over and see
if the message ever gets thru to the procedure, maybe it's getting
into the X callback procedure but I've made a mistake in the ATOM spec
for the WM_HINT option?  

---------------------------------
In the meantime I've got some more details on how this feature (displaying
different icons for x applications in the win32 window) could be implemented.
I'm going to use a three level icon display scheme, choosen by the informations
an x application will give.
1. An x-application provides an application icon through the WM_HINTS events,
which will be displayed as win32 window icon.
2. In case point 1. doesn't work, users can provide a special icon dll, loaded
at runtime into the server, which contains icons for specific applications like
other window manager does through special icon files (for example icewm).
Identifying the icons will be done through the application window title. There
are more than one icon dll setup through an environment variable possible, which
will be searched one by one. If no icon was found the xserver tries at last a
default icon dll for general x applications.
Current implementation status:
1. not working yet due to problems getting the WM_HINTS event
2. a working solution available (tested with some qt and kde applications)
-----------------------
That was fast!

----------------
open issues:
A. currently all win32 windows of the multi-window mode shares the same window
class, which means, that changing a single windows icon will change *all* icons.
As a hack I have implemented different window classes for each windows. This
isn't very good, because x applications uses an icon only for the main window,
which means that additional opened windows will display the default 'x' icon.
A better solution is to use one window class for all windows of one
application -> Unfortunally I don't know to implement this.
-----------------
Instead of using the class icon, how about doing your own WM_NCPAINT
handling?  You can set the class icon to NULL or a blank icon when you
register the class, and in the WM_NCPAINT first call the default
handler to draw the title/etc, and then DrawIcon(fn(x-class)) in the
non client region, after getting the icon x/y from GetSysMetrics.

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


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