Hi, I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2? -- Cheers Jorge.-
On Wed, Sep 24, 2008 at 06:48:17PM -0400, Jorge Arellano Cid wrote:
I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2?
It appears not to be possible. In X Windows you set the _NET_WM_ICON hint (as described at http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html#id2523482 example at http://lists.kde.org/?m=115435217715650 but there is no mention of _NET_WM_ICON anywhere in the FLTK source (in fact no use of WM hints anywhere except in Window_fullscreen.cxx and once in Window::show() to set the command string). The FLTK docs for Window::iconize() say Currently there are only X and Win32 system-specific ways to control what is drawn in the icon. You should not rely on window managers displaying the icons. So I think we would have to write X11-specific code. :-( Regards, Jeremy Henty
-------- Original-Nachricht --------
Datum: Thu, 25 Sep 2008 08:03:52 +0100 Von: Jeremy Henty <onepoint@starurchin.org> An: dillo-dev@dillo.org Betreff: Re: [Dillo-dev] Icon for Dillo window
On Wed, Sep 24, 2008 at 06:48:17PM -0400, Jorge Arellano Cid wrote:
I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2?
It appears not to be possible. In X Windows you set the _NET_WM_ICON hint (as described at
http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html#id2523482
example at
http://lists.kde.org/?m=115435217715650
but there is no mention of _NET_WM_ICON anywhere in the FLTK source (in fact no use of WM hints anywhere except in Window_fullscreen.cxx and once in Window::show() to set the command string). The FLTK docs for Window::iconize() say
Currently there are only X and Win32 system-specific ways to control what is drawn in the icon. You should not rely on window managers displaying the icons.
So I think we would have to write X11-specific code. :-(
test/image.cxx has from the fltk2 tarball shows how to do it. It's X11-only though. Cheers, Johannes -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
On Thu, Sep 25, 2008 at 12:12:26PM +0200, Johannes Hofmann wrote:
-------- Original-Nachricht --------
Datum: Thu, 25 Sep 2008 08:03:52 +0100 Von: Jeremy Henty <onepoint@starurchin.org> An: dillo-dev@dillo.org Betreff: Re: [Dillo-dev] Icon for Dillo window
On Wed, Sep 24, 2008 at 06:48:17PM -0400, Jorge Arellano Cid wrote:
I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2?
It appears not to be possible. In X Windows you set the _NET_WM_ICON hint
test/image.cxx has from the fltk2 tarball shows how to do it.
That doesn't work on my system (my window manager is icewm). For me test/image gets the standard X icon in its window frame and in its taskbar box when miminised (icewm doesn't use desktop icons). Does it work with any other window managers? Icewm sets icons by reading the WM_CLASS hint, interpreting it as the root of the icon file names and searching for the files in its icon directories. Unfortunately dillo2 sets WM_CLASS to '"Fltk", "fltk"'. If it set it to '"Dillo2", "dillo2"' I could configure its icons. If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle. (The weird thing is that my icewm finds the right Firefox icons, yet I can't find any Firefox icon files in the icon directories. I'm still trying to figure out where it gets them from.) Also, the _NET_WM_ICON hint has the advantage that it can provide a list of icons of different sizes so that window managers can use a larger icon eg. when switching between applications with Alt+Tab. Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 12:12:26PM +0200, Johannes Hofmann wrote:
-------- Original-Nachricht --------
Datum: Thu, 25 Sep 2008 08:03:52 +0100 Von: Jeremy Henty <onepoint@starurchin.org> An: dillo-dev@dillo.org Betreff: Re: [Dillo-dev] Icon for Dillo window
On Wed, Sep 24, 2008 at 06:48:17PM -0400, Jorge Arellano Cid wrote:
I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2?
It appears not to be possible. In X Windows you set the _NET_WM_ICON hint
test/image.cxx has from the fltk2 tarball shows how to do it.
That doesn't work on my system (my window manager is icewm). For me test/image gets the standard X icon in its window frame and in its taskbar box when miminised (icewm doesn't use desktop icons). Does it work with any other window managers?
It worked for me with fvwm.
Icewm sets icons by reading the WM_CLASS hint, interpreting it as the root of the icon file names and searching for the files in its icon directories. Unfortunately dillo2 sets WM_CLASS to '"Fltk", "fltk"'. If it set it to '"Dillo2", "dillo2"' I could configure its icons.
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
(The weird thing is that my icewm finds the right Firefox icons, yet I can't find any Firefox icon files in the icon directories. I'm still trying to figure out where it gets them from.)
Also, the _NET_WM_ICON hint has the advantage that it can provide a list of icons of different sizes so that window managers can use a larger icon eg. when switching between applications with Alt+Tab.
Hm, no idea what is currently the best way to do this. Any X11 specialists here? Regards, Johannes
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
That doesn't work on my system (my window manager is icewm). For me test/image gets the standard X icon in its window frame and in its taskbar box when miminised (icewm doesn't use desktop icons). Does it work with any other window managers?
It worked for me with fvwm.
OK, then it's worth doing even if it doesn't work everywhere (especially since the FLTK docs make it clear that nothing will work everywhere).
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Also, the _NET_WM_ICON hint has the advantage that it can provide a list of icons of different sizes so that window managers can use a larger icon eg. when switching between applications with Alt+Tab.
Hm, no idea what is currently the best way to do this. Any X11 specialists here?
I already have code to set the _NET_WM_ICON hint. It's very straightforward (I just modified the sample code from one of the bug reports I linked to earlier). I can verify (using xprop) that the hint is but I can't check that it will actually affect the icon (because icewm ignores the hint), and I haven't figured out how to translate images into the right format. The freedesktop.org documentation is not completely specific about this. Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 04:33:57PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
That doesn't work on my system (my window manager is icewm). For me test/image gets the standard X icon in its window frame and in its taskbar box when miminised (icewm doesn't use desktop icons). Does it work with any other window managers?
It worked for me with fvwm.
OK, then it's worth doing even if it doesn't work everywhere (especially since the FLTK docs make it clear that nothing will work everywhere).
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Also, the _NET_WM_ICON hint has the advantage that it can provide a list of icons of different sizes so that window managers can use a larger icon eg. when switching between applications with Alt+Tab.
Hm, no idea what is currently the best way to do this. Any X11 specialists here?
I already have code to set the _NET_WM_ICON hint. It's very straightforward (I just modified the sample code from one of the bug reports I linked to earlier). I can verify (using xprop) that the hint is but I can't check that it will actually affect the icon (because icewm ignores the hint), and I haven't figured out how to translate images into the right format. The freedesktop.org documentation is not completely specific about this.
Maybe you know that already, but the fltk2 method from the test/image.cxx example also sets the _NET_WM_ICON hint: from xprop: WM_COMMAND(STRING) = { "./image" } WM_HINTS(WM_HINTS): Client accepts input or input focus: True _NET_WM_ICON(CARDINAL) = 64, 64, 0, 0, 0, 0, 0 ... Regards, Johannes
On Thu, Sep 25, 2008 at 06:04:07PM +0200, Johannes Hofmann wrote:
Maybe you know that already, but the fltk2 method from the test/image.cxx example also sets the _NET_WM_ICON hint:
No, I missed that. Thanks for pointing it out! It seems that window.icon() sets the hint. I don't know what to do if you wanted to set _NET_WM_ICON to a list of icons (of different sizes) rather than just one. But maybe that's not necessary: test/image specifies a large icon (64x64) so perhaps it's relying on the desktop to scale it down as necessary. IIRC the freedesktop.org docs say that the window manager MAY do that. BTW, how do fltk::Window::xclass() and fltk::Window::icon() work? All they do is set private variables. Somewhere those variables must be sent to X11 so that something actually happens on the desktop, but I'm darned if I can see where the FLTK code does it. It seems to be happening by voodoo. Are we meddling with forces that humanity was not meant to wield? :-) Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 06:28:38PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 06:04:07PM +0200, Johannes Hofmann wrote:
Maybe you know that already, but the fltk2 method from the test/image.cxx example also sets the _NET_WM_ICON hint:
No, I missed that. Thanks for pointing it out! It seems that window.icon() sets the hint. I don't know what to do if you wanted to set _NET_WM_ICON to a list of icons (of different sizes) rather than just one. But maybe that's not necessary: test/image specifies a large icon (64x64) so perhaps it's relying on the desktop to scale it down as necessary. IIRC the freedesktop.org docs say that the window manager MAY do that.
BTW, how do fltk::Window::xclass() and fltk::Window::icon() work? All they do is set private variables. Somewhere those variables must be sent to X11 so that something actually happens on the desktop, but I'm darned if I can see where the FLTK code does it. It seems to be happening by voodoo. Are we meddling with forces that humanity was not meant to wield? :-)
They hide that stuff in deep in their source tree. It's in src/x11/run.cxx ;-) Johannes
Replying to myself: On Thu, Sep 25, 2008 at 04:33:57PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!! Jeremy Henty
On Thu, Sep 25, 2008 at 06:05:37PM +0100, Jeremy Henty wrote:
Replying to myself:
On Thu, Sep 25, 2008 at 04:33:57PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!!
Cool! But perhaps it should even be "Dillo" instead of "Dillo2". It's still dillo after all. Cheers, Johannes
On Thu, Sep 25, 2008 at 07:04:05PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 06:05:37PM +0100, Jeremy Henty wrote:
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!!
Cool! But perhaps it should even be "Dillo" instead of "Dillo2". It's still dillo after all.
I thought about that, then I decided that since we now use dillo2rc I would go with dillo2 for consistency. But it's no big deal, I'd be as happy with "dillo" as "dillo2" because icewm can map any given value of WM_CLASS to any icon name. Incidentally, we could alternatively call fltk::Window::show() with argc and argv as arguments (it's overloaded). That would do the default thing of taking WM_CLASS from argv[0], so we would get "dillo-fltk". I decided not to because it means passing argc and argv from main() in dillo.cc to the call to fltk::Window::show() in uicmd.cc and I wanted the shortest patch that could possibly work. But maybe there's a case for doing it that way. (Perhaps it's time to rename the executable to dillo2, or even dillo?) I don't care as long as we change WM_CLASS from the default of "fltk" to *something* that I can map to the dillo icons in my icewm configuration. Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 06:57:48PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 07:04:05PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 06:05:37PM +0100, Jeremy Henty wrote:
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!!
Cool! But perhaps it should even be "Dillo" instead of "Dillo2". It's still dillo after all.
I thought about that, then I decided that since we now use dillo2rc I would go with dillo2 for consistency. But it's no big deal, I'd be as happy with "dillo" as "dillo2" because icewm can map any given value of WM_CLASS to any icon name.
Incidentally, we could alternatively call fltk::Window::show() with argc and argv as arguments (it's overloaded). That would do the default thing of taking WM_CLASS from argv[0], so we would get "dillo-fltk". I decided not to because it means passing argc and argv from main() in dillo.cc to the call to fltk::Window::show() in uicmd.cc and I wanted the shortest patch that could possibly work. But maybe there's a case for doing it that way. (Perhaps it's time to rename the executable to dillo2, or even dillo?) I don't care as long as we change WM_CLASS from the default of "fltk" to *something* that I can map to the dillo icons in my icewm configuration.
Yes, it's time to change the binary name. I like dillo2 because that way it's possible to have dillo1 and dillo2 installed without trouble. OTOH, dillo2 is still dillo and dillo1 is obsolete. Maybe "dillo" is the best option. What do others think? -- Cheers Jorge.-
Jorge wrote:
Yes, it's time to change the binary name.
I like dillo2 because that way it's possible to have dillo1 and dillo2 installed without trouble. OTOH, dillo2 is still dillo and dillo1 is obsolete.
Maybe "dillo" is the best option. What do others think?
This came up in May when updating the FAQ: Justus and I said that we like "dillo" rather than "dillo2", and nobody else expressed an opinion.
Replying to myself *again*, this is getting to be a bad habit! :-) On Thu, Sep 25, 2008 at 06:57:48PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 07:04:05PM +0200, Johannes Hofmann wrote:
Cool! But perhaps it should even be "Dillo" instead of "Dillo2". It's still dillo after all.
I thought about that, then I decided that since we now use dillo2rc I would go with dillo2 for consistency.
After more thought I now agree with Johannes. WM_CLASS should tell the desktop whether the window is running Dillo, Firefox, XChat, GnuCash, GIMP or whatever. It should not make the user worry whether they're running dillo1 or dillo2. That's precisely the kind of detail that the desktop should be hiding from the user. So WM_CLASS should be just "Dillo", whatever the dillo executable is called. Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 07:04:05PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 06:05:37PM +0100, Jeremy Henty wrote:
Replying to myself:
On Thu, Sep 25, 2008 at 04:33:57PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!!
Cool! But perhaps it should even be "Dillo" instead of "Dillo2". It's still dillo after all.
Yes, it can be "Dillo". BTW, where does the WM get the icon from? -- Cheers Jorge.-
On Thu, Sep 25, 2008 at 06:05:37PM +0100, Jeremy Henty wrote:
Replying to myself:
On Thu, Sep 25, 2008 at 04:33:57PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 04:14:48PM +0200, Johannes Hofmann wrote:
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
Yes that sounds right.
I'll propose a patch later today for comments.
Heh, it's a one liner. I HAZ DILLLO EICONZ NAOW!!!
Jeremy Henty
diff -pru -- 00_pre/src/dillo.cc 01_post/src/dillo.cc --- 00_pre/src/dillo.cc 2008-09-25 17:57:43.000000000 +0100 +++ 01_post/src/dillo.cc 2008-09-25 17:57:43.000000000 +0100 @@ -101,6 +101,8 @@ int main(int argc, char **argv) a_Bw_init(); a_Cookies_init();
+ fltk::Window::xclass("dillo2"); // sets WM_CLASS hint on X11 + // Create a new UI/bw pair BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, NULL, 0);
Committed as "dillo". Jeremy: I can't get the window icon during Alt+Tab with icewm nor xfce. How did you set it? -- Cheers Jorge.-
On Sat, Sep 27, 2008 at 09:36:40AM -0400, Jorge Arellano Cid wrote:
Jeremy: I can't get the window icon during Alt+Tab with icewm nor xfce. How did you set it?
In ~/.icewm/winoptions I have a line Dillo.icon: dillo In ~/.icewm/icons I have files dillo_16x16.xpm dillo_32x32.xpm dillo_48x48.xpm dillo_64x64.xpm I think Alt+Tab looks for one of the larger sized icons. Regards, Jeremy Henty
On Sat, Sep 27, 2008 at 03:44:01PM +0100, Jeremy Henty wrote:
On Sat, Sep 27, 2008 at 09:36:40AM -0400, Jorge Arellano Cid wrote:
Jeremy: I can't get the window icon during Alt+Tab with icewm nor xfce. How did you set it?
In ~/.icewm/winoptions I have a line
Dillo.icon: dillo
In ~/.icewm/icons I have files
dillo_16x16.xpm dillo_32x32.xpm dillo_48x48.xpm dillo_64x64.xpm
I think Alt+Tab looks for one of the larger sized icons.
Thanks, now it works for me. -- Cheers Jorge.-
On Sat, Sep 27, 2008 at 09:36:40AM -0400, Jorge Arellano Cid wrote:
Jeremy: I can't get the window icon during Alt+Tab with icewm nor xfce. How did you set it?
I don't use xfce but http://wiki.xfce.org/faq says Is it possible to change the icon used by the icon box or task bar for a given application? It's not possible. This setting has to be managed by the application itself. which is not encouraging. Regards, Jeremy Henty
On Thu, Sep 25, 2008 at 03:11:55PM +0100, Jeremy Henty wrote:
On Thu, Sep 25, 2008 at 12:12:26PM +0200, Johannes Hofmann wrote:
-------- Original-Nachricht --------
Datum: Thu, 25 Sep 2008 08:03:52 +0100 Von: Jeremy Henty <onepoint@starurchin.org> An: dillo-dev@dillo.org Betreff: Re: [Dillo-dev] Icon for Dillo window
On Wed, Sep 24, 2008 at 06:48:17PM -0400, Jorge Arellano Cid wrote:
I was thinking it'd be good to provide an icon for the WM to use. Does anybody know how to do it with FLTK2?
It appears not to be possible. In X Windows you set the _NET_WM_ICON hint
test/image.cxx has from the fltk2 tarball shows how to do it.
That doesn't work on my system (my window manager is icewm). For me test/image gets the standard X icon in its window frame and in its taskbar box when miminised (icewm doesn't use desktop icons). Does it work with any other window managers?
It doesn't work here with XFCE.
Icewm sets icons by reading the WM_CLASS hint, interpreting it as the root of the icon file names and searching for the files in its icon directories. Unfortunately dillo2 sets WM_CLASS to '"Fltk", "fltk"'. If it set it to '"Dillo2", "dillo2"' I could configure its icons.
Could be.
If we're concerned about dillo2 playing properly with X11 and window managers then I'd say that it should set WM_CLASS to '"Dillo2", "dillo2"' on general principle.
(The weird thing is that my icewm finds the right Firefox icons, yet I can't find any Firefox icon files in the icon directories. I'm still trying to figure out where it gets them from.)
Also, the _NET_WM_ICON hint has the advantage that it can provide a list of icons of different sizes so that window managers can use a larger icon eg. when switching between applications with Alt+Tab.
If you know a good way to do it, please go ahead. -- Cheers Jorge.-
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
onepoint@starurchin.org