added new option to disable ARGB windows (this fixes gtk1 applications as long as there are no usefull ARGB windows like real translucent dockers/konsole/popups/whatever)

svn path=/trunk/kdebase/kwin/; revision=381856
icc-effect-5.14.5
Thomas Lübking 2005-01-24 07:56:41 +00:00
parent 73379a6519
commit a5fe22ddfe
3 changed files with 24 additions and 55 deletions

View File

@ -1229,6 +1229,10 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
keepAboveAsActive = new QCheckBox(i18n("Treat 'keep above' windows as active ones"),tGroup);
vLay->addWidget(keepAboveAsActive);
disableARGB = new QCheckBox(i18n("Disable ARGB windows (ignores window alpha maps, fixes gtk1 apps)"),tGroup);
vLay->addWidget(disableARGB);
vLay->addStretch();
tabW->addTab(tGroup, i18n("Translucency"));
@ -1323,6 +1327,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
connect(movingWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(dockWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(keepAboveAsActive, SIGNAL(toggled(bool)), SLOT(changed()));
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(changed()));
connect(useShadows, SIGNAL(toggled(bool)), SLOT(changed()));
connect(removeShadowsOnResize, SIGNAL(toggled(bool)), SLOT(changed()));
@ -1356,6 +1361,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
// handle kompmgr restarts if necessary
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(useShadows, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(inactiveWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
connect(shadowTopOffset, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
@ -1404,6 +1410,8 @@ void KTranslucencyConfig::load( void )
KConfig conf_(QDir::homeDirPath() + "/.xcompmgrrc");
conf_.setGroup("xcompmgr");
disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE));
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-80)));
@ -1462,6 +1470,7 @@ void KTranslucencyConfig::save( void )
conf_->setGroup("xcompmgr");
conf_->writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":"");
conf_->writeEntry("DisableARGB",disableARGB->isChecked());
conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value());
@ -1497,6 +1506,7 @@ void KTranslucencyConfig::defaults()
movingWindowTransparency->setChecked(false);
dockWindowTransparency->setChecked(true);
keepAboveAsActive->setChecked(true);
disableARGB->setChecked(false);
activeWindowOpacity->setValue(100);
inactiveWindowOpacity->setValue(50);

View File

@ -246,6 +246,7 @@ private:
QCheckBox *movingWindowTransparency;
QCheckBox *dockWindowTransparency;
QCheckBox *keepAboveAsActive;
QCheckBox *disableARGB;
QCheckBox *fadeInWindows;
QCheckBox *fadeOnOpacityChange;
QCheckBox *useShadows;

View File

@ -139,6 +139,7 @@ int composite_event, composite_error;
int render_event, render_error;
Bool synchronize;
int composite_opcode;
Bool disable_argb = False;
int shapeEvent;
@ -391,8 +392,6 @@ run_fades (Display *dpy)
dequeue_fade (dpy, f);
}
}
/*if (w->fadesBlocked)
clipChanged = False;*/
determine_mode (dpy, w);
if (w->shadow)
{
@ -1493,7 +1492,7 @@ determine_mode(Display *dpy, win *w)
format = XRenderFindVisualFormat (dpy, w->a.visual);
}
if (format && format->type == PictTypeDirect && format->direct.alphaMask)
if (!disable_argb && format && format->type == PictTypeDirect && format->direct.alphaMask)
{
mode = WINDOW_ARGB;
}
@ -2014,6 +2013,7 @@ typedef enum _option{
FadeOutStep,
FadeInStep,
FadeDelta,
DisableARGB,
NUMBEROFOPTIONS
} Option;
@ -2034,6 +2034,7 @@ options[NUMBEROFOPTIONS] = {
"FadeOutStep", /*12*/
"FadeInStep", /*13*/
"FadeDelta", /*14*/
"DisableARGB", /*15*/
/*put your thingy in here...*/
};
@ -2045,106 +2046,63 @@ setValue(Option option, char *value ){
fade_delta = atoi(value);
if (fade_delta < 1)
fade_delta = 10;
printf("config: using fade_delta: \t\t%d\n", fade_delta);
break;
case FadeInStep:
fade_in_step = atof(value);
if (fade_in_step <= 0)
fade_in_step = 0.01;
printf("config: using fade_in_step: \t\t%f\n", fade_in_step);
break;
case FadeOutStep:
fade_out_step = atof(value);
if (fade_out_step <= 0)
fade_out_step = 0.01;
printf("config: using fade_out_step: \t\t%f\n", fade_out_step);
break;
case ShadowOffsetY:
shadowOffsetY = atoi(value);
printf("config: using shadowOffsetY: \t\t%d\n", shadowOffsetY);
break;
case ShadowOffsetX:
shadowOffsetX = atoi(value);
printf("config: using shadowOffsetX: \t\t%d\n", shadowOffsetX);
break;
case ShadowOpacity:
shadowOpacity = atof(value);
printf("config: using shadowOpacity: \t\t%f\n", shadowOpacity);
break;
case ShadowRadius:
shadowRadius = atoi(value);
printf("config: using shadowRadius: \t\t%d\n", shadowRadius);
break;
case ShadowColor:
setShadowColor(value);
break;
case Synchronize:
if( strcasecmp(value, "true") == 0 ){
synchronize = True;
printf("config: using synchronize: \t\tTrue\n");
}
else{
synchronize = False;
printf("config: using synchronize: \t\tFalse\n");
}
synchronize = ( strcasecmp(value, "true") == 0 );
break;
case AutoRedirect:
if( strcasecmp(value, "true") == 0 ){
autoRedirect = True;
printf("config: using autoredirect: \t\tTrue\n");
}
else{
autoRedirect = False;
printf("config: using autoredirect: \t\tFalse\n");
}
autoRedirect = ( strcasecmp(value, "true") == 0 );
break;
case FadeTrans:
if( strcasecmp(value, "true") == 0 ){
fadeTrans = True;
printf("config: using fadetrans: \t\tTrue\n");
}
else{
fadeTrans = False;
printf("config: using fadetrans: \t\tFalse\n");
}
fadeTrans = ( strcasecmp(value, "true") == 0 );
break;
case FadeWindows:
if( strcasecmp(value, "true") == 0 ){
fadeWindows = True;
printf("config: using fadewindows: \t\tTrue\n");
}
else{
fadeWindows = False;
printf("config: using fadewindows: \t\tFalse\n");
}
fadeWindows = ( strcasecmp(value, "true") == 0 );
break;
case ExcludeDockShadows:
if( strcasecmp(value, "true") == 0 ){
excludeDockShadows = True;
printf("config: using excludeDockShadows: \tTrue\n");
}
else{
excludeDockShadows = False;
printf("config: using excludeDockShadows: \tFalse\n");
}
excludeDockShadows = ( strcasecmp(value, "true") == 0 );
break;
case Compmode:
if( strcasecmp(value, "CompClientShadows") == 0 ){
compMode = CompClientShadows;
printf("config: using compMode: \t\tCompClientShadows\n");
}
else if( strcasecmp(value, "CompServerShadows") == 0 ){
compMode = CompServerShadows;
printf("config: using compMode: \t\tCompServerShadows\n");
}
else{
compMode = CompSimple; /*default*/
printf("config: using compMode: \t\tCompSimple\n");
}
break;
case Display_:
display = strdup(value);
printf("config: using display: \t\t\t%s\n", display);
break;
case DisableARGB:
disable_argb = ( strcasecmp(value, "true") == 0 );
break;
default:
break;
@ -2444,7 +2402,7 @@ main (int argc, char **argv)
/*shaping stuff*/
int dummy;
XShapeQueryExtension(dpy, &shapeEvent, &dummy);
printf("shapeEvent: %d\n",shapeEvent);
XQueryTree (dpy, root, &root_return, &parent_return, &children, &nchildren);
for (i = 0; i < nchildren; i++)
add_win (dpy, children[i], i ? children[i-1] : None);