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

@ -31,7 +31,10 @@
#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,
@ -186,7 +189,14 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
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? */
@ -203,8 +213,9 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
}
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 */
@ -214,8 +225,9 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
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;
@ -356,8 +368,14 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
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,
@ -366,8 +384,9 @@ void focus_directional_cycle(ObDirection dir, gboolean 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;
}
@ -380,8 +399,9 @@ void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
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;
}

View file

@ -74,14 +74,13 @@ static ObFocusCyclePopup popup;
/*! 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);
@ -156,7 +155,9 @@ void focus_cycle_popup_shutdown(gboolean reconfig)
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;
@ -174,10 +175,10 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets)
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);
@ -444,13 +445,9 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
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);
@ -502,11 +499,8 @@ void focus_cycle_popup_single_show(struct _ObClient *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 */