diff options
Diffstat (limited to 'schewm.c')
-rw-r--r-- | schewm.c | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -22,6 +22,7 @@ const uint16_t MOVE_GLYPH = 52; const uint16_t RESIZE_GLYPH = 120; // Key modifiers +const uint16_t MOD_ALT = XCB_MOD_MASK_1; const uint16_t MOD_META = XCB_MOD_MASK_4; const uint16_t MOD_SHIFT = XCB_MOD_MASK_SHIFT; @@ -717,7 +718,7 @@ windows_query(xcb_window_t root, struct WindowsQueryReply *reply) { } void -windows_query_reply_free(struct WindowsQueryReply *reply) { +windows_query_reply_wipe(struct WindowsQueryReply *reply) { if (reply->length > 0) { free(reply->data); } @@ -1370,7 +1371,7 @@ dpy_set_window_border_width(xcb_window_t window) { static void dpy_draw_borders(struct Client *client, bool is_focused) { - if (client->state != WS_NORMAL || client->should_ignore_borders) { + if (client->state == WS_ICONIFIED || client->should_ignore_borders) { return; } @@ -1663,12 +1664,14 @@ dpy_update_window_list(const struct ClientsMap *clients) { xcb_window_t *windows = NULL; size_t num_windows = 0; if (clients->size != 0) { + fprintf(stderr, "window_list:\n"); windows = malloc(clients->size * sizeof(xcb_window_t)); for (size_t i = 0; i < clients->num_buckets; i++) { for (struct ClientList *list = clients->buckets[i]; list != NULL; list = list->next) { windows[num_windows++] = list->client->id; + fprintf(stderr, "\twindow: %x\n", list->client->id); } } } @@ -1949,8 +1952,8 @@ wm_set_client_state(struct Client *client, enum WindowState state) { wm_client_monitor_size(client, true, &mon_rect); client->x = mon_rect.x; client->y = mon_rect.y; - client->width = mon_rect.width; - client->height = mon_rect.height; + client->width = mon_rect.width - cfg.inner_border_width * 2; + client->height = mon_rect.height - cfg.inner_border_width * 2; } dpy_update_window_geometry(client); break; @@ -2227,9 +2230,16 @@ manage_client_maybe_reposition(xcb_window_t window, bool set_position) { } wm_update_client_monitor(client); clients_map_add(wm.clients, client); - if (client->state == WS_NORMAL) { + if (client->state == WS_NORMAL || client->state == WS_MAXIMIZED) { dpy_draw_unfocused_borders(client); } + /* + * Unmap everything we grab initially because they may be + * mapped currently, but belong to another workspace; this + * way, we can map again only the correct windows at the + * wm_set_workspace() call below. + */ + dpy_unmap_window(window); return client; } @@ -2277,22 +2287,16 @@ wm_init() { * Could not be managed, just map it on screen because we * probably should not own it. */ + fprintf(stderr, "wm_init(): could not manage: %x\n", window); dpy_map_window(window); } else { - /* - * Unmap everything we grab initially because they may be - * mapped currently, but belong to another workspace; this - * way, we can map again only the correct windows at the - * wm_set_workspace() call below. - */ - dpy_unmap_window(window); } } - windows_query_reply_free(&reply); + windows_query_reply_wipe(&reply); dpy_update_window_list(wm.clients); wm_set_workspace(wm.cur_workspace); - wm.mod_key = MOD_META; + wm.mod_key = MOD_ALT; dpy_flush(); memset(wm.events, 0, sizeof(wm.events)); @@ -2736,7 +2740,6 @@ wm_run() { break; } - fprintf(stderr, "ev: %u\n", ev_type(ev)); EventHandler handler = wm.events[ev_type(ev)]; if (handler) { handler(ev); @@ -2830,7 +2833,7 @@ ev_configure_request(xcb_generic_event_t *generic_ev) { wm_update_client_monitor(client); // TODO: do we need this? - // dpy_draw_borders(client, wm.focus->id == client->id); + dpy_draw_borders(client, wm.focus == client); } } |