Slaven Rezić

NAME

Tk::FreeDesktop::Wm - a bridge between Tk and freedesktop window managers

SYNOPSIS

    use Tk;
    use Tk::FreeDesktop::Wm;

    my $mw = MainWindow->new;
    my $fd = Tk::FreeDesktop::Wm->new(mw => $mw); # mw argument is optional
    my @supported_properties = $fd->supported; # empty if WM is not a freedesktop WM
    my($desktop_width, $desktop_height) = $fd->desktop_geometry;
    $fd->set_wm_icon(["/path/to/icon16.png", "/path/to/icon32.png", "/path/to/icon48.png"]);

DESCRIPTION

new(mw => $mainwindow)

Construct a Tk::FreeDesktop::Wm object. The named argument mw is optional and should be a Tk::MainWindow object, if given. If omitted, then the first MainWindow is used.

mw([$mainwindow])

Set or get the MainWindow object.

set_wm_icon([$photo, ...])

Set the window manager icon for the running application. The provided argument is either a single element or an array reference of images (for using icons in different sizes). Images may be specified as Tk::Photo objects, or as path names to the image files. By specifying PNG and JPEG files Tk::PNG resp. Tk::JPEG is automatically loaded.

Without this module, one could use the more restricted iconimage Tk::Wm method. It's restricted because images with transparency may not be displayed correctly, and there's no support for multiple icon sizes.

See also "BUGS" for restrictions with alpha channels.

BUGS

Alpha channels not supported in "set_wm_icon"

It's not possible to get the alpha component of a pixel within Perl/Tk. The alpha information is transformed into simple transparency information, which may lead to suboptimal results. Currently it's better to stick to icon images with transparency information only (gif, xpm, png without alpha channel), or without transparency at all.

Currently there's a workaround which is enabled if Imager with PNG support is installed (i.e. if Imager::File::PNG can be loaded). In this case alpha channels are handled correctly.

TODO

Most methods are undocumented.

Many properties are yet unimplemented.

AUTHOR

Slaven Rezic

SEE ALSO

http://www.freedesktop.org/wiki/Specifications/wm-spec/, Tk, Tk::Wm.