summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/wobbly.c
diff options
context:
space:
mode:
authorguillaume <guillaume@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-26 00:58:58 +0000
committerguillaume <guillaume@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-26 00:58:58 +0000
commit41d7ad0404f92e999bc3d8510ecd620aba6a1e70 (patch)
tree765f6364e8dc283de605c9504799cb7174533a9b /beryl-plugins/src/wobbly.c
parent45a6b3a2dd2b84775d2729e604b5b6a09a261d52 (diff)
downloadmarex-dev-41d7ad0404f92e999bc3d8510ecd620aba6a1e70.tar.gz
marex-dev-41d7ad0404f92e999bc3d8510ecd620aba6a1e70.tar.bz2
beryl-plugins: wobbly: make edge attraction optionnal, rename Bindings options category to make it more generic
git-svn-id: file:///beryl/trunk@3152 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/wobbly.c')
-rw-r--r--beryl-plugins/src/wobbly.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/beryl-plugins/src/wobbly.c b/beryl-plugins/src/wobbly.c
index 8bd7375..826c4e9 100644
--- a/beryl-plugins/src/wobbly.c
+++ b/beryl-plugins/src/wobbly.c
@@ -146,6 +146,7 @@ typedef struct _Model
#define WOBBLY_RELEASE_DEFAULT FALSE
#define WOBBLY_DEFAULT_SNAP_DEFAULT TRUE
+#define WOBBLY_EDGE_ATTRACTION_DEFAULT FALSE
#define WOBBLY_URGENT_EFFECT_DEFAULT FALSE
#define WOBBLY_URGENT_IN_DEFAULT FALSE
#define WOBBLY_URGENT_UNIFORM_DEFAULT TRUE
@@ -263,7 +264,8 @@ typedef struct _WobblyDisplay
#define WOBBLY_SCREEN_OPTION_URGENT_UNIFORM 30
#define WOBBLY_SCREEN_OPTION_EDGE_DISTANCE 31
#define WOBBLY_SCREEN_OPTION_EDGE_VELOCITY 32
-#define WOBBLY_SCREEN_OPTION_NUM 33
+#define WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION 33
+#define WOBBLY_SCREEN_OPTION_NUM 34
typedef struct _WobblyScreen
{
@@ -450,6 +452,7 @@ wobblySetScreenOption(CompScreen * screen,
case WOBBLY_SCREEN_OPTION_URGENT_EFFECT:
case WOBBLY_SCREEN_OPTION_URGENT_IN:
case WOBBLY_SCREEN_OPTION_URGENT_UNIFORM:
+ case WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION:
if (compSetBoolOption(o, value))
return TRUE;
break;
@@ -937,6 +940,16 @@ static void wobblyScreenInitOptions(WobblyScreen * ws)
o->rest.f.max = WOBBLY_EDGE_VELOCITY_MAX;
o->rest.f.precision = WOBBLY_EDGE_VELOCITY_PRECISION;
+ o = &ws->opt[WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION];
+ o->advanced = False;
+ o->name = "edge_attraction";
+ o->group = N_("Basic");
+ o->subGroup = N_("Snap");
+ o->displayHints = "";
+ o->shortDesc = N_("Edge attraction");
+ o->longDesc = N_("Enable edge attraction");
+ o->type = CompOptionTypeBool;
+ o->value.b = WOBBLY_EDGE_ATTRACTION_DEFAULT;
}
static CompOption *wobblyGetScreenOptions(CompScreen * screen, int *count)
@@ -1062,7 +1075,9 @@ static void findNextWestEdge(CompWindow * w, Object * object)
WOBBLY_SCREEN(w->screen);
- object->vertEdge.attract = v1 + ws->edgeDistance;
+ if (ws->opt[WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION].value.b)
+ object->vertEdge.attract = v1 + ws->edgeDistance;
+ else object->vertEdge.attract = v1;
object->vertEdge.velocity = ws->edgeVelocity;
}
@@ -1165,7 +1180,9 @@ static void findNextEastEdge(CompWindow * w, Object * object)
WOBBLY_SCREEN(w->screen);
- object->vertEdge.attract = v1 - ws->edgeDistance;
+ if (ws->opt[WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION].value.b)
+ object->vertEdge.attract = v1 - ws->edgeDistance;
+ else object->vertEdge.attract = v1;
object->vertEdge.velocity = ws->edgeVelocity;
}
@@ -1267,7 +1284,9 @@ static void findNextNorthEdge(CompWindow * w, Object * object)
WOBBLY_SCREEN(w->screen);
- object->horzEdge.attract = v1 + ws->edgeDistance;
+ if (ws->opt[WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION].value.b)
+ object->horzEdge.attract = v1 + ws->edgeDistance;
+ else object->horzEdge.attract = v1;
object->horzEdge.velocity = ws->edgeVelocity;
}
@@ -1370,7 +1389,9 @@ static void findNextSouthEdge(CompWindow * w, Object * object)
WOBBLY_SCREEN(w->screen);
- object->horzEdge.attract = v1 - ws->edgeDistance;
+ if (ws->opt[WOBBLY_SCREEN_OPTION_EDGE_ATTRACTION].value.b)
+ object->horzEdge.attract = v1 - ws->edgeDistance;
+ else object->horzEdge.attract = v1;
object->horzEdge.velocity = ws->edgeVelocity;
}
@@ -3370,7 +3391,7 @@ static void wobblyDisplayInitOptions(WobblyDisplay * wd)
o = &wd->opt[WOBBLY_DISPLAY_OPTION_SNAP];
o->advanced = False;
o->name = "snap";
- o->group = N_("Bindings");
+ o->group = N_("Basic");
o->subGroup = N_("Snap");
o->displayHints = "";
o->shortDesc = N_("Snap windows modifier");
@@ -3390,7 +3411,7 @@ static void wobblyDisplayInitOptions(WobblyDisplay * wd)
o = &wd->opt[WOBBLY_DISPLAY_OPTION_DEFAULT_SNAP];
o->advanced = False;
o->name = "default_snap";
- o->group = N_("Bindings");
+ o->group = N_("Basic");
o->subGroup = N_("Snap");
o->displayHints = "";
o->shortDesc = N_("Default Snapping to On");
@@ -3401,7 +3422,7 @@ static void wobblyDisplayInitOptions(WobblyDisplay * wd)
o = &wd->opt[WOBBLY_DISPLAY_OPTION_SHIVER];
o->advanced = False;
o->name = "shiver";
- o->group = N_("Bindings");
+ o->group = N_("Basic");
o->subGroup = N_("Shiver");
o->displayHints = "";
o->shortDesc = N_("Shiver");