oops was saving tthe options in the wrong place.

save the panels/dockwindows/desktopwindows/alldesktops options when focus cycling starts
This commit is contained in:
Dana Jansens 2007-05-26 21:03:48 +00:00
parent c090f63011
commit 5d9b059601
2 changed files with 48 additions and 34 deletions

View file

@ -32,6 +32,9 @@
#include <glib.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 void focus_cycle_destroy_notify (ObClient *client, gpointer data);
static gboolean focus_target_has_siblings (ObClient *ft, static gboolean focus_target_has_siblings (ObClient *ft,
@ -186,7 +189,14 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
goto done_cycle; goto done_cycle;
list = client_list; 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); start = it = g_list_find(list, focus_cycle_target);
if (!start) /* switched desktops or something? */ if (!start) /* switched desktops or something? */
@ -203,8 +213,9 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
} }
ft = it->data; ft = it->data;
if (focus_cycle_target_valid(ft, TRUE, if (focus_cycle_target_valid(ft, TRUE,
all_desktops, dock_windows, focus_cycle_all_desktops,
desktop_windows)) focus_cycle_dock_windows,
focus_cycle_desktop_windows))
{ {
if (interactive) { if (interactive) {
if (ft != focus_cycle_target) { /* prevents flicker */ if (ft != focus_cycle_target) { /* prevents flicker */
@ -214,8 +225,9 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
if (dialog) if (dialog)
/* same arguments as focus_target_valid */ /* same arguments as focus_target_valid */
focus_cycle_popup_show(ft, TRUE, focus_cycle_popup_show(ft, TRUE,
all_desktops, dock_windows, focus_cycle_all_desktops,
desktop_windows); focus_cycle_dock_windows,
focus_cycle_desktop_windows);
return; return;
} else if (ft != focus_cycle_target) { } else if (ft != focus_cycle_target) {
focus_cycle_target = ft; focus_cycle_target = ft;
@ -356,8 +368,14 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
if (!focus_order) if (!focus_order)
goto done_cycle; 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 (!first) first = focus_client;
if (!focus_cycle_target) focus_cycle_target = focus_client;
if (focus_cycle_target) if (focus_cycle_target)
ft = focus_find_directional(focus_cycle_target, dir, dock_windows, ft = focus_find_directional(focus_cycle_target, dir, dock_windows,
@ -366,8 +384,9 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
GList *it; GList *it;
for (it = focus_order; it; it = g_list_next(it)) for (it = focus_order; it; it = g_list_next(it))
if (focus_cycle_target_valid(it->data, FALSE, FALSE, dock_windows, if (focus_cycle_target_valid(it->data, FALSE, FALSE,
desktop_windows)) focus_cycle_dock_windows,
focus_cycle_desktop_windows))
ft = it->data; ft = it->data;
} }
@ -380,8 +399,9 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
if (focus_cycle_target && dialog) { if (focus_cycle_target && dialog) {
/* same arguments as focus_target_valid */ /* same arguments as focus_target_valid */
focus_cycle_popup_single_show(focus_cycle_target, focus_cycle_popup_single_show(focus_cycle_target,
FALSE, FALSE, dock_windows, FALSE, FALSE,
desktop_windows); focus_cycle_dock_windows,
focus_cycle_desktop_windows);
return; return;
} }

View file

@ -74,14 +74,13 @@ static ObFocusCyclePopup popup;
/*! This popup shows a single window */ /*! This popup shows a single window */
static ObIconPopup *single_popup; 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 gchar *popup_get_name (ObClient *c);
static void popup_setup (ObFocusCyclePopup *p, 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, static void popup_render (ObFocusCyclePopup *p,
const ObClient *c); const ObClient *c);
@ -156,7 +155,9 @@ void focus_cycle_popup_shutdown(gboolean reconfig)
RrAppearanceFree(popup.a_bg); 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; gint maxwidth, n;
GList *it; GList *it;
@ -174,10 +175,10 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets)
ObClient *ft = it->data; ObClient *ft = it->data;
if (focus_cycle_target_valid(ft, if (focus_cycle_target_valid(ft,
cycle_iconic_windows, iconic_windows,
cycle_all_desktops, all_desktops,
cycle_dock_windows, dock_windows,
cycle_desktop_windows)) desktop_windows))
{ {
gchar *text = popup_get_name(ft); gchar *text = popup_get_name(ft);
@ -444,13 +445,9 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
g_assert(c != NULL); g_assert(c != NULL);
/* do this stuff only when the dialog is first showing */ /* do this stuff only when the dialog is first showing */
if (!popup.mapped) { if (!popup.mapped)
cycle_iconic_windows = iconic_windows; popup_setup(&popup, TRUE, iconic_windows, all_desktops,
cycle_all_desktops = all_desktops; dock_windows, desktop_windows);
cycle_dock_windows = dock_windows;
cycle_desktop_windows = desktop_windows;
popup_setup(&popup, TRUE);
}
g_assert(popup.targets != NULL); g_assert(popup.targets != NULL);
popup_render(&popup, c); popup_render(&popup, c);
@ -502,11 +499,8 @@ void focus_cycle_popup_single_show(struct _ObClient *c,
if (!popup.mapped) { if (!popup.mapped) {
Rect *a; Rect *a;
cycle_iconic_windows = iconic_windows; popup_setup(&popup, FALSE, iconic_windows, all_desktops,
cycle_all_desktops = all_desktops; dock_windows, desktop_windows);
cycle_dock_windows = dock_windows;
cycle_desktop_windows = desktop_windows;
popup_setup(&popup, FALSE);
g_assert(popup.targets == NULL); g_assert(popup.targets == NULL);
/* position the popup */ /* position the popup */