summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-04-04 10:14:12 +0200
committerDanny Baumann <dannybaumann@web.de>2008-04-04 10:14:12 +0200
commit8ab4d9a0348c4b2c2cad853cd44a88ad94c959e8 (patch)
tree4343a48dc0758ad6de8acf419c17e95fc4ec3d3c
parentd73c94486e2c9336944224b65f69a8e4848a231d (diff)
downloadwinrules-8ab4d9a0348c4b2c2cad853cd44a88ad94c959e8.tar.gz
winrules-8ab4d9a0348c4b2c2cad853cd44a88ad94c959e8.tar.bz2
Properly restore input hint and window protocols.
-rw-r--r--winrules.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/winrules.c b/winrules.c
index 780ecb3..8e36dfd 100644
--- a/winrules.c
+++ b/winrules.c
@@ -57,6 +57,7 @@ typedef struct _WinrulesWindow {
unsigned int stateSetMask;
unsigned int protocolSetMask;
+ Bool oldInputHint;
Bool hasAlpha;
} WinrulesWindow;
@@ -146,16 +147,20 @@ winrulesSetNoFocus (CompWindow *w,
{
if (w->protocols & CompWindowProtocolTakeFocusMask)
{
- newProtocol = w->protocols & ~CompWindowProtocolTakeFocusMask;
- ww->protocolSetMask |= CompWindowProtocolTakeFocusMask;
- w->inputHint = FALSE;
+ ww->protocolSetMask |= (w->protocols &
+ CompWindowProtocolTakeFocusMask);
+ newProtocol = w->protocols & ~CompWindowProtocolTakeFocusMask;
+ ww->oldInputHint = w->inputHint;
+ w->inputHint = FALSE;
}
}
- else if (ww->protocolSetMask & CompWindowProtocolTakeFocusMask)
+ else if (ww->oldInputHint ||
+ (ww->protocolSetMask & CompWindowProtocolTakeFocusMask))
{
- newProtocol = w->protocols & CompWindowProtocolTakeFocusMask;
+ newProtocol = w->protocols |
+ (ww->protocolSetMask & CompWindowProtocolTakeFocusMask);
ww->protocolSetMask &= ~CompWindowProtocolTakeFocusMask;
- w->inputHint = TRUE;
+ w->inputHint = ww->oldInputHint;
}
if (newProtocol != w->protocols)
@@ -715,7 +720,8 @@ winrulesInitWindow (CompPlugin *p,
ww->allowedActions = ~0;
- ww->hasAlpha = w->alpha;
+ ww->hasAlpha = w->alpha;
+ ww->oldInputHint = w->inputHint;
w->base.privates[ws->windowPrivateIndex].ptr = ww;