]> Dogcows Code - chaz/openbox/commitdiff
add back the focusLast option for the "i lost count"th time
authorMikael Magnusson <mikachu@comhem.se>
Tue, 24 Feb 2004 20:26:08 +0000 (20:26 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Tue, 24 Feb 2004 20:26:08 +0000 (20:26 +0000)
data/rc.xml.in
data/rc.xsd
openbox/config.c
openbox/config.h
openbox/focus.c

index dd7c68d8c34517a20c7319d4eb0a77866a8622cb..a1f2762718c3ea731a637b47d7fad7b7948afadc 100644 (file)
@@ -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 @@
 
 <desktops>
   <number>4</number>
+  <firstdesk>1</firstdesk>
   <names>
     <name>one</name>
     <name>two</name>
index d5c3be95bb73788ee2aa715f9d229d104d3fa37b..f36b39f774873f12f3f9527ef57e00a7f247c2ec 100644 (file)
@@ -71,6 +71,7 @@
         </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"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
+            <xs:element name="firstdesk" type="xs:integer"/>
         </xs:sequence>
     </xs:complexType>
     <xs:complexType name="resize">
index d362324c867a31235f27cedd19b26e09e5e6fece..293174df695cb3ff7957307f20e95b36b9d19336 100644 (file)
@@ -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 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr 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 @@ void config_startup(ObParseInst *i)
     config_focus_follow = FALSE;
     config_focus_delay = 0;
     config_focus_raise = FALSE;
+    config_focus_last = FALSE;
 
     parse_register(i, "focus", parse_focus, NULL);
 
index 4d3f3e5eac3fe9392400420d1e37a72bbb31ea99..63ea5a6d7f146267813c5f27e74f5e6fc25e94f9 100644 (file)
@@ -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;
 
index ba6b7b67d74a2b6aaab578988205515d10c1af92..c990cf843303bb3b8acc01388eefc2d1baebd551 100644 (file)
@@ -61,10 +61,10 @@ static void focus_cycle_destructor(ObClient *client, gpointer data)
 }
 
 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 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
         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 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
         }
     }
 
-    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;
This page took 0.031089 seconds and 4 git commands to generate.