示例#1
0
void
update_panels(void)
{
	PANEL *p;

	/*
	 * For each panel tell panels above it they need to refresh
	 * regions that overlap (are above) this panel.  This ensures
	 * that even if a panel below was touched, it's still
	 * overwritten by a panel above.
	 *
	 * Note that we also need to do this during "destructive"
	 * operations (hide, move, replace window - which see).
	 */
	FOREACH_PANEL (p) {
		PANEL *above = p;
		while ((above = PANEL_ABOVE(above)) != NULL) {
			touchoverlap(p->win, above->win);
		}
	}

	/*
	 * This is what effects Z-order: the window updated later
	 * overwrites contents of the windows below (before) it.
	 */
	FOREACH_PANEL (p) {
		wnoutrefresh(p->win);
	}
}
示例#2
0
int
move_panel(PANEL *p, int y, int x)
{
	int oldy, oldx;

	if (__predict_false(p == NULL))
		return ERR;

	getbegyx(p->win, oldy, oldx);
	if (__predict_false(y == oldy && x == oldx))
		return OK;

	if (!PANEL_HIDDEN(p)) {
		PANEL *other;

		/* touch exposed areas at the old location now */
		FOREACH_PANEL (other) {
			if (other != p) {
				touchoverlap(p->win, other->win);
			}
		}
	}