From eb81669a3447b4ad7e80fd0113dfd2d1f5ceb0c6 Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Tue, 21 Aug 2012 06:53:45 +0800 Subject: [PATCH] Fix unmapnotify to update the win mapping and iconic state. Improve set_win_state debug. Remove commented global variable. --- spectrwm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index 932f11f..f550e1a 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -269,8 +269,8 @@ xcb_atom_t a_swm_iconic; xcb_atom_t a_swm_ws; volatile sig_atomic_t running = 1; volatile sig_atomic_t restart_wm = 0; +xcb_timestamp_t last_event_time = 0; int outputs = 0; -/*int last_focus_event = FocusOut;*/ int other_wm; int ss_enabled = 0; int xrandr_support; @@ -280,7 +280,6 @@ unsigned int numlockmask = 0; Display *display; xcb_connection_t *conn; xcb_key_symbols_t *syms; -xcb_timestamp_t last_event_time; int cycle_empty = 0; int cycle_visible = 0; @@ -2147,7 +2146,8 @@ set_win_state(struct ws_win *win, uint16_t state) { uint16_t data[2] = { state, XCB_ATOM_NONE }; - DNPRINTF(SWM_D_EVENT, "set_win_state: window: 0x%x\n", win->id); + DNPRINTF(SWM_D_EVENT, "set_win_state: window: 0x%x, state: %u\n", + win->id, state); if (win == NULL) return; @@ -7612,6 +7612,9 @@ unmapnotify(xcb_unmap_notify_event_t *e) if (win == win->ws->focus) win->ws->focus_pending = get_focus_prev(win); + win->mapped = 0; + set_win_state(win, XCB_ICCCM_WM_STATE_ICONIC); + unmanage_window(win); stack(); -- 2.39.2