all repos — openbox @ ea371936cec5f1e7f0eaed698b2cff6fab42f210

openbox fork - make it a bit more like ryudo

let you raise the focus target temporarily during focus cycling, with the <raise> option.  also a new <bar> option lets you turn off the indicator bar
Dana Jansens danakj@orodu.net
commit

ea371936cec5f1e7f0eaed698b2cff6fab42f210

parent

746015e88c51dda43b26f35abc25050c502d319b

M openbox/actions/cyclewindows.copenbox/actions/cyclewindows.c

@@ -1,4 +1,6 @@

#include "openbox/actions.h" +#include "openbox/stacking.h" +#include "openbox/window.h" #include "openbox/event.h" #include "openbox/focus_cycle.h" #include "openbox/openbox.h"

@@ -11,6 +13,8 @@ gboolean dock_windows;

gboolean desktop_windows; gboolean all_desktops; gboolean forward; + gboolean bar; + gboolean raise; GSList *actions; } Options;

@@ -46,11 +50,16 @@ Options *o;

o = g_new0(Options, 1); o->dialog = TRUE; + o->bar = TRUE; if ((n = parse_find_node("linear", node))) o->linear = parse_bool(doc, n); if ((n = parse_find_node("dialog", node))) o->dialog = parse_bool(doc, n); + if ((n = parse_find_node("bar", node))) + o->bar = parse_bool(doc, n); + if ((n = parse_find_node("raise", node))) + o->raise = parse_bool(doc, n); if ((n = parse_find_node("panels", node))) o->dock_windows = parse_bool(doc, n); if ((n = parse_find_node("desktop", node)))

@@ -111,16 +120,21 @@

static gboolean run_func(ObActionsData *data, gpointer options) { Options *o = options; + struct _ObClient *ft; - focus_cycle(o->forward, - o->all_desktops, - o->dock_windows, - o->desktop_windows, - o->linear, - TRUE, - o->dialog, - FALSE, FALSE); + ft = focus_cycle(o->forward, + o->all_desktops, + o->dock_windows, + o->desktop_windows, + o->linear, + TRUE, + o->bar, + o->dialog, + FALSE, FALSE); cycling = TRUE; + + stacking_restore(); + if (o->raise) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); return TRUE; }

@@ -174,6 +188,7 @@ o->dock_windows,

o->desktop_windows, o->linear, TRUE, + o->bar, o->dialog, TRUE, cancel); cycling = FALSE;

@@ -181,4 +196,6 @@

if (ft) actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY, state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft); + + stacking_restore(); }
M openbox/actions/directionalwindows.copenbox/actions/directionalwindows.c

@@ -1,5 +1,7 @@

#include "openbox/actions.h" #include "openbox/event.h" +#include "openbox/stacking.h" +#include "openbox/window.h" #include "openbox/focus_cycle.h" #include "openbox/openbox.h" #include "openbox/misc.h"

@@ -11,6 +13,8 @@ gboolean dialog;

gboolean dock_windows; gboolean desktop_windows; ObDirection direction; + gboolean bar; + gboolean raise; GSList *actions; } Options;

@@ -46,9 +50,14 @@ Options *o;

o = g_new0(Options, 1); o->dialog = TRUE; + o->bar = TRUE; if ((n = parse_find_node("dialog", node))) o->dialog = parse_bool(doc, n); + if ((n = parse_find_node("bar", node))) + o->bar = parse_bool(doc, n); + if ((n = parse_find_node("raise", node))) + o->raise = parse_bool(doc, n); if ((n = parse_find_node("panels", node))) o->dock_windows = parse_bool(doc, n); if ((n = parse_find_node("desktop", node)))

@@ -135,13 +144,19 @@

if (!o->interactive) end_cycle(FALSE, data->state, o); else { - focus_directional_cycle(o->direction, - o->dock_windows, - o->desktop_windows, - TRUE, - o->dialog, - FALSE, FALSE); + struct _ObClient *ft; + + ft = focus_directional_cycle(o->direction, + o->dock_windows, + o->desktop_windows, + TRUE, + o->bar, + o->dialog, + FALSE, FALSE); cycling = TRUE; + + stacking_restore(); + if (o->raise) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); } return o->interactive;

@@ -194,12 +209,14 @@ ft = focus_directional_cycle(o->direction,

o->dock_windows, o->desktop_windows, o->interactive, + o->bar, o->dialog, TRUE, cancel); cycling = FALSE; - if (ft) { + if (ft) actions_run_acts(o->actions, OB_USER_ACTION_KEYBOARD_KEY, state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, ft); - } + + stacking_restore(); }
M openbox/focus_cycle.copenbox/focus_cycle.c

@@ -62,15 +62,16 @@ focus_cycle_all_desktops,

focus_cycle_dock_windows, focus_cycle_desktop_windows)) { - focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); - focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); + focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE); + focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); } } ObClient* focus_cycle(gboolean forward, gboolean all_desktops, gboolean dock_windows, gboolean desktop_windows, gboolean linear, gboolean interactive, - gboolean dialog, gboolean done, gboolean cancel) + gboolean showbar, gboolean dialog, + gboolean done, gboolean cancel) { static ObClient *t = NULL; static GList *order = NULL;

@@ -128,7 +129,7 @@ {

if (interactive) { if (ft != focus_cycle_target) { /* prevents flicker */ focus_cycle_target = ft; - focus_cycle_draw_indicator(ft); + focus_cycle_draw_indicator(showbar ? ft : NULL); } if (dialog) /* same arguments as focus_target_valid */

@@ -261,7 +262,7 @@

ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, gboolean desktop_windows, gboolean interactive, - gboolean dialog, + gboolean showbar, gboolean dialog, gboolean done, gboolean cancel) { static ObClient *first = NULL;

@@ -307,7 +308,7 @@ if (ft && ft != focus_cycle_target) {/* prevents flicker */

focus_cycle_target = ft; if (!interactive) goto done_cycle; - focus_cycle_draw_indicator(ft); + focus_cycle_draw_indicator(showbar ? ft : NULL); } if (focus_cycle_target && dialog) /* same arguments as focus_target_valid */
M openbox/focus_cycle.hopenbox/focus_cycle.h

@@ -37,11 +37,13 @@ /*! Cycle focus amongst windows. */

struct _ObClient* focus_cycle(gboolean forward, gboolean all_desktops, gboolean dock_windows, gboolean desktop_windows, gboolean linear, gboolean interactive, - gboolean dialog, gboolean done, gboolean cancel); + gboolean showbar, gboolean dialog, + gboolean done, gboolean cancel); struct _ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, gboolean desktop_windows, gboolean interactive, + gboolean showbar, gboolean dialog, gboolean done, gboolean cancel);
M openbox/focus_cycle_indicator.copenbox/focus_cycle_indicator.c

@@ -39,6 +39,7 @@ } focus_indicator;

static RrAppearance *a_focus_indicator; static RrColor *color_white; +static gboolean visible; static Window create_window(Window parent, gulong mask, XSetWindowAttributes *attrib)

@@ -52,6 +53,8 @@

void focus_cycle_indicator_startup(gboolean reconfig) { XSetWindowAttributes attr; + + visible = FALSE; if (reconfig) return;

@@ -118,7 +121,7 @@ }

void focus_cycle_draw_indicator(ObClient *c) { - if (!c) { + if (!c && visible) { gulong ignore_start; /* kill enter events cause by this unmapping */

@@ -130,7 +133,10 @@ XUnmapWindow(ob_display, focus_indicator.right.win);

XUnmapWindow(ob_display, focus_indicator.bottom.win); event_end_ignore_all_enters(ignore_start); - } else { + + visible = FALSE; + } + else if (c) { /* if (c) frame_adjust_focus(c->frame, FALSE);

@@ -249,5 +255,7 @@ XMapWindow(ob_display, focus_indicator.top.win);

XMapWindow(ob_display, focus_indicator.left.win); XMapWindow(ob_display, focus_indicator.right.win); XMapWindow(ob_display, focus_indicator.bottom.win); + + visible = TRUE; } }