X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=wm-wmii.c;h=f5158f56215b758b6246e72b4e58fb39412924f4;hb=15b46c3f2fe15422ca4023edcbb15b09ea46a49a;hp=1cc43afc8c5286bec2f4f882454b8d9137d72819;hpb=6e8fb5fe1c8a0a75b698fc25bb8c54bc105179ee;p=wmpus diff --git a/wm-wmii.c b/wm-wmii.c index 1cc43af..f5158f5 100644 --- a/wm-wmii.c +++ b/wm-wmii.c @@ -124,6 +124,9 @@ static ptr_t move_prev; static layer_t move_layer; static struct { int v, h; } move_dir; +/* Prototypes */ +void wm_update(void); + /******************** * Helper functions * ********************/ @@ -274,7 +277,7 @@ static void print_txt(void) for (list_t *lrow = col->rows; lrow; lrow = lrow->next) { row_t *row = lrow->data; win_t *win = row->win; - printf(" win: <%-9p [%p>>%p] >%-9p focus=%d%d - %4dpx \n", + printf(" row: <%-9p [%p>>%p] >%-9p focus=%d%d - %4dpx \n", lrow->prev, lrow, win, lrow->next, col->row == row, wm_focus == win, win->h); } } @@ -679,9 +682,7 @@ static void wm_update_cols(dpy_t *dpy) } } -/******************************* - * Window management functions * - *******************************/ +/* Refresh the window layout */ void wm_update(void) { /* Updates window sizes */ @@ -708,6 +709,9 @@ void wm_update(void) set_focus(wm_focus); } +/******************************* + * Window management functions * + *******************************/ int wm_handle_event(win_t *win, event_t ev, mod_t mod, ptr_t ptr) { if (!win || win == wm_dpy->geom) return 0; @@ -868,6 +872,7 @@ int wm_handle_state(win_t *win, state_t prev, state_t next) row_t *row = NULL; flt_t *flt = NULL; + printf("wm_handle_state - %p %x -> %x\n", win, prev, next); search(wm_tag, win, NULL, NULL, &row, &flt); if (row) row->state = next; @@ -885,6 +890,10 @@ void wm_insert(win_t *win) printf("wm_insert: %p\n", win); print_txt(); + /* Check for toolbars */ + if (win->type == TYPE_TOOLBAR) + return wm_update(); + /* Initialize window */ win->wm = new0(win_wm_t); sys_watch(win, EV_ENTER, MOD()); @@ -905,6 +914,8 @@ void wm_remove(win_t *win) { printf("wm_remove: %p\n", win); print_txt(); + if (win->type == TYPE_TOOLBAR) + return wm_update(); for (list_t *tag = wm->tags; tag; tag = tag->next) cut_win(win, tag->data); free(win->wm);