From 0ae6c2cec5d73318142affc876653b0357937575 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 25 Nov 2014 14:22:07 -0600 Subject: [PATCH] Fix blur option not being written correctly Add ability to set desaturated backgrounds from the control center --- twin/compton-tde/compton.c | 2 +- twin/kcmtwin/twinoptions/windows.cpp | 13 ++++++++++++- twin/kcmtwin/twinoptions/windows.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c index d2095123f..4a78f7f8a 100644 --- a/twin/compton-tde/compton.c +++ b/twin/compton-tde/compton.c @@ -2512,10 +2512,10 @@ map_win(session_t *ps, Window id) { /* This needs to be here since we don't get PropertyNotify when unmapped */ w->opacity = wid_get_opacity_prop(ps, w->id, OPAQUE); - w->greyscale_background = determine_window_transparency_filter_greyscale(ps, id); w->greyscale_blended_background = determine_window_transparency_filter_greyscale_blended(ps, id); w->show_root_tile = determine_window_transparent_to_desktop(ps, id); w->show_black_background = determine_window_transparent_to_black(ps, id); + win_determine_greyscale_background(ps, w); // Update window mode here to check for ARGB windows win_determine_mode(ps, w); diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp index 30d48d15d..3e2757545 100644 --- a/twin/kcmtwin/twinoptions/windows.cpp +++ b/twin/kcmtwin/twinoptions/windows.cpp @@ -1349,9 +1349,12 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, vLay->addWidget(useOpenGL); blurBackground = new TQCheckBox(i18n("Blur the background of transparent windows"),tGroup); vLay->addWidget(blurBackground); + greyscaleBackground = new TQCheckBox(i18n("Desaturate the background of transparent windows"),tGroup); + vLay->addWidget(greyscaleBackground); if (TDECompositor != "compton-tde") { useOpenGL->hide(); blurBackground->hide(); + greyscaleBackground->hide(); } vLay->addStretch(); @@ -1490,6 +1493,8 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useOpenGL, TQT_SIGNAL(toggled(bool)), blurBackground, TQT_SLOT(setEnabled(bool))); connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(useOpenGL, TQT_SIGNAL(toggled(bool)), greyscaleBackground, TQT_SLOT(setEnabled(bool))); + connect(greyscaleBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); @@ -1530,6 +1535,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(greyscaleBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); @@ -1607,6 +1613,8 @@ void KTranslucencyConfig::load( void ) useOpenGL->setChecked(conf_.readBoolEntry("useOpenGL",FALSE)); blurBackground->setChecked(conf_.readBoolEntry("blurBackground",FALSE)); blurBackground->setEnabled(useOpenGL->isChecked()); + greyscaleBackground->setChecked(conf_.readBoolEntry("greyscaleBackground",FALSE)); + greyscaleBackground->setEnabled(useOpenGL->isChecked()); useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0); useShadowsOnMenuWindows->setChecked(conf_.readBoolEntry("ShadowsOnMenuWindows",TRUE)); @@ -1683,6 +1691,7 @@ void KTranslucencyConfig::save( void ) conf_->writeEntry("DisableARGB",disableARGB->isChecked()); conf_->writeEntry("useOpenGL",useOpenGL->isChecked()); conf_->writeEntry("blurBackground",blurBackground->isChecked()); + conf_->writeEntry("greyscaleBackground",greyscaleBackground->isChecked()); conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value()); conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value()); @@ -1759,13 +1768,15 @@ void KTranslucencyConfig::save( void ) stream << "backend = \"" << (useOpenGL->isChecked()?"glx":"xrender") << "\";\n"; stream << "vsync = \"" << (useOpenGL->isChecked()?"opengl":"none") << "\";\n"; - stream << "blur-background = \"" << ((blurBackground->isChecked() && useOpenGL->isChecked())?"true":"false") << "\";\n"; + stream << "blur-background = " << ((blurBackground->isChecked() && useOpenGL->isChecked())?"true":"false") << ";\n"; stream << "blur-background-fixed = true;\n"; stream << "blur-background-exclude = [\n"; stream << " \"window_type = 'dock'\",\n"; stream << " \"window_type = 'desktop'\"\n"; stream << "];\n"; + stream << "greyscale-background = " << ((greyscaleBackground->isChecked() && useOpenGL->isChecked())?"true":"false") << ";\n"; + // Global settings stream << "no-dock-shadow = true;\n"; stream << "no-dnd-shadow = true;\n"; diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h index facde4136..52596ad1c 100644 --- a/twin/kcmtwin/twinoptions/windows.h +++ b/twin/kcmtwin/twinoptions/windows.h @@ -261,6 +261,7 @@ private: TQCheckBox *disableARGB; TQCheckBox *useOpenGL; TQCheckBox *blurBackground; + TQCheckBox *greyscaleBackground; TQCheckBox *fadeInWindows; TQCheckBox *fadeInMenuWindows; TQCheckBox *fadeInToolTipWindows;