summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/place.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-20 13:04:51 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-20 13:04:51 +0000
commitaea1260fe1f24db794bec30f8ad34be6bc54bb2e (patch)
treeae1a2cb9e6156a8a0b164c72ad0763d53e5a3e9d /beryl-plugins/src/place.c
parent752acefaf60969e1c8603fb119bb4eacbd01027c (diff)
downloadmarex-dev-aea1260fe1f24db794bec30f8ad34be6bc54bb2e.tar.gz
marex-dev-aea1260fe1f24db794bec30f8ad34be6bc54bb2e.tar.bz2
Run indent.sh on beryl-plugins
git-svn-id: file:///beryl/trunk@1945 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/place.c')
-rw-r--r--beryl-plugins/src/place.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c
index e23c240..666f948 100644
--- a/beryl-plugins/src/place.c
+++ b/beryl-plugins/src/place.c
@@ -573,20 +573,21 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
XRectangle wRect = RECTANGLE_FROM_WINDOW (w);
XRectangle sRect = { 0, 0, 0, 0 };
wRect.height += w->serverBorderWidth;
- int wIter = wRect.width/10;
- int hIter = wRect.height/10;
+ int wIter = wRect.width / 10;
+ int hIter = wRect.height / 10;
CompScreen *screen = w->screen;
get_workarea_of_current_output_device (screen, &sRect);
- placeCentered(w,x,y);
- XRectangle cRect = {*x,*y,wRect.width,wRect.height};
- if (!rectangle_overlaps_some_window(&cRect,windows)) return; /*If it fits place it in the center */
-
+ placeCentered (w, x, y);
+ XRectangle cRect = { *x, *y, wRect.width, wRect.height };
+ if (!rectangle_overlaps_some_window (&cRect, windows))
+ return; /*If it fits place it in the center */
+
int xi;
int yi;
- thisisdisgusting:
+ thisisdisgusting:
for (xi = 0; xi < (sRect.width - sRect.x); xi += 10)
{
@@ -597,29 +598,33 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
if (!rectangle_overlaps_some_window (&wRect, windows))
{
-
- if ( !((wRect.width > sRect.width/2) && ((wRect.width+w->serverX > sRect.width) || (wRect.height+w->serverY > sRect.height)) ) )
+
+ if (!
+ ((wRect.width > sRect.width / 2)
+ && ((wRect.width + w->serverX > sRect.width)
+ || (wRect.height + w->serverY > sRect.height))))
*x = xi;
- *y = yi;
- return;
-
+ *y = yi;
+ return;
+
}
}
}
- /* No fit and big window? Center it, that tends to be what people expect */
- if (tries == 0 && wRect.width > ( sRect.width/2 ) )
- {
- placeCentered(w,x,y);
- return;
- }
- /* Would the window fit if it was smaller ? */
- if(tries < 10 && wRect.width>0 && wRect.height>0) {
- tries++;
- wRect.width-=wIter;
- wRect.height-=hIter;
- goto thisisdisgusting;
- }
- placeCentered(w,x,y);
+ /* No fit and big window? Center it, that tends to be what people expect */
+ if (tries == 0 && wRect.width > (sRect.width / 2))
+ {
+ placeCentered (w, x, y);
+ return;
+ }
+ /* Would the window fit if it was smaller ? */
+ if (tries < 10 && wRect.width > 0 && wRect.height > 0)
+ {
+ tries++;
+ wRect.width -= wIter;
+ wRect.height -= hIter;
+ goto thisisdisgusting;
+ }
+ placeCentered (w, x, y);
}
static gint