! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
port to 4.3
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Show Desktop

Comments

Description Jani Monoses 2006-01-21 20:39:01 CET
4.3 variant of showdesktop plugin, slightly cleaned up version of what I sent to
the list
Comment 1 Jani Monoses 2006-01-21 20:39:53 CET
Created attachment 397 
showdesktop plugin file
Comment 2 Jani Monoses 2006-01-21 20:40:25 CET
Created attachment 398 
makefile
Comment 3 Jani Monoses 2006-01-21 20:41:04 CET
Created attachment 399 
desktop file
Comment 4 Jasper Huijsmans editbugs 2006-01-22 09:21:47 CET
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.

Comment 5 Jani Monoses 2006-01-22 21:45:58 CET
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.
Comment 6 Jani Monoses 2006-01-24 07:44:25 CET
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 ;)
Comment 7 Jani Monoses 2006-01-24 16:56:20 CET
Jasper please disregard the latest attachment, it does not seem to work anymore
as it did when I was testing it originally.
Comment 8 Jani Monoses 2006-01-29 11:23:01 CET
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.
Comment 9 Jasper Huijsmans editbugs 2006-01-29 19:01:20 CET
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.

Bug #1337

Reported by:
Jani Monoses
Reported on: 2006-01-21
Last modified on: 2010-11-20

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Version:
Unspecified

Attachments

showdesktop plugin file (4.26 KB, text/plain)
2006-01-21 20:39 CET , Jani Monoses
no flags
makefile (1.57 KB, text/plain)
2006-01-21 20:40 CET , Jani Monoses
no flags
desktop file (177 bytes, text/plain)
2006-01-21 20:41 CET , Jani Monoses
no flags
updated plugin (3.97 KB, text/plain)
2006-01-22 21:45 CET , Jani Monoses
no flags
updated to detect unshowing (4.65 KB, text/plain)
2006-01-24 07:44 CET , Jani Monoses
no flags

Additional information