Exemple #1
0
/*
 * v_dtoh --
 *	Move all but the current screen to the hidden queue.
 */
static void
v_dtoh(SCR *sp)
{
	GS *gp;
	SCR *tsp;
	int hidden;

	/* Move all screens to the hidden queue, tossing screen maps. */
	for (hidden = 0, gp = sp->gp;
	    (tsp = TAILQ_FIRST(gp->dq)) != NULL; ++hidden) {
		if (_HMAP(tsp) != NULL) {
			free(_HMAP(tsp));
			_HMAP(tsp) = NULL;
		}
		TAILQ_REMOVE(gp->dq, tsp, q);
		TAILQ_INSERT_TAIL(gp->hq, tsp, q);
		/* XXXX Change if hidden screens per window */
		gp->scr_discard(tsp, NULL);
	}

	/* Move current screen back to the display queue. */
	TAILQ_REMOVE(gp->hq, sp, q);
	TAILQ_INSERT_TAIL(gp->dq, sp, q);

	if (hidden > 1)
		msgq(sp, M_INFO,
		    "319|%d screens backgrounded; use :display to list them",
		    hidden - 1);
}
Exemple #2
0
/*
 * v_dtoh --
 *	Move all but the current screen to the hidden queue.
 */
static void
v_dtoh(SCR *sp)
{
	GS *gp;
	SCR *tsp;
	WIN *wp;
	int hidden;

	/* Move all screens to the hidden queue, tossing screen maps. */
	for (hidden = 0, gp = sp->gp, wp = sp->wp;
	    (tsp = wp->scrq.cqh_first) != (void *)&wp->scrq; ++hidden) {
		if (_HMAP(tsp) != NULL) {
			free(_HMAP(tsp));
			_HMAP(tsp) = NULL;
		}
		CIRCLEQ_REMOVE(&wp->scrq, tsp, q);
		CIRCLEQ_INSERT_TAIL(&gp->hq, tsp, q);
		/* XXXX Change if hidden screens per window */
		tsp->wp = 0;
		gp->scr_discard(tsp, NULL);
	}

	/* Move current screen back to the display queue. */
	CIRCLEQ_REMOVE(&gp->hq, sp, q);
	CIRCLEQ_INSERT_TAIL(&wp->scrq, sp, q);
	sp->wp = wp;

	if (hidden > 1)
		msgq(sp, M_INFO,
		    "319|%d screens backgrounded; use :display to list them",
		    hidden - 1);
}