summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/place.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-16 07:53:19 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-16 07:53:19 +0000
commit225a6d96223c1b18224f7faf765dcfc7df4ea9c4 (patch)
tree8f7f24e944816f2b948e14e031bc164f939b2de2 /beryl-plugins/src/place.c
parent3ee1de9c98ee2d41c370674436d20f7cd0756767 (diff)
downloadmarex-dev-225a6d96223c1b18224f7faf765dcfc7df4ea9c4.tar.gz
marex-dev-225a6d96223c1b18224f7faf765dcfc7df4ea9c4.tar.bz2
Prevent create from getting locked in lowest row
git-svn-id: file:///beryl/trunk@1795 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/place.c')
-rw-r--r--beryl-plugins/src/place.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c
index 5dbbe84..b9dcf97 100644
--- a/beryl-plugins/src/place.c
+++ b/beryl-plugins/src/place.c
@@ -273,31 +273,23 @@ static void placeRandom(CompWindow *window, int *x, int *y){
static void placeIntelligent(CompWindow *w, int *x, int *y){
-
-
-
+
static int xi,yi,max;
*x=xi + (rand() % 10);
*y=yi + (rand() % 10);
- xi+=w->attrib.width;
- if (w->attrib.height > max){
- max=w->attrib.height;
- }
- if (xi > w->screen->workArea.width) {
- xi=0;
- yi+=max;
+ yi+=w->attrib.height;
+
+ if (w->attrib.width > max){
+ max=w->attrib.width;
}
+ if (yi > w->screen->workArea.height) {
+ yi=0;
+ xi+=max;
+ max=0;
+ }
}
-
-
-
-
-
-
-
-
static void
find_next_cascade(CompWindow * window,