effects: Guard against InputMethod being nullptr or not enabled
Apparently InputMethod can be nullptr, in which case we end up dereferencing nullptr when we try to get the input panel.
This commit is contained in:
parent
44184f4700
commit
bd920fb28c
1 changed files with 8 additions and 0 deletions
|
@ -1814,6 +1814,10 @@ qreal EffectsHandlerImpl::renderTargetScale() const
|
|||
|
||||
KWin::EffectWindow *EffectsHandlerImpl::inputPanel() const
|
||||
{
|
||||
if (!InputMethod::self() || !InputMethod::self()->isEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto panel = InputMethod::self()->panel();
|
||||
if (panel) {
|
||||
return panel->effectWindow();
|
||||
|
@ -1823,6 +1827,10 @@ KWin::EffectWindow *EffectsHandlerImpl::inputPanel() const
|
|||
|
||||
bool EffectsHandlerImpl::isInputPanelOverlay() const
|
||||
{
|
||||
if (!InputMethod::self() || !InputMethod::self()->isEnabled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto panel = InputMethod::self()->panel();
|
||||
if (panel) {
|
||||
return panel->mode() == InputPanelV1Client::Overlay;
|
||||
|
|
Loading…
Reference in a new issue