Emit wallpaper_changed less often (#1800)

Commit 222f0a133c optimised the case where we change the wallpaper
so that we can give the new wallpaper to Lua faster. However, contrary
to what was intended, it also caused another wallpaper update later when
the server told us that the wallpaper actually changed. This was because
the juggling with multiple X11 connections went wrong.

Fix this by using the right connection to actually change the wallpaper.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-05-29 20:08:56 +02:00 committed by Daniel Hahler
parent b8d4257d74
commit b5cdd06a78
1 changed files with 2 additions and 1 deletions

3
root.c
View File

@ -119,12 +119,13 @@ root_set_wallpaper(cairo_pattern_t *pattern)
globalconf.screen->root, globalconf.screen->root,
XCB_CW_EVENT_MASK, XCB_CW_EVENT_MASK,
(uint32_t[]) { 0 }); (uint32_t[]) { 0 });
root_set_wallpaper_pixmap(c, p); root_set_wallpaper_pixmap(globalconf.connection, p);
xcb_change_window_attributes(globalconf.connection, xcb_change_window_attributes(globalconf.connection,
globalconf.screen->root, globalconf.screen->root,
XCB_CW_EVENT_MASK, XCB_CW_EVENT_MASK,
ROOT_WINDOW_EVENT_MASK); ROOT_WINDOW_EVENT_MASK);
xcb_ungrab_server(globalconf.connection); xcb_ungrab_server(globalconf.connection);
xcb_flush(globalconf.connection);
/* Make sure our pixmap is not destroyed when we disconnect. */ /* Make sure our pixmap is not destroyed when we disconnect. */
xcb_set_close_down_mode(c, XCB_CLOSE_DOWN_RETAIN_PERMANENT); xcb_set_close_down_mode(c, XCB_CLOSE_DOWN_RETAIN_PERMANENT);