summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimo Mund <massimo.mund@stud.uni-duisburg-essen.de>2008-12-10 03:01:45 +0100
committerMassimo Mund <massimo.mund@stud.uni-duisburg-essen.de>2008-12-10 03:01:45 +0100
commit1cac3e2729d4dc35e7ef80c5ebe7f51c5516d125 (patch)
treea03d084cfb09882655e19e3859dfcbcda051825a
parent74a98a4cbeb787227cba11a5f698f368c2f29a01 (diff)
downloadsmartput-1cac3e2729d4dc35e7ef80c5ebe7f51c5516d125.tar.gz
smartput-1cac3e2729d4dc35e7ef80c5ebe7f51c5516d125.tar.bz2
Removed coverrate as indicator for stacking, Added min window height, width
-rw-r--r--smartput.c16
-rw-r--r--smartput.xml.in14
2 files changed, 17 insertions, 13 deletions
diff --git a/smartput.c b/smartput.c
index 6ffb75d..001ef0b 100644
--- a/smartput.c
+++ b/smartput.c
@@ -419,8 +419,8 @@ smartputFindRect (CompWindow *w,
* And if so, windows may just shrink to a minimal size of 50x50
*/
if(smartputGetAllowWindowsShrink (d) &&
- (maxBox.x2 - maxBox.x1) > 50 &&
- (maxBox.y2 - maxBox.y1) > 50)
+ (maxBox.x2 - maxBox.x1) > smartputGetWindowMinwidth(d) &&
+ (maxBox.y2 - maxBox.y1) > smartputGetWindowMinheight(d))
return maxBox;
if(maxArea >= currentArea)
@@ -444,7 +444,6 @@ smartputFindStapleRect (CompWindow *w,
windowBox = smartputBoxFromWindow (w);
maxArea = -1;
- maxRate = 0;
maxBox = windowBox;
for (window = w->screen->windows; window; window = window->next) {
@@ -490,23 +489,14 @@ smartputFindStapleRect (CompWindow *w,
rHeight = windowBox.y2 - rYpos;
int coverArea = 0;
- int coverRate = 0;
if (rWidth < 0 || rHeight < 0)
- {
coverArea = 0;
- coverRate = 0;
- }
else
- {
coverArea = rHeight * rWidth;
- coverRate = ((coverArea*100)/((current.x2-current.x1)*(current.y2-current.y1)));
- }
- if ((coverRate >= 98 && coverArea > maxArea) ||
- coverRate > maxRate)
+ if (coverArea > maxArea)
{
maxArea = coverArea;
- maxRate = coverRate;
maxBox = current;
}
}
diff --git a/smartput.xml.in b/smartput.xml.in
index 65c36aa..c67a0b7 100644
--- a/smartput.xml.in
+++ b/smartput.xml.in
@@ -50,6 +50,20 @@
<_long>Just place the window when the new size is larger than the old one</_long>
<default>false</default>
</option>
+ <option name="window_minheight" type="int">
+ <_short>Minimal window height</_short>
+ <_long>The minimal height the new window must have at least </_long>
+ <default>50</default>
+ <min>5</min>
+ <max>6000</max>
+ </option>
+ <option name="window_minwidth" type="int">
+ <_short>Minimal window width</_short>
+ <_long>The minimal width the new window must have at least</_long>
+ <default>50</default>
+ <min>5</min>
+ <max>6000</max>
+ </option>
<option name="window_margin" type="int">
<_short>Window margin</_short>
<_long>The distance windows hold between each other</_long>