Don't crash when XGrabKeyboard() fails for some reason.

svn path=/trunk/KDE/kdebase/workspace/; revision=798523
This commit is contained in:
Luboš Luňák 2008-04-18 14:04:11 +00:00
parent c1b759bd10
commit 0af83a41ec

View file

@ -298,7 +298,10 @@ bool grabXKeyboard( Window w )
void ungrabXKeyboard()
{
assert( keyboard_grabbed );
if( !keyboard_grabbed )
{ // grabXKeyboard() may fail sometimes, so don't fail, but at least warn anyway
kDebug() << "ungrabXKeyboard() called but keyboard not grabbed!";
}
keyboard_grabbed = false;
XUngrabKeyboard( display(), xTime());
}