[openbox] in summary

corey at streamreel.net corey at streamreel.net
Sun Nov 16 20:42:13 EST 2003


On Mon, Nov 17, 2003 at 08:20:43PM +0100, Mikael Magnusson wrote:
> On Sun, 16 Nov 2003 corey at streamreel.net wrote:
<snip>
> > The patch is attached, 
> >   'cd .../<obsourcedir>/openbox; patch -p0 <ob-3.0.ffm.patch'
> > 
> 
> I'm pretty sure most of us prefer unified diff patches
> 

  Roger that.

  ....attached.


-------------- next part --------------
diff -urN openbox-3.0/openbox/config.c openbox-3.0.sandbox/openbox/config.c
--- openbox-3.0/openbox/config.c	2003-11-17 01:35:18.528416192 +0000
+++ openbox-3.0.sandbox/openbox/config.c	2003-11-17 01:37:08.055765504 +0000
@@ -26,7 +26,9 @@
 
 gboolean config_focus_new;
 gboolean config_focus_follow;
-guint    config_focus_delay;
+gboolean config_lazy_focus;
+gboolean config_sloppy_focus;
+guint    config_delay_timer;
 guint    config_focus_raise;
 
 ObPlacePolicy config_place_policy;
@@ -200,8 +202,14 @@
         config_focus_new = parse_bool(doc, n);
     if ((n = parse_find_node("followMouse", node)))
         config_focus_follow = parse_bool(doc, n);
+    if ((n = parse_find_node("lazyFocus", node)))
+        config_lazy_focus = parse_bool(doc, n);
     if ((n = parse_find_node("focusDelay", node)))
-        config_focus_delay = parse_int(doc, n) * 1000;
+        config_delay_timer = parse_int(doc, n) * 1000;
+    if ((n = parse_find_node("sloppyFocus", node)))
+        config_sloppy_focus = parse_bool(doc, n);
+    if ((n = parse_find_node("raiseDelay", node)))
+        config_delay_timer = parse_int(doc, n) * 1000;
     if ((n = parse_find_node("raiseOnFocus", node)))
         config_focus_raise = parse_bool(doc, n);
 }
@@ -486,7 +494,9 @@
 {
     config_focus_new = TRUE;
     config_focus_follow = FALSE;
-    config_focus_delay = 0;
+    config_lazy_focus = FALSE;
+    config_sloppy_focus = FALSE;
+    config_delay_timer = 0;
     config_focus_raise = FALSE;
 
     parse_register(i, "focus", parse_focus, NULL);
diff -urN openbox-3.0/openbox/config.h openbox-3.0.sandbox/openbox/config.h
--- openbox-3.0/openbox/config.h	2003-11-17 01:35:15.925811848 +0000
+++ openbox-3.0.sandbox/openbox/config.h	2003-11-17 01:37:08.055765504 +0000
@@ -31,8 +31,13 @@
 extern gboolean config_focus_new;
 /*! Focus windows when the mouse enters them */
 extern gboolean config_focus_follow;
-/*! Timeout for focusing windows on focus follows mouse, in microseconds */
-extern guint    config_focus_delay;
+/*! Focus when raised */
+extern gboolean config_lazy_focus;
+/*! Window focus strictly follows mouse */
+extern gboolean config_sloppy_focus;
+/*! Timeout for focusing (lazy focus) or raising (sloppy focus) windows on 
+ focus follows mouse, in microseconds */
+extern guint    config_delay_timer;
 /*! If windows should automatically be raised when they are focused in
  focus follows mouse */
 extern guint    config_focus_raise;
diff -urN openbox-3.0/openbox/event.c openbox-3.0.sandbox/openbox/event.c
--- openbox-3.0/openbox/event.c	2003-11-17 01:35:19.798223152 +0000
+++ openbox-3.0.sandbox/openbox/event.c	2003-11-17 01:37:08.057765200 +0000
@@ -551,14 +551,20 @@
     g_assert(config_focus_follow);
 
     if (client_normal(client) && client_can_focus(client)) {
-        if (config_focus_delay) {
-            ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
-            ob_main_loop_timeout_add(ob_main_loop,
-                                     config_focus_delay,
-                                     focus_delay_func,
-                                     client, NULL);
-        } else
-            focus_delay_func(client);
+
+        if (focus_client != client) {
+	    if (config_sloppy_focus)
+                client_focus(client);
+
+           if (config_delay_timer) {
+               ob_main_loop_timeout_remove(ob_main_loop, focus_delay_func);
+               ob_main_loop_timeout_add(ob_main_loop,
+                                        config_delay_timer,
+                                        focus_delay_func,
+                                        client, NULL);
+           } else
+	      focus_delay_func(client);
+	}
     }
 }
 
@@ -652,7 +658,7 @@
             frame_adjust_state(client->frame);
             break;
         case OB_FRAME_CONTEXT_FRAME:
-            if (config_focus_follow && config_focus_delay)
+            if (config_focus_follow && config_delay_timer)
                 ob_main_loop_timeout_remove_data(ob_main_loop,
                                                  focus_delay_func,
                                                  client);
@@ -1205,11 +1211,11 @@
 {
     ObClient *c = data;
 
-    if (focus_client != c) {
-        client_focus(c);
-        if (config_focus_raise)
-            client_raise(c);
-    }
+    if (config_focus_raise)
+        if (config_lazy_focus)
+	    client_focus(c);
+        client_raise(c);
+    
     return FALSE; /* no repeat */
 }
 


More information about the openbox mailing list