]> Dogcows Code - chaz/openbox/blobdiff - openbox/config.c
Make LeastOverlap placment replace the behaviour of Smart and address style nits
[chaz/openbox] / openbox / config.c
index debd9fbae22d9cf1a294a2f1b46aef95782f6f86..0d9eb689f2e7f4e7ad8ecc4073529413c1541371 100644 (file)
@@ -111,6 +111,7 @@ ObAppSettings* config_create_app_settings(void)
     settings->type = -1;
     settings->decor = -1;
     settings->shade = -1;
+    settings->monitor_type = OB_PLACE_MONITOR_ANY;
     settings->monitor = -1;
     settings->focus = -1;
     settings->desktop = 0;
@@ -135,6 +136,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src,
     copy_if(type, (ObClientType)-1);
     copy_if(decor, -1);
     copy_if(shade, -1);
+    copy_if(monitor_type, OB_PLACE_MONITOR_ANY);
     copy_if(monitor, -1);
     copy_if(focus, -1);
     copy_if(desktop, 0);
@@ -200,8 +202,8 @@ void config_parse_gravity_coord(xmlNodePtr node, GravityCoord *c)
 
 /* Manages settings for individual applications.
    Some notes: monitor is the screen number in a multi monitor
-   (Xinerama) setup (starting from 0) or mouse, meaning the
-   monitor the pointer is on. Default: mouse.
+   (Xinerama) setup (starting from 0), or mouse: the monitor the pointer
+   is on, active: the active monitor, primary: the primary monitor.
    Layer can be three values, above (Always on top), below
    (Always on bottom) and everything else (normal behaviour).
    Positions can be an integer value or center, which will
@@ -289,12 +291,19 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d)
                         settings->pos_given = TRUE;
                     }
 
-                if (settings->pos_given &&
-                    (c = obt_xml_find_node(n->children, "monitor")))
+                /* monitor can be set without setting x or y */
+                if ((c = obt_xml_find_node(n->children, "monitor")))
                     if (!obt_xml_node_contains(c, "default")) {
                         gchar *s = obt_xml_node_string(c);
                         if (!g_ascii_strcasecmp(s, "mouse"))
-                            settings->monitor = 0;
+                            settings->monitor_type =
+                                    OB_PLACE_MONITOR_MOUSE;
+                        else if (!g_ascii_strcasecmp(s, "active"))
+                            settings->monitor_type =
+                                    OB_PLACE_MONITOR_ACTIVE;
+                        else if (!g_ascii_strcasecmp(s, "primary"))
+                            settings->monitor_type =
+                                    OB_PLACE_MONITOR_PRIMARY;
                         else
                             settings->monitor = obt_xml_node_int(c);
                         g_free(s);
@@ -1070,7 +1079,7 @@ void config_startup(ObtXmlInst *i)
     obt_xml_register(i, "keyboard", parse_keyboard, NULL);
 
     config_mouse_threshold = 8;
-    config_mouse_dclicktime = 200;
+    config_mouse_dclicktime = 500;
     config_mouse_screenedgetime = 400;
     config_mouse_screenedgewarp = FALSE;
 
This page took 0.022482 seconds and 4 git commands to generate.