summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-10-19 12:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2016-10-19 12:01:11 +0100
commit28a31201d3d75502e70ff97d03e129a92c3f82ae (patch)
treeb772df443166456fcd81269b65dc7a63366bca4d /session.c
parent4c6eb6cc2f415544d81608109058690d88bd9db7 (diff)
parent99c262b7d0a2f41497327e8f5caefde802178346 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/session.c b/session.c
index 05f4d79f..d89bc6a0 100644
--- a/session.c
+++ b/session.c
@@ -336,6 +336,7 @@ session_new(struct session *s, const char *name, int argc, char **argv,
xasprintf(cause, "index in use: %d", idx);
return (NULL);
}
+ wl->session = s;
env = environ_create();
environ_copy(global_environ, env);
@@ -372,6 +373,7 @@ session_attach(struct session *s, struct window *w, int idx, char **cause)
xasprintf(cause, "index in use: %d", idx);
return (NULL);
}
+ wl->session = s;
winlink_set_window(wl, w);
notify_session_window("window-linked", s, w);
@@ -408,8 +410,8 @@ session_has(struct session *s, struct window *w)
{
struct winlink *wl;
- RB_FOREACH(wl, winlinks, &s->windows) {
- if (wl->window == w)
+ TAILQ_FOREACH(wl, &w->winlinks, wentry) {
+ if (wl->session == s)
return (1);
}
return (0);
@@ -678,6 +680,7 @@ session_group_synchronize1(struct session *target, struct session *s)
/* Link all the windows from the target. */
RB_FOREACH(wl, winlinks, ww) {
wl2 = winlink_add(&s->windows, wl->idx);
+ wl2->session = s;
winlink_set_window(wl2, wl->window);
notify_session_window("window-linked", s, wl2->window);
wl2->flags |= wl->flags & WINLINK_ALERTFLAGS;
@@ -728,6 +731,7 @@ session_renumber_windows(struct session *s)
/* Go through the winlinks and assign new indexes. */
RB_FOREACH(wl, winlinks, &old_wins) {
wl_new = winlink_add(&s->windows, new_idx);
+ wl_new->session = s;
winlink_set_window(wl_new, wl->window);
wl_new->flags |= wl->flags & WINLINK_ALERTFLAGS;