all repos — openbox @ dd7c6ad734e88e6f2ad053f090bd5b04c5692fb4

openbox fork - make it a bit more like ryudo

add back the focusLast option for the "i lost count"th time
Mikael Magnusson mikachu@comhem.se
commit

dd7c6ad734e88e6f2ad053f090bd5b04c5692fb4

parent

a5451fa6fa9b18c4125c832ab64be7f4357e7ba8

5 files changed, 14 insertions(+), 4 deletions(-)

jump to
M data/rc.xml.indata/rc.xml.in

@@ -16,6 +16,7 @@

<focus> <focusNew>yes</focusNew> <followMouse>no</followMouse> + <focusLast>no</focusLast> <focusDelay>0</focusDelay> <raiseOnFocus>no</raiseOnFocus> </focus>

@@ -31,6 +32,7 @@ </placement>

<desktops> <number>4</number> + <firstdesk>1</firstdesk> <names> <name>one</name> <name>two</name>
M data/rc.xsddata/rc.xsd

@@ -71,6 +71,7 @@ <xs:documentation>defines aspects of window focus</xs:documentation>

</xs:annotation> <xs:sequence> <xs:element name="focusNew" type="ob:yesorno"/> + <xs:element name="focusLast" type="ob:yesorno"/> <xs:element name="followMouse" type="ob:yesorno"/> <xs:element name="focusDelay" type="xs:integer"/> <xs:element name="raiseOnFocus" type="ob:yesorno"/>

@@ -100,6 +101,7 @@ <xs:element maxOccurs="unbounded" name="name" type="xs:string"/>

</xs:sequence> </xs:complexType> </xs:element> + <xs:element name="firstdesk" type="xs:integer"/> </xs:sequence> </xs:complexType> <xs:complexType name="resize">
M openbox/config.copenbox/config.c

@@ -28,6 +28,7 @@ gboolean config_focus_new;

gboolean config_focus_follow; guint config_focus_delay; gboolean config_focus_raise; +gboolean config_focus_last; ObPlacePolicy config_place_policy;

@@ -205,6 +206,8 @@ if ((n = parse_find_node("focusDelay", node)))

config_focus_delay = parse_int(doc, n) * 1000; if ((n = parse_find_node("raiseOnFocus", node))) config_focus_raise = parse_bool(doc, n); + if ((n = parse_find_node("focusLast", node))) + config_focus_last = parse_bool(doc, n); } static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,

@@ -494,6 +497,7 @@ config_focus_new = TRUE;

config_focus_follow = FALSE; config_focus_delay = 0; config_focus_raise = FALSE; + config_focus_last = FALSE; parse_register(i, "focus", parse_focus, NULL);
M openbox/config.hopenbox/config.h

@@ -36,6 +36,8 @@ extern guint config_focus_delay;

/*! If windows should automatically be raised when they are focused in focus follows mouse */ extern gboolean config_focus_raise; +/*! Focus the last focused window, not under the mouse, in follow mouse mode */ +extern gboolean config_focus_last; extern ObPlacePolicy config_place_policy;
M openbox/focus.copenbox/focus.c

@@ -61,10 +61,10 @@ focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE);

} static Window createWindow(Window parent, gulong mask, - XSetWindowAttributes *attrib) + XSetWindowAttributes *attrib) { return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, - RrDepth(ob_rr_inst), InputOutput, + RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), mask, attrib); }

@@ -252,7 +252,7 @@ if (type == OB_FOCUS_FALLBACK_UNFOCUSING && old) {

if (old->transient_for) { gboolean trans = FALSE; - if (!config_focus_follow) + if (!config_focus_follow || config_focus_last) trans = TRUE; else { if ((target = client_under_pointer()) &&

@@ -289,7 +289,7 @@ }

} } - if (config_focus_follow) { + if (config_focus_follow && !config_focus_last) { if ((target = client_under_pointer())) if (client_normal(target) && client_can_focus(target)) return target;