Re: gnome-session: custom per-app icon

On Sat, 2003-03-22 at 09:19, Havoc Pennington wrote:
> On Fri, Mar 21, 2003 at 01:20:22PM +0000, Sergey V. Oudaltsov wrote: 
> > 1. Break gnome-client API and put the icon name into the session.
> > Complex but 100% technically correct
> It doesn't break the API. You can just get the icon bits with
> gtk_window_get_default_icon_list(), or somehow get the icon from the
> .desktop file, or gtk_window_list_toplevels() then
> gtk_window_get_icon(), or use your approach to use application base
> name.
> Then given the icon, you simply set a session property that the
> session manager reads, the same way we currently tell the session
> manager our PID and other details. Can be done entirely in
> gnome-client.c without new API.

Sounds good! How about finding the icon name to be saved to the session
this way:

     1. Try to find a desktop file that matches the binary name, the
        code from the run dialog can be used. The icon from the desktop
        file should be preferred to the window icon because the desktop
        icon presumably represents the base state, and some applications
        (e.g. Evolution and Mozilla) change window icon based on
        application state.
     2. If no desktop file is found, get the icon from the window. If
        the window provides multiple icons, get the one at 48x48
     3. Maybe look for an image file with a specific name in a specific
        place if still no icon is found. Personally I believe that this
        step should be skipped, as any user-controlled daemon should
        have a .desktop file to start / stop it (e.g. gnome-pilot), and
        if this isn't the case it isn't very likely that the daemon has
        an icon at all. (Isn't it possible to create .desktop files that
        aren't displayed in the menu? Then someone that wants to set an
        icon for a daemon can do it this way).
     4. If no icon is found, use a default icon which is not the
        question-mark foot nor the blank sheet used in the window list
        when no icon is found, as neither brings up the image of an
        "application" in my mind. Sadly there doesn't seem to be a
        specific icon for "application/x-executable-binary" in current

I'm sorry that I can't put my code where my mouth is right now, as I'm
about to go on a holiday :-D
But if no one has tried something similar by easter, I might have a look
at it.

Sergey, if the "hidden .desktop file" outlined in 3. works, do you feel
that it is good enough for setting icons for daemons without their own
desktop files?


havardw stud ntnu no||||+47 93 84 64 68
All it takes to start an avalanche is one snowflake||Or a snowboarder
     Oh! Un Fraggle! Regarde, maman! J'ai attrap? un Fraggle!

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