[kcmscreenedges] Call reconfigureEffect on save

Explicitly call reconfigureEffect on the Effects which can be enabled
through the screenedges kcm.

BUG: 334791
REVIEW: 118138
This commit is contained in:
Martin Gräßlin 2014-05-15 08:34:04 +02:00
parent 365d75ad06
commit 7f04a76b9a
2 changed files with 10 additions and 0 deletions

View file

@ -9,6 +9,8 @@ set(
screenpreviewwidget.cpp screenpreviewwidget.cpp
) )
ki18n_wrap_ui( kcm_kwinscreenedges_PART_SRCS main.ui ) ki18n_wrap_ui( kcm_kwinscreenedges_PART_SRCS main.ui )
qt5_add_dbus_interface( kcm_kwinscreenedges_PART_SRCS
${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
add_library( kcm_kwinscreenedges MODULE ${kcm_kwinscreenedges_PART_SRCS} ) add_library( kcm_kwinscreenedges MODULE ${kcm_kwinscreenedges_PART_SRCS} )
target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES} target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES}
Qt5::DBus Qt5::DBus

View file

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "main.h" #include "main.h"
#include <effect_builtins.h> #include <effect_builtins.h>
#include <kwin_effects_interface.h>
#include <KAboutData> #include <KAboutData>
#include <KConfigGroup> #include <KConfigGroup>
@ -123,6 +124,13 @@ void KWinScreenEdgesConfig::save()
// Reload KWin. // Reload KWin.
QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message); QDBusConnection::sessionBus().send(message);
// and reconfigure the effects
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::PresentWindows));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::DesktopGrid));
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::Cube));
emit changed(false); emit changed(false);
} }