From: Dana Jansens Date: Sat, 26 May 2007 21:03:48 +0000 (+0000) Subject: oops was saving tthe options in the wrong place. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=5d9b0596016f2b72cc8851a20c6e21b331f91a2a;p=chaz%2Fopenbox oops was saving tthe options in the wrong place. save the panels/dockwindows/desktopwindows/alldesktops options when focus cycling starts --- diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 81557fe3..4e231b03 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -31,7 +31,10 @@ #include #include -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; } diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index c00ee840..e282465e 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -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 */