diff --git a/event.c b/event.c index 8bea60ca..570f37c8 100644 --- a/event.c +++ b/event.c @@ -426,7 +426,7 @@ event_handle_destroynotify(xcb_destroy_notify_event_t *ev) /** Record that the given drawable contains the pointer. */ -static void +void event_drawable_under_mouse(lua_State *L, int ud) { void *d; diff --git a/event.h b/event.h index e1ce8fe8..61c60884 100644 --- a/event.h +++ b/event.h @@ -48,7 +48,8 @@ awesome_refresh(void) return xcb_flush(globalconf.connection); } -void event_handle(xcb_generic_event_t *event); +void event_handle(xcb_generic_event_t *); +void event_drawable_under_mouse(lua_State *, int); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/objects/client.c b/objects/client.c index 244c5b09..5ce84f3f 100644 --- a/objects/client.c +++ b/objects/client.c @@ -1335,6 +1335,13 @@ client_unmanage(client_t *c, bool window_valid) if (c->titlebar[bar].drawable == NULL) continue; + if (globalconf.drawable_under_mouse == c->titlebar[bar].drawable) { + /* Leave drawable before we invalidate the client */ + lua_pushnil(L); + event_drawable_under_mouse(L, -1); + lua_pop(L, 1); + } + /* Forget about the drawable */ luaA_object_push(L, c); luaA_object_unref_item(L, -1, c->titlebar[bar].drawable);