4.3 variant of showdesktop plugin, slightly cleaned up version of what I sent to the list
Created attachment 397 showdesktop plugin file
Created attachment 398 makefile
Created attachment 399 desktop file
Great, thanks, I have a couple of comments: - gdk_pixbuf_scale_simple returns a newly created pixbuf, so this leaks memory: static void showdesktop_update_icon (ShowDesktopData * sdd, int size) { GdkPixbuf *pb = gdk_pixbuf_copy (sdd->icon); gdk_pixbuf_scale_simple (pb, size, size, GDK_INTERP_BILINEAR); xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (sdd->image), pb); g_object_unref (G_OBJECT (pb)); } - also, the purpose of the scaled image is to scale automatically, so this is not needed at all. You can simple create the image once and set the size of the button. - If all you want to do in the set_size callback is change the button size, you don't need to do anything, since this is the default behavior if there is no callback. - A question: what happens when a user manually de-iconifies a window? Does the window manager reset the 'show desktop' state? In that case we need to reset the button as well, I guess.
Created attachment 403 updated plugin ok, got rid of that icon_update function and its leak and did some minor cleanups too. Even if I just need to resize the button which is supposed to be the default action, I still have to have this set_size function because otherwise the icon has constant size regardless of panel size.It does not shrink. It would be nice to not need a set_size handler for such generic cases but I don't know why it does not work. I am also looking into making it unset showdesktop on window deiconification as you suggested, since gnome seems to do it.
Created attachment 408 updated to detect unshowing now if windows are deiconified or another showdesktop button is toggled the button should update accordingly. But the former (window case) only works with metacity since xfwm4 does not send the "showing_desktop_changed" signal on window popup. I looked at metacity and xfwm4 code and it will take some time for me to correctly figure this out. Maybe when the plugin is in the panel Olivier will do this ;)
Jasper please disregard the latest attachment, it does not seem to work anymore as it did when I was testing it originally.
actually it is good, it was something else wrong when I wrote the previous comment. And with Olivier's recent xfwm4 change, the unshow feature is correctly reflected in the toggle button.
Ok, comitted. I made a few simple changes: free resources (ShowDesktopData struct and tooltips object), use default sizing (should be fixed now) and make the NetkScreen part of the struct. Thanks a lot for making the port.