diff --git a/globalconf.h b/globalconf.h index 0581c0b2e..06b9abb79 100644 --- a/globalconf.h +++ b/globalconf.h @@ -44,6 +44,7 @@ | XCB_EVENT_MASK_BUTTON_PRESS \ | XCB_EVENT_MASK_BUTTON_RELEASE \ | XCB_EVENT_MASK_FOCUS_CHANGE \ + | XCB_EVENT_MASK_PROPERTY_CHANGE \ } typedef struct drawin_t drawin_t; diff --git a/luaa.c b/luaa.c index ee2636601..2b61289e8 100644 --- a/luaa.c +++ b/luaa.c @@ -658,6 +658,7 @@ luaA_init(xdgHandle* xdg) signal_add(&global_signals, "debug::index::miss"); signal_add(&global_signals, "debug::newindex::miss"); signal_add(&global_signals, "systray::update"); + signal_add(&global_signals, "wallpaper_changed"); signal_add(&global_signals, "refresh"); signal_add(&global_signals, "exit"); } diff --git a/property.c b/property.c index d5b030f62..610174628 100644 --- a/property.c +++ b/property.c @@ -359,6 +359,15 @@ property_handle_net_wm_opacity(uint8_t state, return 0; } +static int +property_handle_xrootpmap_id(uint8_t state, + xcb_window_t window) +{ + signal_object_emit(globalconf.L, &global_signals, "wallpaper_changed", 0); + return 0; +} + + /** The property notify event handler. * \param data Unused data. * \param connection The connection to the X server. @@ -404,6 +413,9 @@ property_handle_propertynotify(xcb_property_notify_event_t *ev) HANDLE(_NET_WM_PID, property_handle_net_wm_pid) HANDLE(_NET_WM_WINDOW_OPACITY, property_handle_net_wm_opacity) + /* background change */ + HANDLE(_XROOTPMAP_ID, property_handle_xrootpmap_id) + /* If nothing was found, return */ END;