printf("configure_req: %lx - (0x%lx) %dx%d @ %d,%d\n",
cre->window, cre->value_mask,
cre->height, cre->width, cre->x, cre->y);
- if ((win = win_find(dpy,xe->xconfigurerequest.window,1))) {
+ if ((win = win_find(dpy,cre->window,1))) {
XSendEvent(dpy, cre->window, False, StructureNotifyMask, &(XEvent){
.xconfigure.type = ConfigureNotify,
.xconfigure.display = win->sys->dpy,
.width = screen->w + screen->sys->strut.left + screen->sys->strut.right,
.height = screen->h + screen->sys->strut.top + screen->sys->strut.bottom
};
+ win->x = wc.x; win->y = wc.y;
+ win->w = wc.width; win->h = wc.height;
XConfigureWindow(win->sys->dpy, win->sys->xid, CWX|CWY|CWWidth|CWHeight, &wc);
XMoveResizeWindow(win->sys->dpy, win->sys->xid, wc.x, wc.y, wc.width, wc.height);
} else if (state == ST_SHADE) {
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 && !flt && next == ST_SHOW)
+ return wm_insert(win), 1;
+ if ((row || flt) && next == ST_HIDE)
+ return wm_remove(win), 1;
+
if (row) row->state = next;
if (flt) flt->state = next;
return wm_update();
/* Initialize window */
- win->wm = new0(win_wm_t);
sys_watch(win, EV_ENTER, MOD());
sys_watch(win, EV_FOCUS, MOD());
return wm_update();
for (list_t *tag = wm->tags; tag; tag = tag->next)
cut_win(win, tag->data);
- free(win->wm);
set_focus(wm_focus);
wm_update();
print_txt();
while (dpy->cols) { col_t *col = dpy->cols->data;
while (col->rows) { row_t *row = col->rows->data;
sys_show(row->win, ST_SHOW);
- free(row->win->wm);
col->rows = list_remove(col->rows, col->rows, 1); }
dpy->cols = list_remove(dpy->cols, dpy->cols, 1); }
while (dpy->flts) { flt_t *flt = dpy->flts->data;
sys_show(flt->win, ST_SHOW);
- free(flt->win->wm);
dpy->flts = list_remove(dpy->flts, dpy->flts, 1); }
tag->dpys = list_remove(tag->dpys, tag->dpys, 1); }
wm->tags = list_remove( wm->tags, wm->tags, 1); }