<center>yes</center>
<!-- whether to place windows in the center of the free area found or
the top left corner -->
+ <active>no</active>
+ <!-- force new windows ont the active monitor on a multi-head system, unless
+ they are part of an application already on another monitor -->
</placement>
<theme>
</xsd:annotation>
<xsd:element name="policy" type="ob:placementpolicy"/>
<xsd:element name="center" type="ob:bool"/>
+ <xsd:element name="active" type="ob:bool"/>
</xsd:complexType>
<xsd:complexType name="margins">
<xsd:annotation>
ObPlacePolicy config_place_policy;
gboolean config_place_center;
+gboolean config_place_active;
StrutPartial config_margins;
config_place_policy = OB_PLACE_POLICY_MOUSE;
if ((n = parse_find_node("center", node)))
config_place_center = parse_bool(doc, n);
+ if ((n = parse_find_node("active", node)))
+ config_place_active = parse_bool(doc, n);
}
static void parse_margins(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
config_place_policy = OB_PLACE_POLICY_SMART;
config_place_center = TRUE;
+ config_place_active = FALSE;
parse_register(i, "placement", parse_placement, NULL);
*/
extern gboolean config_focus_under_mouse;
+/*! The algorithm to use for placing new windows */
extern ObPlacePolicy config_place_policy;
/*! Place windows in the center of the free area */
extern gboolean config_place_center;
+/*! Place windows on the active monitor (unless they are part of an application
+ already on another monitor) */
+extern gboolean config_place_active;
/*! User-specified margins around the edge of the screen(s) */
extern StrutPartial config_margins;
}
}
- if (focus_client) {
+ if (focus_client && client_normal(focus_client)) {
add_choice(choice, client_monitor(focus_client));
- ob_debug("placement adding choice %d for focused window\n",
+ ob_debug("placement adding choice %d for normal focused window\n",
client_monitor(focus_client));
}
guint i;
areas = pick_head(client);
- i = g_random_int_range(0, screen_num_monitors);
+ i = config_place_active ? 0 : g_random_int_range(0, screen_num_monitors);
l = areas[i]->x;
t = areas[i]->y;
/* try ignoring different things to find empty space */
for (ignore = 0; ignore < IGNORE_END && !ret; ignore++) {
- /* try all monitors in order of preference */
- for (i = 0; i < screen_num_monitors && !ret; ++i) {
+ /* try all monitors in order of preference, but only the first one
+ if config_place_active is true */
+ for (i = 0; (i < (config_place_active ? 1 : screen_num_monitors) &&
+ !ret); ++i)
+ {
GList *it;
/* add the whole monitor */