if (!sc) break;
w = screen_find_window(sc, dev->window);
vis = window_is_mapped(w);
- sc->window_hide(w);
+ if (vis)
+ sc->window_hide(w);
screen_remove_window(sc, w);
if (vis) screen_refresh(sc);
break;
if (rev->parent == sc->super.root)
screen_add_window(sc, rev->window);
else {
- sc->window_hide(w);
+ if (window_is_mapped(w))
+ sc->window_hide(w);
screen_remove_window(sc, w);
}
screen_refresh(w->sc);
cev = (xcb_configure_notify_event_t*)ev;
sc = display_screen_from_root(dpy, cev->event);
if (!sc) break;
+ //printf("configure 0x%x", cev->window);
w = screen_find_window(sc, cev->window);
window_get_area(w, &x, &y, &width, &height, &bwidth);
if (x != cev->x || y != cev->y || width != cev->width ||
window_configure(w, cev->x, cev->y,
cev->width, cev->height,
cev->border_width);
- if (window_is_mapped(w) &&
- (width != cev->width ||
- height != cev->height || bwidth != cev->border_width))
- sc->window_resize(w);
+ if (window_is_mapped(w)) {
+ if (x != cev->x || y != cev->y)
+ sc->window_move(w);
+ if (width != cev->width ||
+ height != cev->height || bwidth != cev->border_width)
+ sc->window_resize(w);
+ }
}
above = screen_find_window(sc, cev->above_sibling);
screen_stacking_move_above(sc, w, above);
d_screen_t *sc = sc_it->data;
d_list_it_t *it;
for (it = list_bottom(sc->stacking); it; it = it->prev)
- if (window_is_mapped(it->data))
+ if (window_is_mapped(it->data)) {
+ /* make the window think it is unmapped so that the
+ show works right */
+ window_fake_unmapped(it->data);
sc->window_show(it->data);
+ }
}
}
d_window_priv_t *w = (d_window_priv_t*)pubw;
window_is_mapped(pubw); /* kill any ongoing request */
+ assert(!w->mapped);
//printf("show window 0x%x\n", w->id);
d_window_priv_t *w = (d_window_priv_t*)pubw;
window_is_mapped(pubw); /* kill any ongoing request */
+ assert(w->mapped);
//printf("hide window 0x%x\n", w->id);
}
void
+window_fake_unmapped(d_window_t *pubw)
+{
+ d_window_priv_t *w = (d_window_priv_t*)pubw;
+
+ w->mapped = FALSE;
+}
+
+void
window_become_zombie(d_window_t *pubw)
{
d_window_priv_t *w = (d_window_priv_t*)pubw;
w->input_only = rep->_class == XCB_WINDOW_CLASS_INPUT_ONLY;
w->mapped = rep->map_state != XCB_MAP_STATE_UNMAPPED;
w->visual = rep->visual;
+ //printf("0x%x attributes mapped %d\n", w->id, w->mapped);
free(rep);
}
else {
printf("error getting attributes for window 0x%x\n", w->id);
free(err);
}
- w->waiting_attr = 0;
+ w->waiting_attr = FALSE;
}
static void
printf("error getting geometry for window 0x%x\n", w->id);
free(err);
}
- w->waiting_geom = 0;
+ w->waiting_geom = FALSE;
}
gboolean