add back the focusLast option for the "i lost count"th time

This commit is contained in:
Mikael Magnusson 2004-02-24 20:26:08 +00:00
parent a5451fa6fa
commit dd7c6ad734
5 changed files with 14 additions and 4 deletions

View file

@ -16,6 +16,7 @@
<focus> <focus>
<focusNew>yes</focusNew> <focusNew>yes</focusNew>
<followMouse>no</followMouse> <followMouse>no</followMouse>
<focusLast>no</focusLast>
<focusDelay>0</focusDelay> <focusDelay>0</focusDelay>
<raiseOnFocus>no</raiseOnFocus> <raiseOnFocus>no</raiseOnFocus>
</focus> </focus>
@ -31,6 +32,7 @@
<desktops> <desktops>
<number>4</number> <number>4</number>
<firstdesk>1</firstdesk>
<names> <names>
<name>one</name> <name>one</name>
<name>two</name> <name>two</name>

View file

@ -71,6 +71,7 @@
</xs:annotation> </xs:annotation>
<xs:sequence> <xs:sequence>
<xs:element name="focusNew" type="ob:yesorno"/> <xs:element name="focusNew" type="ob:yesorno"/>
<xs:element name="focusLast" type="ob:yesorno"/>
<xs:element name="followMouse" type="ob:yesorno"/> <xs:element name="followMouse" type="ob:yesorno"/>
<xs:element name="focusDelay" type="xs:integer"/> <xs:element name="focusDelay" type="xs:integer"/>
<xs:element name="raiseOnFocus" type="ob:yesorno"/> <xs:element name="raiseOnFocus" type="ob:yesorno"/>
@ -100,6 +101,7 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="firstdesk" type="xs:integer"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:complexType name="resize"> <xs:complexType name="resize">

View file

@ -28,6 +28,7 @@ gboolean config_focus_new;
gboolean config_focus_follow; gboolean config_focus_follow;
guint config_focus_delay; guint config_focus_delay;
gboolean config_focus_raise; gboolean config_focus_raise;
gboolean config_focus_last;
ObPlacePolicy config_place_policy; ObPlacePolicy config_place_policy;
@ -205,6 +206,8 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
config_focus_delay = parse_int(doc, n) * 1000; config_focus_delay = parse_int(doc, n) * 1000;
if ((n = parse_find_node("raiseOnFocus", node))) if ((n = parse_find_node("raiseOnFocus", node)))
config_focus_raise = parse_bool(doc, n); 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, static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
@ -494,6 +497,7 @@ void config_startup(ObParseInst *i)
config_focus_follow = FALSE; config_focus_follow = FALSE;
config_focus_delay = 0; config_focus_delay = 0;
config_focus_raise = FALSE; config_focus_raise = FALSE;
config_focus_last = FALSE;
parse_register(i, "focus", parse_focus, NULL); parse_register(i, "focus", parse_focus, NULL);

View file

@ -36,6 +36,8 @@ extern guint config_focus_delay;
/*! If windows should automatically be raised when they are focused in /*! If windows should automatically be raised when they are focused in
focus follows mouse */ focus follows mouse */
extern gboolean config_focus_raise; 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; extern ObPlacePolicy config_place_policy;

View file

@ -61,10 +61,10 @@ static void focus_cycle_destructor(ObClient *client, gpointer data)
} }
static Window createWindow(Window parent, gulong mask, static Window createWindow(Window parent, gulong mask,
XSetWindowAttributes *attrib) XSetWindowAttributes *attrib)
{ {
return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, 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); RrVisual(ob_rr_inst), mask, attrib);
} }
@ -252,7 +252,7 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
if (old->transient_for) { if (old->transient_for) {
gboolean trans = FALSE; gboolean trans = FALSE;
if (!config_focus_follow) if (!config_focus_follow || config_focus_last)
trans = TRUE; trans = TRUE;
else { else {
if ((target = client_under_pointer()) && if ((target = client_under_pointer()) &&
@ -289,7 +289,7 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
} }
} }
if (config_focus_follow) { if (config_focus_follow && !config_focus_last) {
if ((target = client_under_pointer())) if ((target = client_under_pointer()))
if (client_normal(target) && client_can_focus(target)) if (client_normal(target) && client_can_focus(target))
return target; return target;