summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,