diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 9e367866f8..a624ad1947 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -28,6 +28,6 @@ install(TARGETS kwin_update_default_rules DESTINATION ${LIB_INSTALL_DIR}/kconf_u install( FILES fsp_workarounds_1.kwinrules DESTINATION ${DATA_INSTALL_DIR}/kwin/default_rules ) install( FILES pop.wav DESTINATION ${SOUND_INSTALL_DIR} ) -install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) -install(PROGRAMS pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd kwin_on_off.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( PROGRAMS pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh on-off_to_true-false.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) diff --git a/data/kwin_on_off.upd b/data/kwin_on_off.upd new file mode 100644 index 0000000000..845aa933fb --- /dev/null +++ b/data/kwin_on_off.upd @@ -0,0 +1,5 @@ +Id=kwin_on_off +File=kwinrc +Group=Windows +Options=overwrite +Script=on-off_to_true-false.sh,sh diff --git a/data/on-off_to_true-false.sh b/data/on-off_to_true-false.sh new file mode 100644 index 0000000000..a141819b18 --- /dev/null +++ b/data/on-off_to_true-false.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +while read line; do + echo "$line" | sed 's@=\s*on\s*$@=true@g' | sed 's@=\s*off\s*$@=false@g' +done diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 4361b907cc..3521fc21b7 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -456,15 +456,12 @@ void KFocusConfig::load( void ) k = cg.readEntry(KWIN_DELAYFOCUS_INTERVAL,750); setDelayFocusInterval(k); - key = cg.readEntry(KWIN_AUTORAISE); - setAutoRaise(key == "on"); - key = cg.readEntry(KWIN_DELAYFOCUS); - setDelayFocus(key == "on"); - key = cg.readEntry(KWIN_CLICKRAISE); - setClickRaise(key != "off"); + setAutoRaise( cg.readEntry(KWIN_AUTORAISE, false)); + setDelayFocus( cg.readEntry(KWIN_DELAYFOCUS, false)); + setClickRaise( cg.readEntry(KWIN_CLICKRAISE, true)); setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click setDelayFocusEnabled(); - + setSeparateScreenFocus( cg.readEntry(KWIN_SEPARATE_SCREEN_FOCUS, true)); // on by default for non click to focus policies setActiveMouseScreen( cg.readEntry(KWIN_ACTIVE_MOUSE_SCREEN, focusCombo->currentIndex() != 0 )); @@ -505,20 +502,11 @@ void KFocusConfig::save( void ) if (v <0) v = 0; cg.writeEntry(KWIN_DELAYFOCUS_INTERVAL,v); - if (autoRaiseOn->isChecked()) - cg.writeEntry(KWIN_AUTORAISE, "on"); - else - cg.writeEntry(KWIN_AUTORAISE, "off"); + cg.writeEntry(KWIN_AUTORAISE, autoRaiseOn->isChecked()); - if (delayFocusOn->isChecked()) - cg.writeEntry(KWIN_DELAYFOCUS, "on"); - else - cg.writeEntry(KWIN_DELAYFOCUS, "off"); + cg.writeEntry(KWIN_DELAYFOCUS, delayFocusOn->isChecked()); - if (clickRaiseOn->isChecked()) - cg.writeEntry(KWIN_CLICKRAISE, "on"); - else - cg.writeEntry(KWIN_CLICKRAISE, "off"); + cg.writeEntry(KWIN_CLICKRAISE, clickRaiseOn->isChecked()); cg.writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, separateScreenFocus->isChecked()); cg.writeEntry(KWIN_ACTIVE_MOUSE_SCREEN, activeMouseScreen->isChecked()); @@ -751,10 +739,7 @@ void KAdvancedConfig::save( void ) KConfigGroup cg(config, "Windows"); cg.writeEntry(KWIN_ANIMSHADE, animateShade->isChecked()); - if (shadeHoverOn->isChecked()) - cg.writeEntry(KWIN_SHADEHOVER, "on"); - else - cg.writeEntry(KWIN_SHADEHOVER, "off"); + cg.writeEntry(KWIN_SHADEHOVER, shadeHoverOn->isChecked()); v = getShadeHoverInterval(); if (v<0) v = 0;