summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--twin/compton-tde/compton.c33
-rw-r--r--twin/kcmtwin/twinoptions/windows.cpp66
-rw-r--r--twin/kcmtwin/twinoptions/windows.h5
3 files changed, 82 insertions, 22 deletions
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 74302da22..dedbfdd09 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -257,8 +257,15 @@ run_fade(session_t *ps, win *w, unsigned steps) {
return;
}
- if (!w->fade)
+#ifdef DEBUG_FADE
+ if (w->fade) {
+ printf_dbgf("(%#010lx): run_fade opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt);
+ }
+#endif
+
+ if (!w->fade) {
w->opacity = w->opacity_tgt;
+ }
else if (steps) {
// Use double below because opacity_t will probably overflow during
// calculations
@@ -2406,6 +2413,10 @@ map_win(session_t *ps, Window id) {
w->in_openclose = true;
set_fade_callback(ps, w, finish_map_win, true);
win_determine_fade(ps, w);
+ if (w->fade) {
+ // Make sure the new window fades in properly
+ w->opacity = 0;
+ }
win_determine_blur_background(ps, w);
@@ -2424,6 +2435,10 @@ map_win(session_t *ps, Window id) {
cdbus_ev_win_mapped(ps, w);
}
#endif
+
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): map_win opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt);
+#endif
}
static void
@@ -2436,6 +2451,7 @@ finish_map_win(session_t *ps, win *w) {
win_determine_fade(ps, w);
}
#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): finish_map_win opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt);
printf_dbgf("(%#010lx): end\n", w->id);
#endif
}
@@ -2676,8 +2692,12 @@ static void
calc_opacity(session_t *ps, win *w) {
opacity_t opacity = OPAQUE;
- if (w->destroyed || IsViewable != w->a.map_state)
+ if (w->destroyed || IsViewable != w->a.map_state) {
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): calc_opacity forcing full transparency\n");
+#endif
opacity = 0;
+ }
else {
// Try obeying opacity property and window type opacity firstly
if (OPAQUE == (opacity = w->opacity_prop)
@@ -2696,6 +2716,9 @@ calc_opacity(session_t *ps, win *w) {
opacity = ps->o.active_opacity;
}
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): calc_opacity opacity: %u\n", w->id, opacity);
+#endif
w->opacity_tgt = opacity;
}
@@ -2739,8 +2762,12 @@ win_determine_fade(session_t *ps, win *w) {
#endif
w->fade = false;
}
- else if (ps->o.no_fading_opacitychange && (!w->in_openclose))
+ else if (ps->o.no_fading_opacitychange && (!w->in_openclose)) {
+#ifdef DEBUG_FADE
+ printf_dbgf("(): no_fading_opacitychange and !in_openclose\n");
+#endif
w->fade = false;
+ }
else if (ps->o.no_fading_destroyed_argb && w->destroyed
&& WMODE_ARGB == w->mode && w->client_win && w->client_win != w->id) {
#ifdef DEBUG_FADE
diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp
index ad207014f..570e72472 100644
--- a/twin/kcmtwin/twinoptions/windows.cpp
+++ b/twin/kcmtwin/twinoptions/windows.cpp
@@ -3,6 +3,7 @@
*
* Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca
* Copyright (c) 2001 Waldo Bastian bastian@kde.org
+ * Copyright (c) 2011-2014 Timothy Pearson <kb9vqf@pearsoncomputing.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1359,6 +1360,8 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
vLay2->addSpacing(11); // to get the proper gb top offset
useShadows = new TQCheckBox(i18n("Use shadows (standard effects should be disabled in the Styles module if this is checked)"),sGroup);
vLay2->addWidget(useShadows);
+ useShadowsOnMenuWindows = new TQCheckBox(i18n("Use shadows on menus (requires menu fade effect to be disabled in the Styles module)"),sGroup);
+ vLay2->addWidget(useShadowsOnMenuWindows);
vLay2->addSpacing(11);
@@ -1475,6 +1478,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(useOpenGL, 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(removeShadowsOnResize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
connect(removeShadowsOnMove, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
@@ -1496,14 +1500,14 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
connect(fadeInSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed()));
connect(fadeOutSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed()));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), dockWindowShadowSize, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), menuWindowShadowSize, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), activeWindowShadowSize, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), inactiveWindowShadowSize, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), baseShadowSize, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowTopOffset, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowLeftOffset, TQT_SLOT(setEnabled(bool)));
- connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowColor, TQT_SLOT(setEnabled(bool)));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), dockWindowShadowSize, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), menuWindowShadowSize, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), activeWindowShadowSize, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), inactiveWindowShadowSize, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), baseShadowSize, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowTopOffset, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowLeftOffset, TQT_SLOT(processShadowLockouts()));
+ connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowColor, TQT_SLOT(processShadowLockouts()));
load();
@@ -1516,6 +1520,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(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
+ connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr()));
connect(inactiveWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr()));
connect(baseShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr()));
connect(shadowTopOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr()));
@@ -1530,6 +1535,20 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
}
}
+void KTranslucencyConfig::processShadowLockouts()
+{
+ bool enabled = (useShadows->isChecked() || useShadowsOnMenuWindows->isChecked());
+
+ dockWindowShadowSize->setEnabled(enabled);
+ menuWindowShadowSize->setEnabled(enabled);
+ activeWindowShadowSize->setEnabled(enabled);
+ inactiveWindowShadowSize->setEnabled(enabled);
+ baseShadowSize->setEnabled(enabled);
+ shadowTopOffset->setEnabled(enabled);
+ shadowLeftOffset->setEnabled(enabled);
+ shadowColor->setEnabled(enabled);
+}
+
void KTranslucencyConfig::resetKompmgr()
{
resetKompmgr_ = TRUE;
@@ -1575,10 +1594,11 @@ void KTranslucencyConfig::load( void )
useOpenGL->setChecked(conf_.readBoolEntry("useOpenGL",FALSE));
useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0);
- shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-200)));
- shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",-200)));
+ useShadowsOnMenuWindows->setChecked(conf_.readBoolEntry("ShadowsOnMenuWindows",TRUE));
+ shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",0)));
+ shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",0)));
- int ss = conf_.readNumEntry("ShadowRadius",6);
+ int ss = conf_.readNumEntry("ShadowRadius",4);
dockWindowShadowSize->setValue((int)(dss/100.0));
menuWindowShadowSize->setValue((int)(mss/100.0));
activeWindowShadowSize->setValue((int)(ass/100.0));
@@ -1641,6 +1661,7 @@ void KTranslucencyConfig::save( void )
conf_->setGroup("xcompmgr");
conf_->writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":"");
+ conf_->writeEntry("ShadowsOnMenuWindows",useShadowsOnMenuWindows->isChecked());
conf_->writeEntry("DisableARGB",disableARGB->isChecked());
conf_->writeEntry("useOpenGL",useOpenGL->isChecked());
conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
@@ -1666,6 +1687,10 @@ void KTranslucencyConfig::save( void )
if ( compton_conf_file_->open( IO_WriteOnly ) ) {
TQTextStream stream(compton_conf_file_);
+ stream << "# WARNING\n";
+ stream << "# This file was automatically generated by TDE\n";
+ stream << "# All changes will be lost!\n";
+
stream << "shadow = " << (useShadows->isChecked()?"true":"false") << ";\n";
stream << "shadow-offset-y = " << (-1*shadowTopOffset->value()) << ";\n";
stream << "shadow-offset-x = " << (-1*shadowLeftOffset->value()) << ";\n";
@@ -1681,14 +1706,18 @@ void KTranslucencyConfig::save( void )
bool fadeOpacity = fadeOnOpacityChange->isChecked();
bool fadeWindows = fadeInWindows->isChecked();
bool fadeMenuWindows = fadeInMenuWindows->isChecked();
+ bool shadows = useShadows->isChecked();
+ bool shadowsOnMenuWindows = useShadowsOnMenuWindows->isChecked();
stream << "fading = " << ((fadeWindows || fadeMenuWindows || fadeOpacity)?"true":"false") << ";\n";
stream << "no-fading-opacitychange = " << (fadeOpacity?"false":"true") << ";\n";
- stream << "no-fading-openclose = " << (fadeWindows?"false":"true") << ";\n";
+ stream << "no-fading-openclose = " << ((fadeWindows||fadeMenuWindows)?"false":"true") << ";\n";
stream << "wintypes:" << "\n";
stream << "{" << "\n";
- stream << " menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
- stream << " dropdown_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
- stream << " popup_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " dropdown_menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " popup_menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n";
+ stream << " normal = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n";
+ stream << " dialog = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n";
stream << "}" << "\n";
stream << "fade-in-step = " << (fadeInSpeed->value()/1000.0) << ";\n";
@@ -1701,7 +1730,7 @@ void KTranslucencyConfig::save( void )
stream << "no-dock-shadow = true;\n";
stream << "no-dnd-shadow = true;\n";
stream << "clear-shadow = true;\n";
- stream << "shadow-ignore-shaped = true;\n";
+ stream << "shadow-ignore-shaped = false;\n";
// Features not currently supported by compton
// stream << "DisableARGB = " << (disableARGB->isChecked()?"true":"false") << ";\n";
@@ -1747,14 +1776,15 @@ void KTranslucencyConfig::defaults()
activeWindowShadowSize->setValue(2);
inactiveWindowShadowSize->setValue(1);
baseShadowSize->setValue(1);
- shadowTopOffset->setValue(200);
- shadowLeftOffset->setValue(200);
+ shadowTopOffset->setValue(0);
+ shadowLeftOffset->setValue(0);
activeWindowOpacity->setEnabled(false);
inactiveWindowOpacity->setEnabled(false);
movingWindowOpacity->setEnabled(false);
dockWindowOpacity->setEnabled(false);
useShadows->setChecked(FALSE);
+ useShadowsOnMenuWindows->setChecked(TRUE);
removeShadowsOnMove->setChecked(FALSE);
removeShadowsOnResize->setChecked(FALSE);
shadowColor->setColor(Qt::black);
diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h
index 27ea02a8d..634960266 100644
--- a/twin/kcmtwin/twinoptions/windows.h
+++ b/twin/kcmtwin/twinoptions/windows.h
@@ -3,6 +3,7 @@
*
* Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca
* Copyright (c) 2001 Waldo Bastian bastian@kde.org
+ * Copyright (c) 2011-2014 Timothy Pearson <kb9vqf@pearsoncomputing.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -263,6 +264,7 @@ private:
TQCheckBox *fadeInMenuWindows;
TQCheckBox *fadeOnOpacityChange;
TQCheckBox *useShadows;
+ TQCheckBox *useShadowsOnMenuWindows;
TQCheckBox *removeShadowsOnResize;
TQCheckBox *removeShadowsOnMove;
TQGroupBox *sGroup;
@@ -283,7 +285,8 @@ private:
KIntNumInput *fadeOutSpeed;
KColorButton *shadowColor;
TDEConfig *config;
- bool standAlone;
+ void processShadowLockouts();
+ bool standAlone;
bool alphaActivated;
bool resetKompmgr_;
bool kompmgrAvailable();