]> Dogcows Code - chaz/openbox/commitdiff
add option for under-mouse placement
authorDana Jansens <danakj@orodu.net>
Sun, 28 Sep 2003 09:01:04 +0000 (09:01 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 28 Sep 2003 09:01:04 +0000 (09:01 +0000)
openbox/config.c
openbox/config.h
openbox/place.c
openbox/place.h

index aebf433fbb00516fb505c2a7ca6f17a683891ebf..2c787e4b483dbd55684aeb4489692d2166c90b5e 100644 (file)
@@ -29,6 +29,8 @@ gboolean config_focus_follow;
 guint    config_focus_delay;
 guint    config_focus_raise;
 
+ObPlacePolicy config_place_policy;
+
 char *config_theme;
 
 gchar *config_title_layout;
@@ -207,6 +209,18 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         config_focus_raise = parse_bool(doc, n);
 }
 
+static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+                            void *d)
+{
+    xmlNodePtr n;
+
+    node = node->children;
+    
+    if ((n = parse_find_node("policy", node)))
+        if (parse_contains("UnderMouse", doc, n))
+            config_place_policy = OB_PLACE_POLICY_MOUSE;
+}
+
 static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
                         void *d)
 {
@@ -478,6 +492,10 @@ void config_startup(ObParseInst *i)
 
     parse_register(i, "focus", parse_focus, NULL);
 
+    config_place_policy = OB_PLACE_POLICY_SMART;
+
+    parse_register(i, "placement", parse_placement, NULL);
+
     config_theme = NULL;
 
     config_title_layout = g_strdup("NLIMC");
index 465bff45d09218bed601523acf1e37945e4046b5..a2cfce3b47bf45b79da0c05f8618302ee55bd3ba 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "misc.h"
 #include "stacking.h"
+#include "place.h"
 
 #include <glib.h>
 
@@ -36,6 +37,8 @@ extern guint    config_focus_delay;
  focus follows mouse */
 extern guint    config_focus_raise;
 
+extern ObPlacePolicy config_place_policy;
+
 /*! When true windows' contents are refreshed while they are resized; otherwise
   they are not updated until the resize is complete */
 extern gboolean config_redraw_resize;
index 044743bc046d91bb2019fc396e7e4a92ec622087..19fa597a6f4a8f44c243f4f79f5dae280768a98c 100644 (file)
@@ -374,7 +374,7 @@ void place_client(ObClient *client, gint *x, gint *y)
         return;
     if (place_transient(client, x, y)             ||
         place_dialog(client, x, y)                ||
-        ((config_focus_follow && config_focus_new) ?
+        ((config_place_policy == OB_PLACE_POLICY_MOUSE) ?
          place_under_mouse(client, x, y) :
          place_smart(client, x, y, SMART_FULL)    ||
          place_smart(client, x, y, SMART_GROUP)   ||
index 0237232083c51cc98815a673ac8f8e4b1d05fb65..1d35888cbd770ea5698dd94e59d6aca169e2164b 100644 (file)
 
 struct _ObClient;
 
-void place_client(ObClient *client, gint *x, gint *y);
+typedef enum
+{
+    OB_PLACE_POLICY_SMART,
+    OB_PLACE_POLICY_MOUSE
+} ObPlacePolicy;
+
+void place_client(struct _ObClient *client, gint *x, gint *y);
 
 #endif
This page took 0.029173 seconds and 4 git commands to generate.