<xsd:element minOccurs="0" name="focusDelay" type="xsd:integer"/>
<xsd:element minOccurs="0" name="raiseOnFocus" type="ob:bool"/>
<xsd:element minOccurs="0" name="unfocusOnLeave" type="ob:bool"/>
+ <xsd:element minOccurs="0" name="directionalDistanceWeight" type="xsd:integer"/>
+ <xsd:element minOccurs="0" name="directionalAngleWeight" type="xsd:integer"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="placement">
gboolean config_focus_last;
gboolean config_focus_under_mouse;
gboolean config_unfocus_leave;
+guint config_directional_distance_weight;
+guint config_directional_angle_weight;
ObPlacePolicy config_place_policy;
gboolean config_place_center;
config_focus_under_mouse = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "unfocusOnLeave")))
config_unfocus_leave = obt_xml_node_bool(n);
+ if ((n = obt_xml_find_node(node, "directionalDistanceWeight")))
+ config_directional_distance_weight = obt_xml_node_int(n);
+ else
+ config_directional_distance_weight = 1U;
+ if ((n = obt_xml_find_node(node, "directionalAngleWeight")))
+ config_directional_angle_weight = obt_xml_node_int(n);
+ else
+ config_directional_angle_weight = 1U;
}
static void parse_placement(xmlNodePtr node, gpointer d)
/*! Remove focus from windows when the mouse leaves them
*/
extern gboolean config_unfocus_leave;
+/*! Weight of distance part of score for directional switching */
+extern guint config_directional_distance_weight;
+/*! Weight of angle part of score for directional switching */
+extern guint config_directional_angle_weight;
/*! The algorithm to use for placing new windows */
extern ObPlacePolicy config_place_policy;
#include "screen.h"
#include "openbox.h"
#include "debug.h"
+#include "config.h"
#include <X11/Xlib.h>
#include <glib.h>
continue;
/* Calculate score for this window. The smaller the better. */
- score = distance + offset;
+ score = (distance * config_directional_distance_weight
+ + offset * config_directional_angle_weight);
/* windows more than 45 degrees off the direction are
* heavily penalized and will only be chosen if nothing