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;
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;
int32_t v = 0;
xcb_get_property_reply_t *pr = NULL;
-
pr = xcb_get_property_reply(conn,
xcb_get_property(conn, 0, win->id, a_swm_iconic,
XCB_ATOM_INTEGER, 0, 1), NULL);
{
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;
struct ws_win *cur_focus;
struct ws_win_list *wl;
-
DNPRINTF(SWM_D_WS, "swapwin: id: %d, screen[%d]:%dx%d+%d+%d, ws: %d\n",
args->id, r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r), r->ws->idx);
xcb_flush(conn);
}
-
int
floating_toggle_win(struct ws_win *win)
{
move(win, args);
}
-
/* user/key callable function IDs */
enum keyfuncid {
KF_BAR_TOGGLE,
{ "layout", setlayout, 0 },
};
-
int
conf_load(char *filename, int keymapping)
{
update_window(win);
}
-
/* Select which X events to monitor and set border pixel color. */
wa[0] = win->s->c[SWM_S_COLOR_UNFOCUS].pixel;
wa[1] = XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_PROPERTY_CHANGE |
focus_flush();
return;
} else if (e->state == XCB_PROPERTY_NEW_VALUE) {
+ win->ws->focus_pending = get_focus_prev(win);
unfocus_win(win);
unmap_window(win);
if (win->ws->r) {
- focus_win(get_focus_prev(win));
stack();
+ focus_win(win->ws->focus_pending);
+ win->ws->focus_pending = NULL;
focus_flush();
}
}
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();