summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-07-04 11:58:38 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-07-04 11:58:38 +0800
commit8322d599d1114f03ca0d5fedb558bc9762c87826 (patch)
tree3def617f6c92c7ec4391bc6635fd48aa2e58c412
parent69853362ce790395d7541872918d820442554b71 (diff)
downloadwinrules-8322d599d1114f03ca0d5fedb558bc9762c87826.tar.gz
winrules-8322d599d1114f03ca0d5fedb558bc9762c87826.tar.bz2
Window Rules needs regex to do anything remotely useful, unless the user wants to be matching on type all the time, so depend on it
-rw-r--r--src/winrules.cpp9
-rw-r--r--winrules.xml.in3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/winrules.cpp b/src/winrules.cpp
index 7df4031..985451c 100644
--- a/src/winrules.cpp
+++ b/src/winrules.cpp
@@ -207,11 +207,14 @@ WinrulesWindow::matchSizeValue (CompOption::Value::Vector matches,
min = MIN (matches.size (), widthValues.size ());
min = MIN ((unsigned int) min, heightValues.size ());
+ min = MIN ((unsigned int) min, matches.size ());
- for (int i = 0; i < min; i++)
+ for (unsigned int i = 0; i < min; i++)
{
- if ((ws->getOptions ().at (i).value ().match ().evaluate (window)))
+ fprintf (stderr, "checking %i\n", i);
+ if ((matches.at (i).match ().evaluate (window)))
{
+ fprintf (stderr, "found one!\n");
*width = widthValues.at (i).i ();
*height = heightValues.at (i).i ();
@@ -227,6 +230,8 @@ WinrulesWindow::matchSize (int *width,
int *height)
{
WINRULES_SCREEN (screen);
+
+ fprintf (stderr, "matchSize called!\n");
return matchSizeValue (ws->optionGetSizeMatches (),
ws->optionGetSizeWidthValues (),
diff --git a/winrules.xml.in b/winrules.xml.in
index a8fd669..4418adf 100644
--- a/winrules.xml.in
+++ b/winrules.xml.in
@@ -10,6 +10,9 @@
<plugin>composite</plugin>
<plugin>decor</plugin>
</relation>
+ <requirement>
+ <plugin>regex</plugin>
+ </requirement>
</deps>
<options>
<group>