void config_init(void) { if(get_conf(W->confpath) == -1) { warnl("parsing configuration file (%s) failed.", W->confpath); sprintf(W->confpath, "%s/"CONFIG_DEFAULT_PATH, getenv("HOME")); if(get_conf(W->confpath) == -1) { warnxl("parsing default configuration file (%s) failed.", W->confpath); sprintf(W->confpath, "%s/wmfs/wmfsrc", XDG_CONFIG_DIR); if(get_conf(W->confpath) == -1) errxl(1, "parsing system configuration file (%s) failed.", W->confpath); } } config_theme(); config_keybind(); config_tag(); config_client(); config_bars(); config_rule(); config_launcher(); free_conf(); }
static void handle_map_request(xcb_map_request_event_t *e) { xcb_get_window_attributes_reply_t *reply; struct client_t *c; struct workspace_t *ws; NIL_LOG("event: map request win=%d", e->window); reply = xcb_get_window_attributes_reply(nil_.con, xcb_get_window_attributes_unchecked(nil_.con, e->window), 0); if (!reply) { NIL_ERR("no reply %d", e->window); return; } if (reply->override_redirect) { NIL_ERR("override_redirect %d", e->window); free(reply); return; } free(reply); c = find_client(e->window, &ws); if (!c) { NIL_ERR("no client %d", e->window); return; } init_client(c); NIL_SET_FLAG(c->flags, CLIENT_DISPLAY); if (!NIL_HAS_FLAG(c->flags, CLIENT_FLOAT)) { /* only rearrange if it's not float */ arrange_ws(ws); } if (check_client_size(c)) { /* fix window size if needed */ update_client_geom(c); } config_client(c); if (ws == &nil_.ws[nil_.ws_idx]) { xcb_map_window(nil_.con, c->win); xcb_set_input_focus(nil_.con, XCB_INPUT_FOCUS_POINTER_ROOT, c->win, XCB_CURRENT_TIME); } xcb_flush(nil_.con); }