]> Dogcows Code - chaz/openbox/blobdiff - openbox/config.c
Add options for controlling frame flashing
[chaz/openbox] / openbox / config.c
index 8e0e5ac3877bf4e5e21337164531df229e0fa59a..460a3f85f5a8d557568e144b97e8dae9557e893b 100644 (file)
@@ -48,6 +48,8 @@ StrutPartial config_margins;
 gchar   *config_theme;
 gboolean config_theme_keepborder;
 guint    config_theme_window_list_icon_size;
+guint    config_frame_flash_delay;
+guint    config_frame_flash_duration;
 
 gchar   *config_title_layout;
 
@@ -111,6 +113,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 +138,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 +204,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 +293,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);
@@ -646,6 +657,10 @@ static void parse_theme(xmlNodePtr node, gpointer d)
         else if (config_theme_window_list_icon_size > 96)
             config_theme_window_list_icon_size = 96;
     }
+    if ((n = obt_xml_find_node(node, "flashFrameDelay")))
+        config_frame_flash_delay = obt_xml_node_int(n);
+    if ((n = obt_xml_find_node(node, "flashFrameDuration")))
+        config_frame_flash_duration = obt_xml_node_int(n);
 
     n = obt_xml_find_node(node, "font");
     while (n) {
@@ -1022,6 +1037,8 @@ void config_startup(ObtXmlInst *i)
     config_title_layout = g_strdup("NLIMC");
     config_theme_keepborder = TRUE;
     config_theme_window_list_icon_size = 36;
+    config_frame_flash_delay = 600;
+    config_frame_flash_duration = 5000;
 
     config_font_activewindow = NULL;
     config_font_inactivewindow = NULL;
This page took 0.02461 seconds and 4 git commands to generate.