add option for under-mouse placement
This commit is contained in:
parent
fa962c1604
commit
8e63ffdabd
4 changed files with 29 additions and 2 deletions
|
@ -29,6 +29,8 @@ gboolean config_focus_follow;
|
||||||
guint config_focus_delay;
|
guint config_focus_delay;
|
||||||
guint config_focus_raise;
|
guint config_focus_raise;
|
||||||
|
|
||||||
|
ObPlacePolicy config_place_policy;
|
||||||
|
|
||||||
char *config_theme;
|
char *config_theme;
|
||||||
|
|
||||||
gchar *config_title_layout;
|
gchar *config_title_layout;
|
||||||
|
@ -207,6 +209,18 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
config_focus_raise = parse_bool(doc, n);
|
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,
|
static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
void *d)
|
void *d)
|
||||||
{
|
{
|
||||||
|
@ -478,6 +492,10 @@ void config_startup(ObParseInst *i)
|
||||||
|
|
||||||
parse_register(i, "focus", parse_focus, NULL);
|
parse_register(i, "focus", parse_focus, NULL);
|
||||||
|
|
||||||
|
config_place_policy = OB_PLACE_POLICY_SMART;
|
||||||
|
|
||||||
|
parse_register(i, "placement", parse_placement, NULL);
|
||||||
|
|
||||||
config_theme = NULL;
|
config_theme = NULL;
|
||||||
|
|
||||||
config_title_layout = g_strdup("NLIMC");
|
config_title_layout = g_strdup("NLIMC");
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "stacking.h"
|
#include "stacking.h"
|
||||||
|
#include "place.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
@ -36,6 +37,8 @@ extern guint config_focus_delay;
|
||||||
focus follows mouse */
|
focus follows mouse */
|
||||||
extern guint config_focus_raise;
|
extern guint config_focus_raise;
|
||||||
|
|
||||||
|
extern ObPlacePolicy config_place_policy;
|
||||||
|
|
||||||
/*! When true windows' contents are refreshed while they are resized; otherwise
|
/*! When true windows' contents are refreshed while they are resized; otherwise
|
||||||
they are not updated until the resize is complete */
|
they are not updated until the resize is complete */
|
||||||
extern gboolean config_redraw_resize;
|
extern gboolean config_redraw_resize;
|
||||||
|
|
|
@ -374,7 +374,7 @@ void place_client(ObClient *client, gint *x, gint *y)
|
||||||
return;
|
return;
|
||||||
if (place_transient(client, x, y) ||
|
if (place_transient(client, x, y) ||
|
||||||
place_dialog(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_under_mouse(client, x, y) :
|
||||||
place_smart(client, x, y, SMART_FULL) ||
|
place_smart(client, x, y, SMART_FULL) ||
|
||||||
place_smart(client, x, y, SMART_GROUP) ||
|
place_smart(client, x, y, SMART_GROUP) ||
|
||||||
|
|
|
@ -23,6 +23,12 @@
|
||||||
|
|
||||||
struct _ObClient;
|
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
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue