diff --git a/kcms/touchpad/src/kded/kded.h b/kcms/touchpad/src/kded/kded.h --- a/kcms/touchpad/src/kded/kded.h +++ b/kcms/touchpad/src/kded/kded.h @@ -23,8 +23,10 @@ #include #include #include +#include #include +#include #include "touchpadbackend.h" #include "kdedsettings.h" @@ -78,6 +80,8 @@ bool m_workingTouchpadFound; bool m_keyboardActivity, m_mouse; + QPointer m_notification; + bool m_preparingForSleep = false; }; diff --git a/kcms/touchpad/src/kded/kded.cpp b/kcms/touchpad/src/kded/kded.cpp --- a/kcms/touchpad/src/kded/kded.cpp +++ b/kcms/touchpad/src/kded/kded.cpp @@ -226,7 +226,11 @@ void TouchpadDisabler::showNotification(const QString &name, const QString &text) { - KNotification::event(name, text, QPixmap(), //Icon is specified in .notifyrc + if (m_notification) { + m_notification->close(); + } + + m_notification = KNotification::event(name, text, QPixmap(), //Icon is specified in .notifyrc 0, KNotification::CloseOnTimeout, "kcm_touchpad"); // this has to match the name of the .notifyrc file