Adds an <interactive>bool</interactive> option to the NextWindow and
PreviousWindow actions. When it is false, the action is not interactive and will
immediately switch focus to whatever the next focus target is.
Removing the "interactive" flag from the focus_cycle() method, as it was unused
previously, and the new code does not make use of it either. In order to be
non-interactive it simply starts a focus_cycle then immediately ends it when the
action ends.
The "interactive" flag in focus_cycle() forced a linear cycling order which may
not be what you want, so the new method is preferrable anyhow.
gboolean forward;
gboolean bar;
gboolean raise;
gboolean forward;
gboolean bar;
gboolean raise;
ObFocusCyclePopupMode dialog_mode;
GSList *actions;
ObFocusCyclePopupMode dialog_mode;
GSList *actions;
o = g_slice_new0(Options);
o->bar = TRUE;
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
o = g_slice_new0(Options);
o->bar = TRUE;
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_LIST;
if ((n = obt_xml_find_node(node, "linear")))
o->linear = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "linear")))
o->linear = obt_xml_node_bool(n);
else if (obt_xml_node_contains(n, "icons"))
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_ICONS;
}
else if (obt_xml_node_contains(n, "icons"))
o->dialog_mode = OB_FOCUS_CYCLE_POPUP_MODE_ICONS;
}
+ if ((n = obt_xml_find_node(node, "interactive")))
+ o->interactive = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "bar")))
o->bar = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "raise")))
if ((n = obt_xml_find_node(node, "bar")))
o->bar = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "raise")))
Options *o = options;
struct _ObClient *ft;
Options *o = options;
struct _ObClient *ft;
- ft = focus_cycle(o->forward,
- o->all_desktops,
- !o->only_hilite_windows,
- o->dock_windows,
- o->desktop_windows,
- o->linear,
- TRUE,
- o->bar,
- o->dialog_mode,
- FALSE, FALSE);
+ gboolean done = FALSE;
+ gboolean cancel = FALSE;
+
+ ft = focus_cycle(
+ o->forward,
+ o->all_desktops,
+ !o->only_hilite_windows,
+ o->dock_windows,
+ o->desktop_windows,
+ o->linear,
+ (o->interactive ? o->bar : FALSE),
+ (o->interactive ? o->dialog_mode : OB_FOCUS_CYCLE_POPUP_MODE_NONE),
+ done, cancel);
stacking_restore();
if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft));
stacking_restore();
if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft));
}
static gboolean i_input_func(guint initial_state,
}
static gboolean i_input_func(guint initial_state,
Options *o = options;
struct _ObClient *ft;
Options *o = options;
struct _ObClient *ft;
+ gboolean done = TRUE;
+
ft = focus_cycle(o->forward,
o->all_desktops,
!o->only_hilite_windows,
o->dock_windows,
o->desktop_windows,
o->linear,
ft = focus_cycle(o->forward,
o->all_desktops,
!o->only_hilite_windows,
o->dock_windows,
o->desktop_windows,
o->linear,
if (ft)
actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
if (ft)
actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY,
focus_cycle_update_indicator(focus_cycle_target);
if (!focus_cycle_target)
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
focus_cycle_update_indicator(focus_cycle_target);
if (!focus_cycle_target)
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
- TRUE, TRUE, OB_FOCUS_CYCLE_POPUP_MODE_NONE,
+ TRUE, OB_FOCUS_CYCLE_POPUP_MODE_NONE,
ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
gboolean nonhilite_windows,
gboolean dock_windows, gboolean desktop_windows,
ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
gboolean nonhilite_windows,
gboolean dock_windows, gboolean desktop_windows,
- gboolean linear, gboolean interactive,
- gboolean showbar, ObFocusCyclePopupMode mode,
+ gboolean linear, gboolean showbar,
+ ObFocusCyclePopupMode mode,
gboolean done, gboolean cancel)
{
static GList *order = NULL;
gboolean done, gboolean cancel)
{
static GList *order = NULL;
ObClient *ft = NULL;
ObClient *ret = NULL;
ObClient *ft = NULL;
ObClient *ret = NULL;
- if (interactive) {
- if (cancel) {
- focus_cycle_target = NULL;
- goto done_cycle;
- } else if (done)
- goto done_cycle;
+ if (cancel) {
+ focus_cycle_target = NULL;
+ goto done_cycle;
+ } else if (done)
+ goto done_cycle;
- if (!focus_order)
- goto done_cycle;
+ if (!focus_order)
+ goto done_cycle;
- if (linear) list = client_list;
- else list = focus_order;
- } else {
- if (!focus_order)
- goto done_cycle;
- list = client_list;
- }
+ if (linear) list = client_list;
+ else list = focus_order;
if (focus_cycle_target == NULL) {
focus_cycle_linear = linear;
if (focus_cycle_target == NULL) {
focus_cycle_linear = linear;
}
ft = it->data;
if (focus_cycle_valid(ft)) {
}
ft = it->data;
if (focus_cycle_valid(ft)) {
- if (interactive) {
- if (ft != focus_cycle_target) { /* prevents flicker */
- focus_cycle_target = ft;
- focus_cycle_type = OB_CYCLE_NORMAL;
- focus_cycle_draw_indicator(showbar ? ft : NULL);
- }
- /* same arguments as focus_target_valid */
- focus_cycle_popup_show(ft, mode, focus_cycle_linear);
- return focus_cycle_target;
- } else if (ft != focus_cycle_target) {
+ if (ft != focus_cycle_target) { /* prevents flicker */
focus_cycle_target = ft;
focus_cycle_type = OB_CYCLE_NORMAL;
focus_cycle_target = ft;
focus_cycle_type = OB_CYCLE_NORMAL;
+ focus_cycle_draw_indicator(showbar ? ft : NULL);
+ /* same arguments as focus_target_valid */
+ focus_cycle_popup_show(ft, mode, focus_cycle_linear);
+ return focus_cycle_target;
g_list_free(order);
order = NULL;
g_list_free(order);
order = NULL;
- if (interactive) {
- focus_cycle_draw_indicator(NULL);
- focus_cycle_popup_hide();
- }
+ focus_cycle_draw_indicator(NULL);
+ focus_cycle_popup_hide();
struct _ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
gboolean nonhilite_windows,
gboolean dock_windows, gboolean desktop_windows,
struct _ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
gboolean nonhilite_windows,
gboolean dock_windows, gboolean desktop_windows,
- gboolean linear, gboolean interactive,
- gboolean showbar, ObFocusCyclePopupMode mode,
+ gboolean linear, gboolean showbar,
+ ObFocusCyclePopupMode mode,
gboolean done, gboolean cancel);
struct _ObClient* focus_directional_cycle(ObDirection dir,
gboolean dock_windows,
gboolean done, gboolean cancel);
struct _ObClient* focus_directional_cycle(ObDirection dir,
gboolean dock_windows,