Add a wallpaper_changed signal

This signal fires whenever the, well, wallpaper changes. Who would have guessed?

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-04-07 21:52:24 +02:00
parent f9d7ac595c
commit 2bd29f2ab4
3 changed files with 14 additions and 0 deletions

View File

@ -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;

1
luaa.c
View File

@ -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");
}

View File

@ -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;