if (size > 0) {
windows = g_new(Window, size);
win_it = windows;
- for (it = client_list; it != NULL; it = it->next, ++win_it)
+ for (it = client_list; it; it = g_list_next(it), ++win_it)
*win_it = ((ObClient*)it->data)->window;
} else
windows = NULL;
{
GSList *it;
- for (it = self->transients; it; it = it->next) {
+ for (it = self->transients; it; it = g_slist_next(it)) {
if (!func(it->data, data)) return;
client_foreach_transient(it->data, func, data);
}
} else {
GSList *it;
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
if (it->data != self &&
!((ObClient*)it->data)->transient_for) {
if (!func(it->data, data)) return;
if (self->group) {
GSList *it;
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
{
if (client_focused(it->data))
{
if (self->transient_for == OB_TRAN_GROUP) { /* transient of group */
GSList *it;
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
if (it->data != self)
((ObClient*)it->data)->transients =
g_slist_remove(((ObClient*)it->data)->transients, self);
}
/* tell our transients that we're gone */
- for (it = self->transients; it != NULL; it = it->next) {
+ for (it = self->transients; it; it = g_slist_next(it)) {
if (((ObClient*)it->data)->transient_for != OB_TRAN_GROUP) {
((ObClient*)it->data)->transient_for = NULL;
client_calc_layer(it->data);
} else {
GSList *it;
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
if (it->data != self &&
!((ObClient*)it->data)->transient_for) {
self->desktop = ((ObClient*)it->data)->desktop;
/* remove from the old group if there was one */
if (self->group != NULL) {
/* remove transients of the group */
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
self->transients = g_slist_remove(self->transients,
it->data);
/* remove myself from parents in the group */
if (self->transient_for == OB_TRAN_GROUP) {
- for (it = self->group->members; it; it = it->next) {
+ for (it = self->group->members; it;
+ it = g_slist_next(it))
+ {
ObClient *c = it->data;
if (c != self && !c->transient_for)
if (!self->transient_for) {
/* add other transients of the group that are already
set up */
- for (it = self->group->members; it; it = it->next) {
+ for (it = self->group->members; it;
+ it = g_slist_next(it))
+ {
ObClient *c = it->data;
if (c != self && c->transient_for == OB_TRAN_GROUP)
self->transients =
/* look for duplicates and append a number */
nums = 0;
- for (it = client_list; it; it = it->next)
+ for (it = client_list; it; it = g_list_next(it))
if (it->data != self) {
ObClient *c = it->data;
if (0 == strncmp(c->title, data, strlen(data)))
GSList *it;
ObClient *ret;
- for (it = self->transients; it != NULL; it = it->next) {
+ for (it = self->transients; it; it = g_slist_next(it)) {
if (client_focused(it->data)) return it->data;
if ((ret = client_search_focus_tree(it->data))) return ret;
}
GSList *it;
gboolean recursed = FALSE;
- for (it = self->group->members; it; it = it->next)
+ for (it = self->group->members; it; it = g_slist_next(it))
if (!((ObClient*)it->data)->transient_for) {
ObClient *c;
if ((c = client_search_focus_tree_full(it->data)))
own = calc_layer(self);
self->layer = l > own ? l : own;
- for (it = self->transients; it; it = it->next)
+ for (it = self->transients; it; it = g_slist_next(it))
client_calc_layer_recursive(it->data, orig,
l, raised ? raised : l != old);
}
/* iconify all transients */
- for (it = self->transients; it != NULL; it = it->next)
+ for (it = self->transients; it; it = g_slist_next(it))
if (it->data != self) client_iconify_recursive(it->data,
iconic, curdesk);
}
}
/* move all transients */
- for (it = self->transients; it != NULL; it = it->next)
+ for (it = self->transients; it; it = g_slist_next(it))
if (it->data != self) client_set_desktop_recursive(it->data,
target, donthide);
}
GSList *it;
ObClient *ret;
- for (it = self->transients; it != NULL; it = it->next) {
+ for (it = self->transients; it; it = g_slist_next(it)) {
ObClient *c = it->data;
if ((ret = client_search_modal_child(c))) return ret;
if (c->modal) return c;
best_score = -1;
best_client = NULL;
- for(it = g_list_first(client_list); it; it = it->next) {
+ for(it = g_list_first(client_list); it; it = g_list_next(it)) {
cur = it->data;
/* the currently selected window isn't interesting */
g_assert(self->group);
- for (it = self->group->members; it; it = it->next) {
+ for (it = self->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data;
/* checking transient_for prevents infinate loops! */
} else {
GSList *it;
- for (it = self->group->members; it; it = it->next) {
+ for (it = self->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data;
/* checking transient_for prevents infinate loops! */
} else {
GSList *it;
- for (it = self->group->members; it; it = it->next) {
+ for (it = self->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data;
/* checking transient_for prevents infinate loops! */
/* default: top of screen */
dest = a->y;
- for(it = g_list_first(client_list); it; it = it->next) {
+ for(it = client_list; it; it = g_list_next(it)) {
gint his_edge_start, his_edge_end, his_offset;
ObClient *cur = it->data;
/* default: bottom of screen */
dest = a->y + a->height;
- for(it = g_list_first(client_list); it; it = it->next) {
+ for(it = client_list; it; it = g_list_next(it)) {
gint his_edge_start, his_edge_end, his_offset;
ObClient *cur = it->data;
/* default: leftmost egde of screen */
dest = a->x;
- for(it = g_list_first(client_list); it; it = it->next) {
+ for(it = client_list; it; it = g_list_next(it)) {
gint his_edge_start, his_edge_end, his_offset;
ObClient *cur = it->data;
/* default: rightmost edge of screen */
dest = a->x + a->width;
- for(it = g_list_first(client_list); it; it = it->next) {
+ for(it = client_list; it; it = g_list_next(it)) {
gint his_edge_start, his_edge_end, his_offset;
ObClient *cur = it->data;
ObClient *ret = NULL;
if (screen_pointer_pos(&x, &y)) {
- for (it = stacking_list; it != NULL; it = it->next) {
+ for (it = stacking_list; it; it = g_list_next(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = WINDOW_AS_CLIENT(it->data);
if (c->frame->visible &&
dock->w = dock->h = 0;
/* get the size */
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
ObDockApp *app = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
spot = (config_dock_orient == OB_ORIENTATION_HORZ ? minw : minh) / 2;
/* position the apps */
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
ObDockApp *app = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
/* which dock app are we on top of? */
stop = FALSE;
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
over = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
GSList *it;
ObClient *ret;
- for (it = c->transients; it; it = it->next) {
+ for (it = c->transients; it; it = g_slist_next(it)) {
if (it->data == top) return NULL;
ret = find_transient_recursive(it->data, top, skip);
if (ret && ret != skip && client_normal(ret)) return ret;
/* try for transient relations */
if (trans) {
if (old->transient_for == OB_TRAN_GROUP) {
- for (it = focus_order[screen_desktop]; it; it = it->next) {
+ for (it = focus_order[screen_desktop]; it;
+ it = g_list_next(it))
+ {
GSList *sit;
- for (sit = old->group->members; sit; sit = sit->next)
+ for (sit = old->group->members; sit;
+ sit = g_slist_next(sit))
+ {
if (sit->data == it->data)
if ((target =
focus_fallback_transient(sit->data, old)))
return target;
+ }
}
} else {
if ((target =
if (old->group) {
GSList *sit;
- for (it = focus_order[screen_desktop]; it != NULL; it = it->next)
- for (sit = old->group->members; sit; sit = sit->next)
+ for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
+ for (sit = old->group->members; sit; sit = g_slist_next(sit))
if (sit->data == it->data)
if (sit->data != old && client_normal(sit->data))
if (client_can_focus(sit->data))
}
#endif
- for (it = focus_order[screen_desktop]; it != NULL; it = it->next)
+ for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
if (type != OB_FOCUS_FALLBACK_UNFOCUSING || it->data != old)
if (client_normal(it->data) && client_can_focus(it->data))
return it->data;
/* insert before first iconic window */
for (it = focus_order[d];
- it && !((ObClient*)it->data)->iconic; it = it->next);
+ it && !((ObClient*)it->data)->iconic; it = g_list_next(it));
focus_order[d] = g_list_insert_before(focus_order[d], it, c);
}
}
/* insert before first iconic window */
for (it = focus_order[d];
- it && !((ObClient*)it->data)->iconic; it = it->next);
+ it && !((ObClient*)it->data)->iconic; it = g_list_next(it));
g_list_insert_before(focus_order[d], it, c);
}
}
if (g_list_length(keylist) <= 0)
return NULL; /* nothing in the list.. */
- for (it = g_list_last(keylist); it != NULL; it = it->prev) {
+ for (it = g_list_last(keylist); it; it = g_list_previous(it)) {
p = ret;
ret = g_new0(KeyBindingTree, 1);
if (p == NULL) {
/* this is the first built node, the bottom node of the tree */
ret->keylist = g_list_copy(keylist); /* shallow copy */
- for (it = ret->keylist; it != NULL; it = it->next) /* deep copy */
+ for (it = ret->keylist; it; it = g_list_next(it)) /* deep copy */
it->data = g_strdup(it->data);
}
ret->first_child = p;
GSList *it;
for (i = 0; i < OB_FRAME_NUM_CONTEXTS; ++i)
- for (it = bound_contexts[i]; it != NULL; it = g_slist_next(it)) {
+ for (it = bound_contexts[i]; it; it = g_slist_next(it)) {
/* grab/ungrab the button */
ObMouseBinding *b = it->data;
Window win;
{
GList *it;
- for (it = client_list; it != NULL; it = it->next)
+ for (it = client_list; it; it = g_list_next(it))
mouse_grab_for_client(it->data, grab);
}
GSList *it;
for(i = 0; i < OB_FRAME_NUM_CONTEXTS; ++i) {
- for (it = bound_contexts[i]; it != NULL; it = it->next) {
+ for (it = bound_contexts[i]; it; it = g_slist_next(it)) {
ObMouseBinding *b = it->data;
gint j;
for (j = 0; j < OB_NUM_MOUSE_ACTIONS; ++j) {
GSList *it;
- for (it = b->actions[j]; it; it = it->next)
+ for (it = b->actions[j]; it; it = g_slist_next(it))
action_unref(it->data);
g_slist_free(b->actions[j]);
}
GSList *it;
ObMouseBinding *b;
- for (it = bound_contexts[context]; it != NULL; it = it->next) {
+ for (it = bound_contexts[context]; it; it = g_slist_next(it)) {
b = it->data;
if (b->state == state && b->button == button)
break;
return FALSE;
}
- for (it = bound_contexts[context]; it != NULL; it = it->next){
+ for (it = bound_contexts[context]; it; it = g_slist_next(it)) {
b = it->data;
if (b->state == state && b->button == button) {
b->actions[mact] = g_slist_append(b->actions[mact], action);
GSList *it;
gboolean first = TRUE;
gint l, r, t, b;
- for (it = client->group->members; it; it = it->next) {
+ for (it = client->group->members; it; it = g_slist_next(it)) {
ObClient *m = it->data;
if (!(m == client || m->transient_for)) {
if (first) {
cb = RECT_BOTTOM(c->frame->area);
if (config_resist_win)
- for (it = stacking_list; it != NULL; it = it->next) {
+ for (it = stacking_list; it; it = g_list_next(it)) {
ObClient *target;
gint tl, tt, tr, tb; /* 1 past the target's edges on each side */
b = RECT_BOTTOM(c->frame->area);
if (config_resist_win) {
- for (it = stacking_list; it != NULL; it = it->next) {
+ for (it = stacking_list; it; it = g_list_next(it)) {
if (!WINDOW_IS_CLIENT(it->data))
continue;
target = it->data;
/* set the names */
screen_desktop_names = g_new(gchar*,
g_slist_length(config_desktops_names) + 1);
- for (i = 0, it = config_desktops_names; it; ++i, it = it->next)
+ for (i = 0, it = config_desktops_names; it; ++i, it = g_slist_next(it))
screen_desktop_names[i] = it->data; /* dont strdup */
screen_desktop_names[i] = NULL;
PROP_SETSS(RootWindow(ob_display, ob_screen),
screen_update_areas();
dock_configure();
- for (it = client_list; it; it = it->next)
+ for (it = client_list; it; it = g_list_next(it))
client_move_onscreen(it->data, FALSE);
}
screen_update_desktop_names();
/* move windows on desktops that will no longer exist! */
- for (it = client_list; it != NULL; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
if (c->desktop >= num && c->desktop != DESKTOP_ALL)
client_set_desktop(c, num - 1, FALSE);
if (show) {
/* bottom to top */
- for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
+ for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
if (client->frame->visible && !client_should_show(client))
}
} else {
/* top to bottom */
- for (it = stacking_list; it != NULL; it = it->next) {
+ for (it = stacking_list; it; it = g_list_next(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
if (!client->frame->visible && client_should_show(client))
if (show) {
/* focus desktop */
- for (it = focus_order[screen_desktop]; it; it = it->next)
+ for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP &&
client_focus(it->data))
break;
o = MIN(o, area[i][x].x);
for (x = 0; x < screen_num_monitors; ++x) {
- for (it = client_list; it; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
screen_area_add_strut_left(&c->strut,
&monitor_area[x],
o = MIN(o, area[i][x].y);
for (x = 0; x < screen_num_monitors; ++x) {
- for (it = client_list; it; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
screen_area_add_strut_top(&c->strut,
&monitor_area[x],
o = MAX(o, area[i][x].x + area[i][x].width - 1);
for (x = 0; x < screen_num_monitors; ++x) {
- for (it = client_list; it; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
screen_area_add_strut_right(&c->strut,
&monitor_area[x],
o = MAX(o, area[i][x].y + area[i][x].height - 1);
for (x = 0; x < screen_num_monitors; ++x) {
- for (it = client_list; it; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
screen_area_add_strut_bottom(&c->strut,
&monitor_area[x],
/* the area has changed, adjust all the maximized
windows */
- for (it = client_list; it; it = it->next) {
+ for (it = client_list; it; it = g_list_next(it)) {
ObClient *c = it->data;
if (i < screen_num_desktops) {
if (c->desktop == i)
GList *it;
if (client->group)
- for (it = stacking_list; !parent && it; it = it->next) {
+ for (it = stacking_list; !parent && it; it = g_list_next(it)) {
if ((sit = g_slist_find(client->group->members, it->data)))
for (sit = client->group->members; !parent && sit;
- sit = sit->next) {
+ sit = g_slist_next(sit))
+ {
ObClient *c = sit->data;
/* checking transient_for prevents infinate loops! */
if (sit->data == it->data && !c->transient_for)