Lines Matching refs:wl

203 	struct winlink	*wl;  in session_destroy()  local
225 wl = RB_ROOT(&s->windows); in session_destroy()
226 notify_session_window("window-unlinked", s, wl->window); in session_destroy()
227 winlink_remove(&s->windows, wl); in session_destroy()
338 struct winlink *wl; in session_attach() local
340 if ((wl = winlink_add(&s->windows, idx)) == NULL) { in session_attach()
344 wl->session = s; in session_attach()
345 winlink_set_window(wl, w); in session_attach()
349 return (wl); in session_attach()
354 session_detach(struct session *s, struct winlink *wl) in session_detach() argument
356 if (s->curw == wl && in session_detach()
361 wl->flags &= ~WINLINK_ALERTFLAGS; in session_detach()
362 notify_session_window("window-unlinked", s, wl->window); in session_detach()
363 winlink_stack_remove(&s->lastw, wl); in session_detach()
364 winlink_remove(&s->windows, wl); in session_detach()
377 struct winlink *wl; in session_has() local
379 TAILQ_FOREACH(wl, &w->winlinks, wentry) { in session_has()
380 if (wl->session == s) in session_has()
401 session_next_alert(struct winlink *wl) in session_next_alert() argument
403 while (wl != NULL) { in session_next_alert()
404 if (wl->flags & WINLINK_ALERTFLAGS) in session_next_alert()
406 wl = winlink_next(wl); in session_next_alert()
408 return (wl); in session_next_alert()
415 struct winlink *wl; in session_next() local
420 wl = winlink_next(s->curw); in session_next()
422 wl = session_next_alert(wl); in session_next()
423 if (wl == NULL) { in session_next()
424 wl = RB_MIN(winlinks, &s->windows); in session_next()
425 if (alert && ((wl = session_next_alert(wl)) == NULL)) in session_next()
428 return (session_set_current(s, wl)); in session_next()
432 session_previous_alert(struct winlink *wl) in session_previous_alert() argument
434 while (wl != NULL) { in session_previous_alert()
435 if (wl->flags & WINLINK_ALERTFLAGS) in session_previous_alert()
437 wl = winlink_previous(wl); in session_previous_alert()
439 return (wl); in session_previous_alert()
446 struct winlink *wl; in session_previous() local
451 wl = winlink_previous(s->curw); in session_previous()
453 wl = session_previous_alert(wl); in session_previous()
454 if (wl == NULL) { in session_previous()
455 wl = RB_MAX(winlinks, &s->windows); in session_previous()
456 if (alert && (wl = session_previous_alert(wl)) == NULL) in session_previous()
459 return (session_set_current(s, wl)); in session_previous()
466 struct winlink *wl; in session_select() local
468 wl = winlink_find_by_index(&s->windows, idx); in session_select()
469 return (session_set_current(s, wl)); in session_select()
476 struct winlink *wl; in session_last() local
478 wl = TAILQ_FIRST(&s->lastw); in session_last()
479 if (wl == NULL) in session_last()
481 if (wl == s->curw) in session_last()
484 return (session_set_current(s, wl)); in session_last()
489 session_set_current(struct session *s, struct winlink *wl) in session_set_current() argument
493 if (wl == NULL) in session_set_current()
495 if (wl == s->curw) in session_set_current()
498 winlink_stack_remove(&s->lastw, wl); in session_set_current()
500 s->curw = wl; in session_set_current()
504 window_update_focus(wl->window); in session_set_current()
506 winlink_clear_flags(wl); in session_set_current()
507 window_update_activity(wl->window); in session_set_current()
508 tty_update_window_offset(wl->window); in session_set_current()
651 struct winlink *wl, *wl2; in session_group_synchronize1() local
669 RB_FOREACH(wl, winlinks, ww) { in session_group_synchronize1()
670 wl2 = winlink_add(&s->windows, wl->idx); in session_group_synchronize1()
672 winlink_set_window(wl2, wl->window); in session_group_synchronize1()
674 wl2->flags |= wl->flags & WINLINK_ALERTFLAGS; in session_group_synchronize1()
686 TAILQ_FOREACH(wl, &old_lastw, sentry) { in session_group_synchronize1()
687 wl2 = winlink_find_by_index(&s->windows, wl->idx); in session_group_synchronize1()
696 wl = RB_ROOT(&old_windows); in session_group_synchronize1()
697 wl2 = winlink_find_by_window_id(&s->windows, wl->window->id); in session_group_synchronize1()
699 notify_session_window("window-unlinked", s, wl->window); in session_group_synchronize1()
700 winlink_remove(&old_windows, wl); in session_group_synchronize1()
708 struct winlink *wl, *wl1, *wl_new; in session_renumber_windows() local
722 RB_FOREACH(wl, winlinks, &old_wins) { in session_renumber_windows()
725 winlink_set_window(wl_new, wl->window); in session_renumber_windows()
726 wl_new->flags |= wl->flags & WINLINK_ALERTFLAGS; in session_renumber_windows()
728 if (wl == marked_pane.wl) in session_renumber_windows()
730 if (wl == s->curw) in session_renumber_windows()
739 TAILQ_FOREACH(wl, &old_lastw, sentry) { in session_renumber_windows()
740 wl->flags &= ~WINLINK_VISITED; in session_renumber_windows()
741 wl_new = winlink_find_by_window(&s->windows, wl->window); in session_renumber_windows()
750 marked_pane.wl = winlink_find_by_index(&s->windows, marked_idx); in session_renumber_windows()
751 if (marked_pane.wl == NULL) in session_renumber_windows()
757 RB_FOREACH_SAFE(wl, winlinks, &old_wins, wl1) in session_renumber_windows()
758 winlink_remove(&old_wins, wl); in session_renumber_windows()