discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recognize app icon from xwindow side


From: Yen-Ju Chen
Subject: Recognize app icon from xwindow side
Date: Thu, 1 Mar 2007 22:28:22 -0800

Here is a piece of code to specify a GNUstep app icon:
("XGServerWindow.m" line 2517 of 4071)

     /*
      * If we are asked to set hints for the appicon and the window manager is
      * to control it, we must let the window manager know that this window is
      * the icon window for the app root window.
      */
     if ((window->win_attrs.window_style & NSIconWindowMask) != 0)
       {
         XWMHints gen_hints;

         gen_hints.flags = WindowGroupHint | StateHint | IconWindowHint;
         gen_hints.initial_state = WithdrawnState;
         gen_hints.window_group = ROOT;
         gen_hints.icon_window = window->ident;

         if (!didCreatePixmaps)
           {
             [self _createAppIconPixmaps];
           }

         if (xIconPixmap)
           {
             gen_hints.flags |= IconPixmapHint;
             gen_hints.icon_pixmap = xIconPixmap;
           }
         if (xIconMask);
           {
             gen_hints.flags |= IconMaskHint;
             gen_hints.icon_mask = xIconMask;
           }

         XSetWMHints(dpy, ROOT, &gen_hints);
       }

What I don't understand is that in the end, all the flags (XWMHints)
are assigned
to the ROOT, not the window->ident.
In another word, if I need to figure out which xwindow is the GNUstep app icon,
I have to lookup up its group leader, get this hints, then find out
the app icon.
But for miniwindow, it does set icon_window to itself (-miniwindow:).
It may highly depending on the window manager
and obviously works for WindowMaker.
Xlib document is not very clear on this issue.

Another way to guess which NSWindow is app icon is through window level.
But NSDockWindowLevel is deprecated
and NSStatusWindowLevel seems not exclusive for app icon.

What would be the most reliable way to know which xwindow is the app icon ?
Thanx




reply via email to

[Prev in Thread] Current Thread [Next in Thread]