diff --git a/plugins/platforms/x11/standalone/effects_x11.cpp b/plugins/platforms/x11/standalone/effects_x11.cpp index adb26de433..7a8134824d 100644 --- a/plugins/platforms/x11/standalone/effects_x11.cpp +++ b/plugins/platforms/x11/standalone/effects_x11.cpp @@ -43,7 +43,17 @@ EffectsHandlerImplX11::EffectsHandlerImplX11(Compositor *compositor, Scene *scen ); } -EffectsHandlerImplX11::~EffectsHandlerImplX11() = default; +EffectsHandlerImplX11::~EffectsHandlerImplX11() +{ + // EffectsHandlerImpl tries to unload all effects when it's destroyed. + // The routine that unloads effects makes some calls (indirectly) to + // doUngrabKeyboard and doStopMouseInterception, which are virtual. + // Given that any call to a virtual function in the destructor of a base + // class will never go to a derived class, we have to unload effects + // here. Yeah, this is quite a bit ugly but it's fine; someday, X11 + // will be dead (or not?). + unloadAllEffects(); +} bool EffectsHandlerImplX11::doGrabKeyboard() { diff --git a/plugins/platforms/x11/standalone/effects_x11.h b/plugins/platforms/x11/standalone/effects_x11.h index 738bf55ca4..94c83b221e 100644 --- a/plugins/platforms/x11/standalone/effects_x11.h +++ b/plugins/platforms/x11/standalone/effects_x11.h @@ -35,7 +35,7 @@ class EffectsHandlerImplX11 : public EffectsHandlerImpl Q_OBJECT public: explicit EffectsHandlerImplX11(Compositor *compositor, Scene *scene); - virtual ~EffectsHandlerImplX11(); + ~EffectsHandlerImplX11() override; void defineCursor(Qt::CursorShape shape) override;