return;
}
+#ifdef USE_XCOMPOSITE
+ if (extensions_comp) {
+ /* Redirect window contents to offscreen pixmaps */
+ XCompositeRedirectSubwindows(ob_display,
+ RootWindow(ob_display, ob_screen),
+ CompositeRedirectAutomatic);
+ }
+#endif
+
/* get the initial size */
screen_resize();
{
guint old;
gulong *viewport;
- GList *it;
+ GList *it, *stacking_copy;
g_assert(num > 0);
/* the number of rows/columns will differ */
screen_update_layout();
- /* move windows on desktops that will no longer exist! */
- 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);
+ /* move windows on desktops that will no longer exist!
+ make a copy of the list cuz we're changing it */
+ stacking_copy = g_list_copy(stacking_list);
+ for (it = g_list_last(stacking_copy); it; it = g_list_previous(it)) {
+ if (WINDOW_IS_CLIENT(it->data)) {
+ ObClient *c = it->data;
+ if (c->desktop != DESKTOP_ALL && c->desktop >= num)
+ client_set_desktop(c, num - 1, FALSE, TRUE);
+ /* raise all the windows that are on the current desktop which
+ is being merged */
+ else if (screen_desktop == num - 1 &&
+ (c->desktop == DESKTOP_ALL ||
+ c->desktop == screen_desktop))
+ stacking_raise(WINDOW_AS_CLIENT(c));
+ }
}
/* change our struts/area to match (after moving windows) */
ignore_start = event_start_ignore_all_enters();
if (moveresize_client)
- client_set_desktop(moveresize_client, num, TRUE);
+ client_set_desktop(moveresize_client, num, TRUE, FALSE);
/* show windows before hiding the rest to lessen the enter/leave events */
allow_omni = focus_client && (client_normal(focus_client) &&
focus_client->desktop == DESKTOP_ALL);
+ /* the client moved there already so don't move focus. prevent flicker
+ on sendtodesktop + follow */
+ if (focus_client && focus_client->desktop == screen_desktop)
+ dofocus = FALSE;
+
/* have to try focus here because when you leave an empty desktop
there is no focus out to watch for. also, we have different rules
here. we always allow it to look under the mouse pointer if
dims, 4 * screen_num_desktops * screen_num_monitors);
/* the area has changed, adjust all the windows if they need it */
- for (it = client_list; it; it = g_list_next(it)) {
- gint x, y, w, h, lw, lh;
- ObClient *client = it->data;
-
- RECT_TO_DIMS(client->area, x, y, w, h);
- client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
- if (!RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
- gulong ignore_start;
-
- ignore_start = event_start_ignore_all_enters();
- client_configure(client, x, y, w, h, FALSE, TRUE);
- event_end_ignore_all_enters(ignore_start);
- }
- }
+ for (it = client_list; it; it = g_list_next(it))
+ client_reconfigure(it->data, FALSE);
g_free(dims);
}
for (it = struts_left; it; it = g_slist_next(it)) {
ObScreenStrut *s = it->data;
- if (s->desktop == d &&
+ if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
STRUT_LEFT_IN_SEARCH(s->strut, search) &&
!STRUT_LEFT_IGNORE(s->strut, us, search))
l = MAX(l, al + s->strut->left);
}
for (it = struts_top; it; it = g_slist_next(it)) {
ObScreenStrut *s = it->data;
- if (s->desktop == d &&
+ if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
STRUT_TOP_IN_SEARCH(s->strut, search) &&
!STRUT_TOP_IGNORE(s->strut, us, search))
t = MAX(t, at + s->strut->top);
}
for (it = struts_right; it; it = g_slist_next(it)) {
ObScreenStrut *s = it->data;
- if (s->desktop == d &&
+ if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
STRUT_RIGHT_IN_SEARCH(s->strut, search) &&
!STRUT_RIGHT_IGNORE(s->strut, us, search))
r = MIN(r, ar - s->strut->right);
}
for (it = struts_bottom; it; it = g_slist_next(it)) {
ObScreenStrut *s = it->data;
- if (s->desktop == d &&
+ if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
STRUT_BOTTOM_IN_SEARCH(s->strut, search) &&
!STRUT_BOTTOM_IGNORE(s->strut, us, search))
b = MIN(b, ab - s->strut->bottom);