]>
Dogcows Code - chaz/openbox/blob - tools/obsetroot.cc
7 int screen
= DefaultScreen(**otk::display
);
10 Window root
= otk::display
->screenInfo(screen
)->rootWindow();
12 otk::Surface
*s
= new otk::Surface(screen
,
13 otk::display
->screenInfo(screen
)->size());
14 otk::RenderTexture
*tx
= new otk::RenderTexture(screen
, false,
15 otk::RenderTexture::Flat
,
16 otk::RenderTexture::Bevel1
,
18 otk::RenderTexture::Solid
,
19 false, 0x202020, 0x0000ff,
21 otk::display
->renderControl(screen
)->drawBackground(*s
, *tx
);
25 otk::display
->setIgnoreErrors(true);
26 // get the current pixmap and free it
27 if (otk::Property::get(root
, otk::Property::atoms
.rootpmapid
,
28 otk::Property::atoms
.pixmap
, &old
) && old
) {
29 XKillClient(**otk::display
, old
);
30 XSync(**otk::display
, false);
31 XFreePixmap(**otk::display
, old
);
33 if (otk::Property::get(root
, otk::Property::atoms
.esetrootid
,
34 otk::Property::atoms
.pixmap
, &old
) && old
)
35 XFreePixmap(**otk::display
, old
);
36 otk::display
->setIgnoreErrors(false);
38 // XSetWindowBackground(**display, root, color.pixel());
40 // don't kill us when someone wants to change the background!!
41 Pixmap pixmap
= XCreatePixmap(**otk::display
, root
, s
->size().width(),
43 otk::display
->screenInfo(screen
)->depth());
44 XCopyArea(**otk::display
, s
->pixmap(), pixmap
,
45 DefaultGC(**otk::display
, screen
), 0, 0,
46 s
->size().width(), s
->size().height(), 0, 0);
49 XSetWindowBackgroundPixmap(**otk::display
, root
, pixmap
);
50 XClearWindow(**otk::display
, root
);
52 otk::Property::set(root
, otk::Property::atoms
.rootpmapid
,
53 otk::Property::atoms
.pixmap
, pixmap
);
54 otk::Property::set(root
, otk::Property::atoms
.esetrootid
,
55 otk::Property::atoms
.pixmap
, pixmap
);
57 otk::display
->ungrab();
62 XSetCloseDownMode(**otk::display
, RetainPermanent
);
63 XKillClient(**otk::display
, AllTemporary
);
This page took 0.036806 seconds and 4 git commands to generate.