The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::MathImage::X11::Protocol::XSetRoot -- set root window background

SYNOPSIS

 use App::MathImage::X11::Protocol::XSetRoot;
 App::MathImage::X11::Protocol::XSetRoot->set_background
   (X       => $X11_protocol_object,
    rootwin => $root_xid,
    pixmap  => $pixmap_xid,
    allocated_pixels => $bool);
 # now don't use $X11_protocol_object connection any more

DESCRIPTION

This module uses an X11::Protocol connection object to set the root window background in the style of the xsetroot program.

FUNCTIONS

App::MathImage::X11::Protocol::XSetRoot->set_background (key=>value, ...)

Set the root window background to a pixmap or a pixel. The key/value parameters are

    X        => X11::Protocol object
    display  => string ":0:0" etc
    rootwin  => XID of root window, otherwise default
    pixmap   => XID of pixmap to display
    pixel    => integer pixel value
    allocated_pixels => boolean, default false

X is the X11::Protocol connection, or display is a display name to connect to, or otherwise the default display per $ENV{'DISPLAY'} is used.

pixmap is the XID of a pixmap to set as the background, or pixel is an integer pixel value. One of the two is mandatory.

If allocated_pixels is true then pixel or some of the pixels in pixmap have been allocated in the root window's colormap. Those allocations are preserved if necessary using SetCloseDownMode('RetainPermanent') and an ID saved in the root window _XSETROOT_ID property. In this case the $X connection cannot be used any more as it could be killed at any time by another xsetroot freeing the allocations.

App::MathImage::X11::Protocol::XSetRoot->kill_id ($X)
App::MathImage::X11::Protocol::XSetRoot->kill_id ($X, $rootwin)

Kill any existing _XSETROOT_ID on the given $rootwin XID. If $rootwin is undef or omitted then the $X default root is used.

This is normally only wanted when replacing _XSETROOT_ID in the way set_background above does.

SEE ALSO

math-image

HOME PAGE

http://user42.tuxfamily.org/math-image/index.html

LICENSE

Copyright 2010, 2011 Kevin Ryde

Math-Image is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-Image is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-Image. If not, see <http://www.gnu.org/licenses/>.