PointBasedWindowSeeker now filters non-matching windows.

RestoreWindowSeeker filtering improved.
This commit is contained in:
Lorenz Cuno Klopfenstein 2013-12-01 13:21:40 +01:00
parent fbf8fae7f0
commit 2155f81d99
2 changed files with 4 additions and 3 deletions

View file

@ -26,6 +26,7 @@ namespace OnTopReplica.WindowSeekers {
//Sort and store
_currentWindowList = (from t in _sortingList
where t.Item1 > 0
orderby t.Item1 descending
select t.Item2).ToList();

View file

@ -32,7 +32,7 @@ namespace OnTopReplica.WindowSeekers {
//Class exact match
if (!string.IsNullOrEmpty(Class)) {
string wndClass = handle.Class;
if (wndClass.StartsWith(Class, StringComparison.InvariantCulture)){
if (wndClass.Equals(Class, StringComparison.InvariantCulture)){
points += 10;
}
}
@ -40,10 +40,10 @@ namespace OnTopReplica.WindowSeekers {
//Title match (may not be exact, but let's try)
if (!string.IsNullOrEmpty(Title) && !string.IsNullOrEmpty(handle.Title)) {
if (handle.Title.StartsWith(Title, StringComparison.InvariantCultureIgnoreCase)) {
points += 10;
points += 5;
}
if (handle.Title.Equals(Title, StringComparison.InvariantCultureIgnoreCase)) {
points += 5;
points += 10;
}
}