summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-10-08 18:45:25 +0800
committerSam Spilsbury <smspillaz@gmail.com>2009-10-08 18:45:25 +0800
commit1daf139b099744d336ddf3e16e892e8192da7d6e (patch)
tree4dc8ba0bfc1e1443260b86a5562d325484c2ef20
parente6945a6badbe3ebd62a52cf3979f9a46d73a1470 (diff)
downloadwinrules-1daf139b099744d336ddf3e16e892e8192da7d6e.tar.gz
winrules-1daf139b099744d336ddf3e16e892e8192da7d6e.tar.bz2
Fix no focus bug, fix typos and remove debug messages
-rw-r--r--src/winrules.cpp24
-rw-r--r--src/winrules.h1
2 files changed, 19 insertions, 6 deletions
diff --git a/src/winrules.cpp b/src/winrules.cpp
index f2bcb6f..bb538dc 100644
--- a/src/winrules.cpp
+++ b/src/winrules.cpp
@@ -63,6 +63,14 @@ WinrulesWindow::isFocussable ()
}
bool
+WinrulesWindow::focus ()
+{
+ window->focus ();
+
+ return false; // We only want to return false for the window we are wrapped
+}
+
+bool
WinrulesWindow::alpha ()
{
window->alpha ();
@@ -82,6 +90,7 @@ WinrulesWindow::setNoFocus (int optNum)
if (ws->getOptions ().at (optNum). value ().match ().evaluate (window))
{
+
if (window->protocols () & CompWindowProtocolTakeFocusMask)
{
protocolSetMask |= (window->protocols () &
@@ -90,6 +99,8 @@ WinrulesWindow::setNoFocus (int optNum)
}
window->isFocussableSetEnabled (this, true);// causes w->isFocussable ()
// to return false
+ window->focusSetEnabled (this, true); // causes w->focus () to return
+ // false for this window
}
else if ((protocolSetMask & CompWindowProtocolTakeFocusMask))
{
@@ -97,6 +108,7 @@ WinrulesWindow::setNoFocus (int optNum)
(protocolSetMask & CompWindowProtocolTakeFocusMask);
protocolSetMask &= ~CompWindowProtocolTakeFocusMask;
window->isFocussableSetEnabled (this, false);
+ window->focusSetEnabled (this, true);
}
if (newProtocol != window->protocols ())
@@ -271,7 +283,7 @@ WinrulesScreen::optionChanged (CompOption *option,
case WinrulesOptions::FullscreenMatch:
updateStateMask = CompWindowStateFullscreenMask;
break;
- case WinrulesOptions::NoMaximizeMatch:
+ case WinrulesOptions::MaximizeMatch:
updateStateMask = CompWindowStateMaximizedHorzMask |
CompWindowStateMaximizedVertMask;
break;
@@ -284,14 +296,14 @@ WinrulesScreen::optionChanged (CompOption *option,
case WinrulesOptions::NoMinimizeMatch:
updateActionsMask = CompWindowActionMinimizeMask;
break;
- case WinrulesOptions::NoCloseMatch:
+ case WinrulesOptions::NoMaximizeMatch:
updateActionsMask = CompWindowActionMaximizeVertMask |
CompWindowActionMaximizeHorzMask;
break;
- case WinrulesOptions::NoArgbMatch:
+ case WinrulesOptions::NoCloseMatch:
updateActionsMask = CompWindowActionCloseMask;
break;
- case WinrulesOptions::NoFocusMatch:
+ case WinrulesOptions::NoArgbMatch:
foreach (CompWindow *w, screen->windows ())
{
WINRULES_WINDOW (w);
@@ -408,8 +420,6 @@ void
WinrulesWindow::getAllowedActions (unsigned int &setActions,
unsigned int &clearActions)
{
- fprintf (stderr, "getAllowedActions called\n");
-
window->getAllowedActions (setActions, clearActions);
clearActions |= ~allowedActions;
@@ -515,6 +525,7 @@ WinrulesWindow::WinrulesWindow (CompWindow *window) :
window->isFocussableSetEnabled (this, false);
window->alphaSetEnabled (this, false);
+ window->focusSetEnabled (this, false);
timer.setCallback (boost::bind(&WinrulesWindow::applyRules, this));
timer.setTimes (0, 0);
@@ -531,3 +542,4 @@ WinrulesPluginVTable::init ()
return true;
}
+
diff --git a/src/winrules.h b/src/winrules.h
index 7d3694a..5aaf757 100644
--- a/src/winrules.h
+++ b/src/winrules.h
@@ -106,6 +106,7 @@ class WinrulesWindow :
bool alpha ();
bool isFocussable ();
+ bool focus ();
unsigned int allowedActions;
unsigned int stateSetMask;