#include <X11/Xlib.h>
#include <glib.h>
-ObClient *focus_cycle_target = NULL;
+ObClient *focus_cycle_target = NULL;
+static gboolean focus_cycle_all_desktops;
+static gboolean focus_cycle_dock_windows;
+static gboolean focus_cycle_desktop_windows;
static void focus_cycle_destroy_notify (ObClient *client, gpointer data);
static gboolean focus_target_has_siblings (ObClient *ft,
goto done_cycle;
list = client_list;
}
- if (!focus_cycle_target) focus_cycle_target = focus_client;
+
+
+ if (focus_cycle_target == NULL) {
+ focus_cycle_all_desktops = FALSE;
+ focus_cycle_dock_windows = dock_windows;
+ focus_cycle_desktop_windows = desktop_windows;
+ focus_cycle_target = focus_client;
+ }
start = it = g_list_find(list, focus_cycle_target);
if (!start) /* switched desktops or something? */
}
ft = it->data;
if (focus_cycle_target_valid(ft, TRUE,
- all_desktops, dock_windows,
- desktop_windows))
+ focus_cycle_all_desktops,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows))
{
if (interactive) {
if (ft != focus_cycle_target) { /* prevents flicker */
if (dialog)
/* same arguments as focus_target_valid */
focus_cycle_popup_show(ft, TRUE,
- all_desktops, dock_windows,
- desktop_windows);
+ focus_cycle_all_desktops,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows);
return;
} else if (ft != focus_cycle_target) {
focus_cycle_target = ft;
if (!focus_order)
goto done_cycle;
+ if (focus_cycle_target == NULL) {
+ focus_cycle_all_desktops = FALSE;
+ focus_cycle_dock_windows = dock_windows;
+ focus_cycle_desktop_windows = desktop_windows;
+ focus_cycle_target = focus_client;
+ }
+
if (!first) first = focus_client;
- if (!focus_cycle_target) focus_cycle_target = focus_client;
if (focus_cycle_target)
ft = focus_find_directional(focus_cycle_target, dir, dock_windows,
GList *it;
for (it = focus_order; it; it = g_list_next(it))
- if (focus_cycle_target_valid(it->data, FALSE, FALSE, dock_windows,
- desktop_windows))
+ if (focus_cycle_target_valid(it->data, FALSE, FALSE,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows))
ft = it->data;
}
if (focus_cycle_target && dialog) {
/* same arguments as focus_target_valid */
focus_cycle_popup_single_show(focus_cycle_target,
- FALSE, FALSE, dock_windows,
- desktop_windows);
+ FALSE, FALSE,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows);
return;
}
/*! This popup shows a single window */
static ObIconPopup *single_popup;
-static gboolean cycle_iconic_windows;
-static gboolean cycle_all_desktops;
-static gboolean cycle_dock_windows;
-static gboolean cycle_desktop_windows;
-
static gchar *popup_get_name (ObClient *c);
static void popup_setup (ObFocusCyclePopup *p,
- gboolean create_targets);
+ gboolean create_targets,
+ gboolean iconic_windows,
+ gboolean all_desktops,
+ gboolean dock_windows,
+ gboolean desktop_windows);
static void popup_render (ObFocusCyclePopup *p,
const ObClient *c);
RrAppearanceFree(popup.a_bg);
}
-static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets)
+static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
+ gboolean iconic_windows, gboolean all_desktops,
+ gboolean dock_windows, gboolean desktop_windows)
{
gint maxwidth, n;
GList *it;
ObClient *ft = it->data;
if (focus_cycle_target_valid(ft,
- cycle_iconic_windows,
- cycle_all_desktops,
- cycle_dock_windows,
- cycle_desktop_windows))
+ iconic_windows,
+ all_desktops,
+ dock_windows,
+ desktop_windows))
{
gchar *text = popup_get_name(ft);
g_assert(c != NULL);
/* do this stuff only when the dialog is first showing */
- if (!popup.mapped) {
- cycle_iconic_windows = iconic_windows;
- cycle_all_desktops = all_desktops;
- cycle_dock_windows = dock_windows;
- cycle_desktop_windows = desktop_windows;
- popup_setup(&popup, TRUE);
- }
+ if (!popup.mapped)
+ popup_setup(&popup, TRUE, iconic_windows, all_desktops,
+ dock_windows, desktop_windows);
g_assert(popup.targets != NULL);
popup_render(&popup, c);
if (!popup.mapped) {
Rect *a;
- cycle_iconic_windows = iconic_windows;
- cycle_all_desktops = all_desktops;
- cycle_dock_windows = dock_windows;
- cycle_desktop_windows = desktop_windows;
- popup_setup(&popup, FALSE);
+ popup_setup(&popup, FALSE, iconic_windows, all_desktops,
+ dock_windows, desktop_windows);
g_assert(popup.targets == NULL);
/* position the popup */