effect: Refuse starting quick effect if keyboard cannot be grabbed
If effects->grabKeyboard() fails and effects->ungrabKeyboard() is called later, kwin will crash due to an assert in the ungrabKeyboard() function. This matters only on X11.
This commit is contained in:
parent
d474a6795b
commit
95611189d5
1 changed files with 6 additions and 3 deletions
|
@ -500,6 +500,12 @@ void QuickSceneEffect::startInternal()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!effects->grabKeyboard(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
effects->startMouseInterception(this, Qt::ArrowCursor);
|
||||
|
||||
effects->setActiveFullScreenEffect(this);
|
||||
d->running = true;
|
||||
|
||||
|
@ -516,9 +522,6 @@ void QuickSceneEffect::startInternal()
|
|||
|
||||
connect(effects, &EffectsHandler::screenAdded, this, &QuickSceneEffect::handleScreenAdded);
|
||||
connect(effects, &EffectsHandler::screenRemoved, this, &QuickSceneEffect::handleScreenRemoved);
|
||||
|
||||
effects->grabKeyboard(this);
|
||||
effects->startMouseInterception(this, Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
void QuickSceneEffect::stopInternal()
|
||||
|
|
Loading…
Reference in a new issue