summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/wobbly.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-14 16:54:15 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-14 16:54:15 +0000
commitfe9fb956fabeed2d4a2a704dda2976dfc494ca48 (patch)
treea9e8f8fdfb361428a942a432bc274c4ec05c1cb8 /beryl-plugins/src/wobbly.c
parent6049a96eb62c5063f445268bf3493a29fed89fcf (diff)
downloadmarex-dev-fe9fb956fabeed2d4a2a704dda2976dfc494ca48.tar.gz
marex-dev-fe9fb956fabeed2d4a2a704dda2976dfc494ca48.tar.bz2
beryl-core & plugins:
- code cleanup: use have only two functions which retrieve the dimensions of output device and its work area instead of eight - fixed calculation error in organic scale git-svn-id: file:///beryl/trunk@1198 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/wobbly.c')
-rw-r--r--beryl-plugins/src/wobbly.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/beryl-plugins/src/wobbly.c b/beryl-plugins/src/wobbly.c
index fb7d693..e217a1a 100644
--- a/beryl-plugins/src/wobbly.c
+++ b/beryl-plugins/src/wobbly.c
@@ -853,10 +853,10 @@ findNextWestEdge (CompWindow * w, Object * object)
{
for (i = 1; i <= w->screen->nOutputDev; i++)
{
- s = screenGetOutputDevAreaY (w->screen, i);
- e = screenGetOutputDevAreaY (w->screen,
- i) +
- screenGetOutputDevAreaHeight (w->screen, i);
+ XRectangle workArea;
+ screenGetOutputDevWorkArea (w->screen, i, &workArea);
+ s = workArea.y;
+ e = workArea.y + workArea.height;
if (s > object->position.y)
{
@@ -876,7 +876,7 @@ findNextWestEdge (CompWindow * w, Object * object)
if (e < end)
end = e;
- v = screenGetOutputDevAreaX (w->screen, i);
+ v = workArea.x;
if (v <= x)
{
if (v > v1)
@@ -983,10 +983,10 @@ findNextEastEdge (CompWindow * w, Object * object)
{
for (i = 1; i <= w->screen->nOutputDev; i++)
{
- s = screenGetOutputDevAreaY (w->screen, i);
- e = screenGetOutputDevAreaY (w->screen,
- i) +
- screenGetOutputDevAreaHeight (w->screen, i);
+ XRectangle workArea;
+ screenGetOutputDevWorkArea (w->screen, i, &workArea);
+ s = workArea.y;
+ e = workArea.y + workArea.height;
if (s > object->position.y)
{
@@ -1006,9 +1006,7 @@ findNextEastEdge (CompWindow * w, Object * object)
if (e < end)
end = e;
- v = screenGetOutputDevAreaX (w->screen,
- i) +
- screenGetOutputDevAreaWidth (w->screen, i);
+ v = workArea.x + workArea.width;
if (v >= x)
{
if (v < v1)
@@ -1115,10 +1113,10 @@ findNextNorthEdge (CompWindow * w, Object * object)
{
for (i = 1; i <= w->screen->nOutputDev; i++)
{
- s = screenGetOutputDevAreaX (w->screen, i);
- e = screenGetOutputDevAreaX (w->screen,
- i) +
- screenGetOutputDevAreaWidth (w->screen, i);
+ XRectangle workArea;
+ screenGetOutputDevWorkArea (w->screen, i, &workArea);
+ s = workArea.x;
+ e = workArea.x + workArea.width;
if (s > object->position.x)
{
@@ -1138,7 +1136,7 @@ findNextNorthEdge (CompWindow * w, Object * object)
if (e < end)
end = e;
- v = screenGetOutputDevAreaY (w->screen, i);
+ v = workArea.y;
if (v <= y)
{
if (v > v1)
@@ -1245,10 +1243,10 @@ findNextSouthEdge (CompWindow * w, Object * object)
{
for (i = 1; i <= w->screen->nOutputDev; i++)
{
- s = screenGetOutputDevAreaX (w->screen, i);
- e = screenGetOutputDevAreaX (w->screen,
- i) +
- screenGetOutputDevAreaWidth (w->screen, i);
+ XRectangle workArea;
+ screenGetOutputDevWorkArea (w->screen, i, &workArea);
+ s = workArea.x;
+ e = workArea.x + workArea.width;
if (s > object->position.x)
{
@@ -1268,9 +1266,7 @@ findNextSouthEdge (CompWindow * w, Object * object)
if (e < end)
end = e;
- v = screenGetOutputDevAreaY (w->screen,
- i) +
- screenGetOutputDevAreaHeight (w->screen, i);
+ v = workArea.y + workArea.height;
if (v >= y)
{
if (v < v1)