<screen_edge_strength>20</screen_edge_strength>
</resistance>
+<!-- amount of space around windows to respect in terms of
+ moving/resizing/growing/shrinking -->
+<windowMargin>0</windowMargin>
+
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
<xsd:element minOccurs="0" name="right" type="xsd:integer"/>
<xsd:element minOccurs="0" name="bottom" type="xsd:integer"/>
</xsd:complexType>
+ <xsd:element name="windowMargin" type="xsd:integer"/>
<xsd:complexType name="theme">
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="titleLayout" type="xsd:string"/>
#include <glib.h>
#include <X11/Xutil.h>
-extern StrutPartial config_margins;
+extern guint config_window_margin;
/*! The event mask to grab on client windows */
#define CLIENT_EVENTMASK (PropertyChangeMask | StructureNotifyMask | \
ob_debug("trying window %s\n", cur->title);
- RECT_SET(expand, cur->frame->area.x - config_margins.left,
- cur->frame->area.y - config_margins.top,
- cur->frame->area.width + config_margins.left + config_margins.right,
- cur->frame->area.height + config_margins.top + config_margins.bottom);
+ RECT_SET(expand, cur->frame->area.x - config_window_margin,
+ cur->frame->area.y - config_window_margin,
+ cur->frame->area.width + config_window_margin * 2,
+ cur->frame->area.height + config_window_margin * 2);
detect_edge(expand, dir, my_head, my_size, my_edge_start,
my_edge_size, dest, near_edge);
}
gint config_resist_win;
gint config_resist_edge;
+guint config_window_margin;
+
GSList *config_per_app_settings;
ObAppSettings* config_create_app_settings(void)
config_resist_edge = parse_int(doc, n);
}
+static void parse_window_margin(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ gpointer data)
+{
+ config_window_margin = parse_int(doc, node);
+}
+
typedef struct
{
const gchar *key;
parse_register(i, "resistance", parse_resistance, NULL);
+ config_window_margin = 0;
+
+ parse_register(i, "windowMargin", parse_window_margin, NULL);
+
config_menu_hide_delay = 250;
config_menu_middle = FALSE;
config_submenu_show_delay = 0;
/*! Number of pixels to resist while crossing a screen's edge */
extern gint config_resist_edge;
+/*! Number of pixels surrounding windows, affects move/resize/grow/shrink */
+extern guint config_window_margin;
+
/*! Delay for hiding menu when opening in milliseconds */
extern guint config_menu_hide_delay;
/*! Center menus vertically about the parent entry */
#include <glib.h>
-extern StrutPartial config_margins;
+extern guint config_window_margin;
static gboolean resist_move_window(Rect window,
Rect target, gint resist,
break;
/* now check window with the expanded margin area */
- RECT_SET(expand, target->frame->area.x - config_margins.left,
- target->frame->area.y - config_margins.top,
- target->frame->area.width + config_margins.left + config_margins.right,
- target->frame->area.height + config_margins.top + config_margins.bottom);
+ if (config_window_margin == 0)
+ continue;
+
+ RECT_SET(expand, target->frame->area.x - config_window_margin,
+ target->frame->area.y - config_window_margin,
+ target->frame->area.width + config_window_margin * 2,
+ target->frame->area.height + config_window_margin * 2);
if (resist_move_window(c->frame->area, expand,
resist, x, y))
break;
/* now check window with the expanded margin area */
- RECT_SET(expand, target->frame->area.x - config_margins.left,
- target->frame->area.y - config_margins.top,
- target->frame->area.width + config_margins.left + config_margins.right,
- target->frame->area.height + config_margins.top + config_margins.bottom);
+ if (config_window_margin == 0)
+ continue;
+ RECT_SET(expand, target->frame->area.x - config_window_margin,
+ target->frame->area.y - config_window_margin,
+ target->frame->area.width + config_window_margin * 2,
+ target->frame->area.height + config_window_margin * 2);
if (resist_size_window(c->frame->area, expand,
resist, w, h, dir))