opaque NextWindow patch
Jared Yanovich
phirerunner at comcast.net
Tue Dec 19 12:00:22 EST 2006
This patch enables an <opaque> boolean option in rc.xml for use in
the NextWindow action for drawing the actual windows when cycling
instead of just the indicators.
Index: data/rc.xsd
===================================================================
--- data/rc.xsd (revision 5500)
+++ data/rc.xsd (working copy)
@@ -167,6 +167,7 @@
<xs:element minOccurs="0" name="here" type="ob:bool"/>
<xs:element minOccurs="0" name="linear" type="ob:bool"/>
<xs:element minOccurs="0" name="group" type="ob:bool"/>
+ <xs:element minOccurs="0" name="opaque" type="ob:bool"/>
</xs:sequence>
<xs:attribute name="name" type="ob:actionname" use="required"/>
</xs:complexType>
Index: openbox/action.c
===================================================================
--- openbox/action.c (revision 5500)
+++ openbox/action.c (working copy)
@@ -293,6 +293,7 @@ void setup_action_cycle_windows_next(ObA
(*a)->data.cycle.linear = FALSE;
(*a)->data.cycle.forward = TRUE;
(*a)->data.cycle.dialog = TRUE;
+ (*a)->data.cycle.opaque = FALSE;
}
void setup_action_cycle_windows_previous(ObAction **a, ObUserAction uact)
@@ -301,6 +302,7 @@ void setup_action_cycle_windows_previous
(*a)->data.cycle.linear = FALSE;
(*a)->data.cycle.forward = FALSE;
(*a)->data.cycle.dialog = TRUE;
+ (*a)->data.cycle.opaque = FALSE;
}
void setup_action_movefromedge_north(ObAction **a, ObUserAction uact)
@@ -986,6 +988,8 @@ ObAction *action_parse(ObParseInst *i, x
act->data.cycle.linear = parse_bool(doc, n);
if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
act->data.cycle.dialog = parse_bool(doc, n);
+ if ((n = parse_find_node("opaque", node->xmlChildrenNode)))
+ act->data.cycle.opaque = parse_bool(doc, n);
} else if (act->func == action_directional_focus) {
if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
act->data.cycle.dialog = parse_bool(doc, n);
@@ -1580,7 +1584,8 @@ void action_cycle_windows(union ActionDa
focus_cycle(data->cycle.forward, data->cycle.linear, data->any.interactive,
data->cycle.dialog,
- data->cycle.inter.final, data->cycle.inter.cancel);
+ data->cycle.inter.final, data->cycle.inter.cancel,
+ data->cycle.opaque);
}
void action_directional_focus(union ActionData *data)
Index: openbox/action.h
===================================================================
--- openbox/action.h (revision 5500)
+++ openbox/action.h (working copy)
@@ -137,6 +137,7 @@ struct CycleWindows {
gboolean linear;
gboolean forward;
gboolean dialog;
+ gboolean opaque;
};
struct Stacking {
Index: openbox/focus.c
===================================================================
--- openbox/focus.c (revision 5500)
+++ openbox/focus.c (working copy)
@@ -58,7 +58,7 @@ static void focus_cycle_destructor(ObCli
{
/* end cycling if the target disappears */
if (focus_cycle_target == client)
- focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+ focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE);
}
static Window createWindow(Window parent, gulong mask,
@@ -192,7 +192,7 @@ void focus_set_client(ObClient *client)
/* in the middle of cycling..? kill it. */
if (focus_cycle_target)
- focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+ focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE);
old = focus_client;
focus_client = client;
@@ -542,7 +542,8 @@ static gboolean valid_focus_target(ObCli
}
void focus_cycle(gboolean forward, gboolean linear, gboolean interactive,
- gboolean dialog, gboolean done, gboolean cancel)
+ gboolean dialog, gboolean done, gboolean cancel,
+ gboolean opaque)
{
static ObClient *first = NULL;
static ObClient *t = NULL;
@@ -589,7 +590,10 @@ void focus_cycle(gboolean forward, gbool
if (interactive) {
if (ft != focus_cycle_target) { /* prevents flicker */
focus_cycle_target = ft;
- focus_cycle_draw_indicator();
+ if (opaque)
+ client_raise(focus_cycle_target);
+ else
+ focus_cycle_draw_indicator();
}
popup_cycle(ft, dialog);
return;
@@ -612,7 +616,8 @@ done_cycle:
order = NULL;
if (interactive) {
- focus_cycle_draw_indicator();
+ if (!opaque)
+ focus_cycle_draw_indicator();
popup_cycle(ft, FALSE);
}
Index: openbox/focus.h
===================================================================
--- openbox/focus.h (revision 5500)
+++ openbox/focus.h (working copy)
@@ -60,7 +60,8 @@ void focus_fallback(ObFocusFallbackType
/*! Cycle focus amongst windows. */
void focus_cycle(gboolean forward, gboolean linear, gboolean interactive,
- gboolean dialog, gboolean done, gboolean cancel);
+ gboolean dialog, gboolean done, gboolean cancel,
+ gboolean opaque);
void focus_directional_cycle(ObDirection dir, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel);
void focus_cycle_draw_indicator();
More information about the openbox
mailing list