all repos — openbox @ 8e63ffdabdc3be3ad355dcaddd47d8e71c510739

openbox fork - make it a bit more like ryudo

add option for under-mouse placement
Dana Jansens danakj@orodu.net
commit

8e63ffdabdc3be3ad355dcaddd47d8e71c510739

parent

fa962c1604bac1b5a6c3656b71c3145436f2392b

4 files changed, 29 insertions(+), 2 deletions(-)

jump to
M openbox/config.copenbox/config.c

@@ -29,6 +29,8 @@ gboolean config_focus_follow;

guint config_focus_delay; guint config_focus_raise; +ObPlacePolicy config_place_policy; + char *config_theme; gchar *config_title_layout;

@@ -205,6 +207,18 @@ if ((n = parse_find_node("focusDelay", node)))

config_focus_delay = parse_int(doc, n) * 1000; if ((n = parse_find_node("raiseOnFocus", node))) config_focus_raise = parse_bool(doc, n); +} + +static void parse_placement(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, + void *d) +{ + xmlNodePtr n; + + node = node->children; + + if ((n = parse_find_node("policy", node))) + if (parse_contains("UnderMouse", doc, n)) + config_place_policy = OB_PLACE_POLICY_MOUSE; } static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,

@@ -477,6 +491,10 @@ config_focus_delay = 0;

config_focus_raise = FALSE; parse_register(i, "focus", parse_focus, NULL); + + config_place_policy = OB_PLACE_POLICY_SMART; + + parse_register(i, "placement", parse_placement, NULL); config_theme = NULL;
M openbox/config.hopenbox/config.h

@@ -21,6 +21,7 @@ #define __config_h

#include "misc.h" #include "stacking.h" +#include "place.h" #include <glib.h>

@@ -35,6 +36,8 @@ extern guint config_focus_delay;

/*! If windows should automatically be raised when they are focused in focus follows mouse */ extern guint config_focus_raise; + +extern ObPlacePolicy config_place_policy; /*! When true windows' contents are refreshed while they are resized; otherwise they are not updated until the resize is complete */
M openbox/place.copenbox/place.c

@@ -374,7 +374,7 @@ if (client->positioned)

return; if (place_transient(client, x, y) || place_dialog(client, x, y) || - ((config_focus_follow && config_focus_new) ? + ((config_place_policy == OB_PLACE_POLICY_MOUSE) ? place_under_mouse(client, x, y) : place_smart(client, x, y, SMART_FULL) || place_smart(client, x, y, SMART_GROUP) ||
M openbox/place.hopenbox/place.h

@@ -23,6 +23,12 @@ #include <glib.h>

struct _ObClient; -void place_client(ObClient *client, gint *x, gint *y); +typedef enum +{ + OB_PLACE_POLICY_SMART, + OB_PLACE_POLICY_MOUSE +} ObPlacePolicy; + +void place_client(struct _ObClient *client, gint *x, gint *y); #endif