-
This is not a bug report, but an off-topic programming question. Feel free to close if it's too far off-topic. I am currently trying to write a program to set the wallpaper. From what I can tell, this is basically done by drawing to X's root window. I have this program so far: #include <stdlib.h>
#include <stdio.h>
#include <xcb/xcb.h>
int main () {
xcb_rectangle_t rectangles[] = {
{ 200, 200, 400, 400 },
};
xcb_connection_t *c = xcb_connect(NULL, NULL);
/* get the first screen */
xcb_screen_t *screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
xcb_gcontext_t gc = xcb_generate_id(c);
/* root window */
xcb_drawable_t draw = screen->root;
/* or any other window id: xcb_drawable_t draw = 0x4200004; */
uint32_t mask = XCB_GC_FUNCTION | XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_LINE_WIDTH| XCB_GC_LINE_STYLE | XCB_GC_GRAPHICS_EXPOSURES;
uint32_t values[] = {
XCB_GX_XOR,
screen->white_pixel,
screen->black_pixel,
1,
XCB_LINE_STYLE_ON_OFF_DASH,
0
};
xcb_create_gc(c, gc, draw, mask, values);
xcb_map_window(c, draw);
while (true) {
xcb_poly_rectangle(c, draw, gc, 3, rectangles);
xcb_flush(c);
}
return 0;
} This only works if picom is not running. I tried setting the drawable directly to something else (see the comment below xcb_drawable_t draw = ...), which also didn't work. Can someone give me a hint about how I'd go with drawing to the desktop while picom is running? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Wallpaper is usually set by setting the background pixmap of the X root window. picom doesn't render the content of the root window, so anything that was drawn on the root window will be lost when picom is running. |
Beta Was this translation helpful? Give feedback.
Wallpaper is usually set by setting the background pixmap of the X root window.
picom doesn't render the content of the root window, so anything that was drawn on the root window will be lost when picom is running.