From bdf809d0394396c058dddc54d13298c12ab15d4c Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 5 Apr 2020 22:45:49 +0100 Subject: [PATCH] core: listen for substructure notify on frame windows So we can pick up destroy notify of the client windows. Because we need the destroy notify of the client window to trigger a client window recheck on the frame window. This is to handle the case where a frame window is later reused, and the case where multiple client windows are momentarily attached to the same frame[1]. This will also cause events previously unseen to be generated. Most of the events would be ignored, because they don't have a corresponding managed window. Change has been made to ev_reparent_notify, so it would handle the case where a client window is reparented from one frame to another[2]. Previously such events are not received by picom. Related[1]: e9ab9709896688d5bf54555f70aa6341a8c65c0f Related[2]: 481ac54f67a1ab0b5c8544b907d1491599cd118a Related: #299 Signed-off-by: Yuxuan Shui --- src/picom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/picom.c b/src/picom.c index a7bc763..d159dff 100644 --- a/src/picom.c +++ b/src/picom.c @@ -303,9 +303,9 @@ uint32_t determine_evmask(session_t *ps, xcb_window_t wid, win_evmode_t mode) { struct managed_win *w = NULL; // Check if it's a mapped frame window - if (WIN_EVMODE_FRAME == mode || + if (mode == WIN_EVMODE_FRAME || ((w = find_managed_win(ps, wid)) && w->a.map_state == XCB_MAP_STATE_VIEWABLE)) { - evmask |= XCB_EVENT_MASK_PROPERTY_CHANGE; + evmask |= XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY; if (!ps->o.use_ewmh_active_win) { evmask |= XCB_EVENT_MASK_FOCUS_CHANGE; }