/* show windows before hiding the rest to lessen the enter/leave events */
/* show windows from 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 *c = it->data;
- if (!c->frame->visible && client_should_show(c))
+ if (client_should_show(c))
frame_show(c->frame);
}
}
/* hide windows from 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 *c = it->data;
if (c->frame->visible && !client_should_show(c))
event_ignore_queued_enters();
- focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
+ focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS);
+ if (focus_hilite) {
+ frame_adjust_focus(focus_hilite->frame, TRUE);
+
+ /*!
+ When this focus_client check is not used, you can end up with races,
+ as demonstrated with gnome-panel, sometmies the window you click on
+ another desktop ends up losing focus cuz of the focus change here.
+ */
+ /*if (!focus_client)*/
+ client_focus(focus_hilite);
+ }
}
static void get_row_col(guint d, guint *r, guint *c)
return 0;
}
-static void popup_cycle(guint d, gboolean show)
+void screen_desktop_popup(guint d, gboolean show)
{
Rect *a;
}
if (dialog) {
- popup_cycle(d, TRUE);
+ screen_desktop_popup(d, TRUE);
return d;
}
done_cycle:
first = TRUE;
- popup_cycle(0, FALSE);
+ screen_desktop_popup(0, FALSE);
return d;
}
XWindowAttributes wa;
if (client == NULL) {
- if (install)
- XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
- else
- XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
+ if (install)
+ XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
+ else
+ XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst));
} else {
if (XGetWindowAttributes(ob_display, client->window, &wa) &&
wa.colormap != None) {