redesigned partial opacity (moved from kompmgr to kwin, allowing to be set e.g. from decos) and (hopefully) fixed CPU hunger (if using fades)
svn path=/trunk/KDE/kdebase/kwin/; revision=430562
This commit is contained in:
parent
229690ab71
commit
d6b4366c51
9 changed files with 185 additions and 172 deletions
|
@ -79,8 +79,8 @@ Atoms::Atoms()
|
||||||
atoms[n] = &net_wm_window_shapable;
|
atoms[n] = &net_wm_window_shapable;
|
||||||
names[n++] = (char*) "_KDE_WM_WINDOW_SHAPABLE";
|
names[n++] = (char*) "_KDE_WM_WINDOW_SHAPABLE";
|
||||||
|
|
||||||
atoms[n] = &net_wm_window_titleheight;
|
atoms[n] = &net_wm_window_decohash;
|
||||||
names[n++] = (char*) "_KDE_WM_WINDOW_TITLEHEIGHT";
|
names[n++] = (char*) "_KDE_WM_WINDOW_DECOHASH";
|
||||||
|
|
||||||
Atom fake;
|
Atom fake;
|
||||||
atoms[n] = &fake;
|
atoms[n] = &fake;
|
||||||
|
|
2
atoms.h
2
atoms.h
|
@ -41,7 +41,7 @@ class Atoms
|
||||||
Atom net_wm_window_shadow;
|
Atom net_wm_window_shadow;
|
||||||
Atom net_wm_window_shade;
|
Atom net_wm_window_shade;
|
||||||
Atom net_wm_window_shapable;
|
Atom net_wm_window_shapable;
|
||||||
Atom net_wm_window_titleheight;
|
Atom net_wm_window_decohash;
|
||||||
Atom xdnd_aware;
|
Atom xdnd_aware;
|
||||||
Atom xdnd_position;
|
Atom xdnd_position;
|
||||||
Atom net_frame_extents;
|
Atom net_frame_extents;
|
||||||
|
|
27
client.cpp
27
client.cpp
|
@ -277,7 +277,9 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
|
||||||
XReparentWindow( qt_xdisplay(), decoration->widget()->winId(), frameId(), 0, 0 );
|
XReparentWindow( qt_xdisplay(), decoration->widget()->winId(), frameId(), 0, 0 );
|
||||||
decoration->widget()->lower();
|
decoration->widget()->lower();
|
||||||
decoration->borders( border_left, border_right, border_top, border_bottom );
|
decoration->borders( border_left, border_right, border_top, border_bottom );
|
||||||
setXTitleHeightProperty(border_top);
|
options->onlyDecoTranslucent ?
|
||||||
|
setDecoHashProperty(border_top, border_right, border_bottom, border_left):
|
||||||
|
unsetDecoHashProperty();
|
||||||
int save_workarea_diff_x = workarea_diff_x;
|
int save_workarea_diff_x = workarea_diff_x;
|
||||||
int save_workarea_diff_y = workarea_diff_y;
|
int save_workarea_diff_y = workarea_diff_y;
|
||||||
move( calculateGravitation( false ));
|
move( calculateGravitation( false ));
|
||||||
|
@ -327,10 +329,15 @@ void Client::checkBorderSizes()
|
||||||
move( calculateGravitation( true ));
|
move( calculateGravitation( true ));
|
||||||
border_left = new_left;
|
border_left = new_left;
|
||||||
border_right = new_right;
|
border_right = new_right;
|
||||||
if (border_top != new_top)
|
|
||||||
setXTitleHeightProperty(new_top);
|
|
||||||
border_top = new_top;
|
border_top = new_top;
|
||||||
border_bottom = new_bottom;
|
border_bottom = new_bottom;
|
||||||
|
if (border_left != new_left ||
|
||||||
|
border_right != new_right ||
|
||||||
|
border_top != new_top ||
|
||||||
|
border_bottom != new_bottom)
|
||||||
|
options->onlyDecoTranslucent ?
|
||||||
|
setDecoHashProperty(new_top, new_right, new_bottom, new_left):
|
||||||
|
unsetDecoHashProperty();
|
||||||
move( calculateGravitation( false ));
|
move( calculateGravitation( false ));
|
||||||
plainResize( sizeForClientSize( clientSize()), ForceGeometrySet );
|
plainResize( sizeForClientSize( clientSize()), ForceGeometrySet );
|
||||||
checkWorkspacePosition();
|
checkWorkspacePosition();
|
||||||
|
@ -2043,10 +2050,18 @@ bool Client::touches(const Client* c)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::setXTitleHeightProperty(int titleHeight)
|
void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth)
|
||||||
{
|
{
|
||||||
long data = titleHeight;
|
long data = (topHeight < 255 ? topHeight : 255) << 24 |
|
||||||
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_titleheight, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
|
(rightWidth < 255 ? rightWidth : 255) << 16 |
|
||||||
|
(bottomHeight < 255 ? bottomHeight : 255) << 8 |
|
||||||
|
(leftWidth < 255 ? leftWidth : 255);
|
||||||
|
XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_decohash, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &data, 1L);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::unsetDecoHashProperty()
|
||||||
|
{
|
||||||
|
XDeleteProperty( qt_xdisplay(), frameId(), atoms->net_wm_window_decohash);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
3
client.h
3
client.h
|
@ -395,7 +395,8 @@ class Client : public QObject, public KDecorationDefines
|
||||||
void ungrabButton( int mod );
|
void ungrabButton( int mod );
|
||||||
void resetMaximize();
|
void resetMaximize();
|
||||||
void resizeDecoration( const QSize& s );
|
void resizeDecoration( const QSize& s );
|
||||||
void setXTitleHeightProperty(int titleHeight);
|
void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
|
||||||
|
void unsetDecoHashProperty();
|
||||||
|
|
||||||
void pingWindow();
|
void pingWindow();
|
||||||
void killProcess( bool ask, Time timestamp = CurrentTime );
|
void killProcess( bool ask, Time timestamp = CurrentTime );
|
||||||
|
|
|
@ -1216,15 +1216,8 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
|
||||||
QVBoxLayout *vLay = new QVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint());
|
QVBoxLayout *vLay = new QVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint());
|
||||||
vLay->addSpacing(11); // to get the proper gb top offset
|
vLay->addSpacing(11); // to get the proper gb top offset
|
||||||
|
|
||||||
QHBoxLayout *hLay = new QHBoxLayout(vLay);
|
onlyDecoTranslucent = new QCheckBox(i18n("Apply translucency only to decoration"),tGroup);
|
||||||
QLabel *label0 = new QLabel(i18n("Apply translucency on"),tGroup);
|
vLay->addWidget(onlyDecoTranslucent);
|
||||||
hLay->addWidget(label0);
|
|
||||||
transMode = new QComboBox(tGroup);
|
|
||||||
transMode->insertItem (i18n("The whole window"));
|
|
||||||
transMode->insertItem (i18n("The titlebar only"));
|
|
||||||
transMode->insertItem (i18n("The content only"));
|
|
||||||
hLay->addWidget(transMode);
|
|
||||||
hLay->addStretch();
|
|
||||||
|
|
||||||
vLay->addSpacing(11);
|
vLay->addSpacing(11);
|
||||||
|
|
||||||
|
@ -1361,7 +1354,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
|
||||||
connect(dockWindowTransparency, SIGNAL(toggled(bool)), dockWindowOpacity, SLOT(setEnabled(bool)));
|
connect(dockWindowTransparency, SIGNAL(toggled(bool)), dockWindowOpacity, SLOT(setEnabled(bool)));
|
||||||
|
|
||||||
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(changed()));
|
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(changed()));
|
||||||
connect(transMode, SIGNAL(activated(int)), SLOT(changed()));
|
connect(onlyDecoTranslucent, SIGNAL(toggled(bool)), SLOT(changed()));
|
||||||
connect(activeWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
connect(activeWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
||||||
connect(inactiveWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
connect(inactiveWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
||||||
connect(movingWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
connect(movingWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
|
||||||
|
@ -1402,7 +1395,6 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QW
|
||||||
|
|
||||||
// handle kompmgr restarts if necessary
|
// handle kompmgr restarts if necessary
|
||||||
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
||||||
connect(transMode, SIGNAL(activated(int)), SLOT(resetKompmgr()));
|
|
||||||
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
||||||
connect(useShadows, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
connect(useShadows, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
|
||||||
connect(inactiveWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
|
connect(inactiveWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
|
||||||
|
@ -1433,10 +1425,11 @@ void KTranslucencyConfig::load( void )
|
||||||
activeWindowTransparency->setChecked(config->readBoolEntry("TranslucentActiveWindows",false));
|
activeWindowTransparency->setChecked(config->readBoolEntry("TranslucentActiveWindows",false));
|
||||||
inactiveWindowTransparency->setChecked(config->readBoolEntry("TranslucentInactiveWindows",true));
|
inactiveWindowTransparency->setChecked(config->readBoolEntry("TranslucentInactiveWindows",true));
|
||||||
movingWindowTransparency->setChecked(config->readBoolEntry("TranslucentMovingWindows",false));
|
movingWindowTransparency->setChecked(config->readBoolEntry("TranslucentMovingWindows",false));
|
||||||
removeShadowsOnMove->setChecked(config->readBoolEntry("RemoveShadowsOnMove",FALSE));
|
removeShadowsOnMove->setChecked(config->readBoolEntry("RemoveShadowsOnMove",false));
|
||||||
removeShadowsOnResize->setChecked(config->readBoolEntry("RemoveShadowsOnResize",FALSE));
|
removeShadowsOnResize->setChecked(config->readBoolEntry("RemoveShadowsOnResize",false));
|
||||||
dockWindowTransparency->setChecked(config->readBoolEntry("TranslucentDocks",true));
|
dockWindowTransparency->setChecked(config->readBoolEntry("TranslucentDocks",true));
|
||||||
keepAboveAsActive->setChecked(config->readBoolEntry("TreatKeepAboveAsActive",true));
|
keepAboveAsActive->setChecked(config->readBoolEntry("TreatKeepAboveAsActive",true));
|
||||||
|
onlyDecoTranslucent->setChecked(config->readBoolEntry("OnlyDecoTranslucent",false));
|
||||||
|
|
||||||
activeWindowOpacity->setValue(config->readNumEntry("ActiveWindowOpacity",100));
|
activeWindowOpacity->setValue(config->readNumEntry("ActiveWindowOpacity",100));
|
||||||
inactiveWindowOpacity->setValue(config->readNumEntry("InactiveWindowOpacity",75));
|
inactiveWindowOpacity->setValue(config->readNumEntry("InactiveWindowOpacity",75));
|
||||||
|
@ -1444,9 +1437,9 @@ void KTranslucencyConfig::load( void )
|
||||||
dockWindowOpacity->setValue(config->readNumEntry("DockOpacity",80));
|
dockWindowOpacity->setValue(config->readNumEntry("DockOpacity",80));
|
||||||
|
|
||||||
int ass, iss, dss;
|
int ass, iss, dss;
|
||||||
dss = config->readNumEntry("DockShadowSize", 50);
|
dss = config->readNumEntry("DockShadowSize", 33);
|
||||||
ass = config->readNumEntry("ActiveWindowShadowSize", 200);
|
ass = config->readNumEntry("ActiveWindowShadowSize", 133);
|
||||||
iss = config->readNumEntry("InactiveWindowShadowSize", 100);
|
iss = config->readNumEntry("InactiveWindowShadowSize", 67);
|
||||||
|
|
||||||
activeWindowOpacity->setEnabled(activeWindowTransparency->isChecked());
|
activeWindowOpacity->setEnabled(activeWindowTransparency->isChecked());
|
||||||
inactiveWindowOpacity->setEnabled(inactiveWindowTransparency->isChecked());
|
inactiveWindowOpacity->setEnabled(inactiveWindowTransparency->isChecked());
|
||||||
|
@ -1456,9 +1449,6 @@ void KTranslucencyConfig::load( void )
|
||||||
KConfig conf_(QDir::homeDirPath() + "/.xcompmgrrc");
|
KConfig conf_(QDir::homeDirPath() + "/.xcompmgrrc");
|
||||||
conf_.setGroup("xcompmgr");
|
conf_.setGroup("xcompmgr");
|
||||||
|
|
||||||
QString modeString = conf_.readEntry("TransMode","All");
|
|
||||||
transMode->setCurrentItem(!modeString.compare("Content")?2:!modeString.compare("Title")?1:0);
|
|
||||||
|
|
||||||
disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE));
|
disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE));
|
||||||
|
|
||||||
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
|
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
|
||||||
|
@ -1509,11 +1499,14 @@ void KTranslucencyConfig::save( void )
|
||||||
// (speed reasons, so the shadow matrix hasn't to be recreated for every window)
|
// (speed reasons, so the shadow matrix hasn't to be recreated for every window)
|
||||||
// we set inactive windows to 100%, the radius to the inactive window value and adjust the multiplicators for docks and active windows
|
// we set inactive windows to 100%, the radius to the inactive window value and adjust the multiplicators for docks and active windows
|
||||||
// this way the user can set the three values without caring about the radius/multiplicator stuff
|
// this way the user can set the three values without caring about the radius/multiplicator stuff
|
||||||
config->writeEntry("DockShadowSize",(int)(100.0*dockWindowShadowSize->value()/inactiveWindowShadowSize->value()));
|
// additionally we find a value between big and small values to have a more smooth appereance
|
||||||
config->writeEntry("ActiveWindowShadowSize",(int)(100.0*activeWindowShadowSize->value()/inactiveWindowShadowSize->value()));
|
config->writeEntry("DockShadowSize",(int)(200.0 * dockWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
|
||||||
config->writeEntry("InctiveWindowShadowSize",100);
|
config->writeEntry("ActiveWindowShadowSize",(int)(200.0 * activeWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
|
||||||
|
config->writeEntry("InctiveWindowShadowSize",(int)(200.0 * inactiveWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
|
||||||
|
|
||||||
config->writeEntry("RemoveShadowsOnMove",removeShadowsOnMove->isChecked());
|
config->writeEntry("RemoveShadowsOnMove",removeShadowsOnMove->isChecked());
|
||||||
config->writeEntry("RemoveShadowsOnResize",removeShadowsOnResize->isChecked());
|
config->writeEntry("RemoveShadowsOnResize",removeShadowsOnResize->isChecked());
|
||||||
|
config->writeEntry("OnlyDecoTranslucent", onlyDecoTranslucent->isChecked());
|
||||||
config->writeEntry("ResetKompmgr",resetKompmgr_);
|
config->writeEntry("ResetKompmgr",resetKompmgr_);
|
||||||
|
|
||||||
KConfig *conf_ = new KConfig(QDir::homeDirPath() + "/.xcompmgrrc");
|
KConfig *conf_ = new KConfig(QDir::homeDirPath() + "/.xcompmgrrc");
|
||||||
|
@ -1523,7 +1516,6 @@ void KTranslucencyConfig::save( void )
|
||||||
conf_->writeEntry("DisableARGB",disableARGB->isChecked());
|
conf_->writeEntry("DisableARGB",disableARGB->isChecked());
|
||||||
conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
|
conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
|
||||||
conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value());
|
conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value());
|
||||||
conf_->writeEntry("TransMode",transMode->currentItem()==0?"All":transMode->currentItem()==1?"Title":"Content");
|
|
||||||
|
|
||||||
|
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
@ -1531,7 +1523,7 @@ void KTranslucencyConfig::save( void )
|
||||||
QString hex;
|
QString hex;
|
||||||
hex.sprintf("0x%02X%02X%02X", r,g,b);
|
hex.sprintf("0x%02X%02X%02X", r,g,b);
|
||||||
conf_->writeEntry("ShadowColor",hex);
|
conf_->writeEntry("ShadowColor",hex);
|
||||||
conf_->writeEntry("ShadowRadius",inactiveWindowShadowSize->value());
|
conf_->writeEntry("ShadowRadius",(activeWindowShadowSize->value() + inactiveWindowShadowSize->value()) / 2);
|
||||||
conf_->writeEntry("FadeWindows",fadeInWindows->isChecked());
|
conf_->writeEntry("FadeWindows",fadeInWindows->isChecked());
|
||||||
conf_->writeEntry("FadeTrans",fadeOnOpacityChange->isChecked());
|
conf_->writeEntry("FadeTrans",fadeOnOpacityChange->isChecked());
|
||||||
conf_->writeEntry("FadeInStep",fadeInSpeed->value()/1000.0);
|
conf_->writeEntry("FadeInStep",fadeInSpeed->value()/1000.0);
|
||||||
|
@ -1554,7 +1546,7 @@ void KTranslucencyConfig::defaults()
|
||||||
if (!kompmgrAvailable_)
|
if (!kompmgrAvailable_)
|
||||||
return;
|
return;
|
||||||
useTranslucency->setChecked(false);
|
useTranslucency->setChecked(false);
|
||||||
transMode->setCurrentItem(0);
|
onlyDecoTranslucent->setChecked(false);
|
||||||
activeWindowTransparency->setChecked(false);
|
activeWindowTransparency->setChecked(false);
|
||||||
inactiveWindowTransparency->setChecked(true);
|
inactiveWindowTransparency->setChecked(true);
|
||||||
movingWindowTransparency->setChecked(false);
|
movingWindowTransparency->setChecked(false);
|
||||||
|
|
|
@ -255,7 +255,7 @@ private:
|
||||||
QCheckBox *removeShadowsOnResize;
|
QCheckBox *removeShadowsOnResize;
|
||||||
QCheckBox *removeShadowsOnMove;
|
QCheckBox *removeShadowsOnMove;
|
||||||
QGroupBox *sGroup;
|
QGroupBox *sGroup;
|
||||||
QComboBox *transMode;
|
QCheckBox *onlyDecoTranslucent;
|
||||||
// QPushButton *xcompmgrButton;
|
// QPushButton *xcompmgrButton;
|
||||||
KIntNumInput *activeWindowOpacity;
|
KIntNumInput *activeWindowOpacity;
|
||||||
KIntNumInput *inactiveWindowOpacity;
|
KIntNumInput *inactiveWindowOpacity;
|
||||||
|
|
|
@ -56,6 +56,11 @@ check baghira.sf.net for more infos
|
||||||
|
|
||||||
#define CAN_DO_USABLE 0
|
#define CAN_DO_USABLE 0
|
||||||
|
|
||||||
|
#define _TOPHEIGHT_(x) ((x >> 24) & 0xff)
|
||||||
|
#define _RIGHTWIDTH_(x) ((x >> 16) & 0xff)
|
||||||
|
#define _BOTTOMHEIGHT_(x) ((x >> 8) & 0xff)
|
||||||
|
#define _LEFTWIDTH_(x) (x & 0xff)
|
||||||
|
|
||||||
typedef struct _ignore {
|
typedef struct _ignore {
|
||||||
struct _ignore *next;
|
struct _ignore *next;
|
||||||
unsigned long sequence;
|
unsigned long sequence;
|
||||||
|
@ -80,11 +85,12 @@ typedef struct _win {
|
||||||
Picture alphaPict;
|
Picture alphaPict;
|
||||||
Picture shadowPict;
|
Picture shadowPict;
|
||||||
XserverRegion borderSize;
|
XserverRegion borderSize;
|
||||||
XserverRegion titleSize;
|
XserverRegion decoRegion;
|
||||||
XserverRegion contentSize;
|
XserverRegion contentRegion;
|
||||||
XserverRegion extents;
|
XserverRegion extents;
|
||||||
unsigned int preShadeOpacity;
|
unsigned int preShadeOpacity;
|
||||||
Picture shadow;
|
Picture shadow;
|
||||||
|
/*Picture alpha;*/
|
||||||
int shadow_dx;
|
int shadow_dx;
|
||||||
int shadow_dy;
|
int shadow_dy;
|
||||||
int shadow_width;
|
int shadow_width;
|
||||||
|
@ -94,7 +100,7 @@ typedef struct _win {
|
||||||
Atom windowType;
|
Atom windowType;
|
||||||
unsigned long damage_sequence; /* sequence when damage was created */
|
unsigned long damage_sequence; /* sequence when damage was created */
|
||||||
Bool shapable; /* this will allow window managers to exclude windows if just the deco is shaped*/
|
Bool shapable; /* this will allow window managers to exclude windows if just the deco is shaped*/
|
||||||
int titleHeight;
|
unsigned int decoHash;
|
||||||
Picture dimPicture;
|
Picture dimPicture;
|
||||||
|
|
||||||
/* for drawing translucent windows */
|
/* for drawing translucent windows */
|
||||||
|
@ -115,7 +121,7 @@ typedef struct _fade {
|
||||||
double step;
|
double step;
|
||||||
void (*callback) (Display *dpy, win *w, Bool gone);
|
void (*callback) (Display *dpy, win *w, Bool gone);
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
int titleHeight;
|
unsigned int decoHash;
|
||||||
Bool gone;
|
Bool gone;
|
||||||
} fade;
|
} fade;
|
||||||
|
|
||||||
|
@ -152,7 +158,7 @@ Atom opacityAtom;
|
||||||
Atom shadowAtom;
|
Atom shadowAtom;
|
||||||
Atom shadeAtom;
|
Atom shadeAtom;
|
||||||
Atom shapableAtom;
|
Atom shapableAtom;
|
||||||
Atom titleHeightAtom;
|
Atom decoHashAtom;
|
||||||
Atom dimAtom;
|
Atom dimAtom;
|
||||||
Atom deskChangeAtom;
|
Atom deskChangeAtom;
|
||||||
Atom winTypeAtom;
|
Atom winTypeAtom;
|
||||||
|
@ -170,7 +176,7 @@ Atom winNormalAtom;
|
||||||
#define SHADOW_PROP "_KDE_WM_WINDOW_SHADOW"
|
#define SHADOW_PROP "_KDE_WM_WINDOW_SHADOW"
|
||||||
#define SHADE_PROP "_KDE_WM_WINDOW_SHADE"
|
#define SHADE_PROP "_KDE_WM_WINDOW_SHADE"
|
||||||
#define SHAPABLE_PROP "_KDE_WM_WINDOW_SHAPABLE"
|
#define SHAPABLE_PROP "_KDE_WM_WINDOW_SHAPABLE"
|
||||||
#define TITLEHEIGHT_PROP "_KDE_WM_WINDOW_TITLEHEIGHT"
|
#define DECOHASH_PROP "_KDE_WM_WINDOW_DECOHASH"
|
||||||
#define DIM_PROP "_KDE_WM_WINDOW_DIM"
|
#define DIM_PROP "_KDE_WM_WINDOW_DIM"
|
||||||
#define DESKCHANGE_PROP "_KDE_WM_DESKTOP_CHANGE"
|
#define DESKCHANGE_PROP "_KDE_WM_DESKTOP_CHANGE"
|
||||||
|
|
||||||
|
@ -198,12 +204,6 @@ typedef enum _compMode {
|
||||||
CompClientShadows, /* use window extents for shadow, blurred */
|
CompClientShadows, /* use window extents for shadow, blurred */
|
||||||
} CompMode;
|
} CompMode;
|
||||||
|
|
||||||
typedef enum _transMode {
|
|
||||||
Title, /*only the titlebar is drawn translucent*/
|
|
||||||
Content, /*only the content is drawn translucent*/
|
|
||||||
All /*all window is drawn translucent*/
|
|
||||||
} TransMode;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
determine_mode(Display *dpy, win *w);
|
determine_mode(Display *dpy, win *w);
|
||||||
|
|
||||||
|
@ -214,7 +214,6 @@ static XserverRegion
|
||||||
win_extents (Display *dpy, win *w);
|
win_extents (Display *dpy, win *w);
|
||||||
|
|
||||||
CompMode compMode = CompSimple;
|
CompMode compMode = CompSimple;
|
||||||
TransMode transMode = All;
|
|
||||||
|
|
||||||
int shadowRadius = 12;
|
int shadowRadius = 12;
|
||||||
int shadowOffsetX = 0;
|
int shadowOffsetX = 0;
|
||||||
|
@ -268,24 +267,23 @@ find_fade (win *w)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void dequeue_fade (Display *dpy, fade *f)
|
||||||
dequeue_fade (Display *dpy, fade *f)
|
|
||||||
{
|
{
|
||||||
fade **prev;
|
fade **prev;
|
||||||
f->w->isInFade = False;
|
f->w->isInFade = False;
|
||||||
f->w->titleHeight = f->titleHeight;
|
f->w->decoHash = f->decoHash;
|
||||||
|
|
||||||
for (prev = &fades; *prev; prev = &(*prev)->next)
|
for (prev = &fades; *prev; prev = &(*prev)->next)
|
||||||
if (*prev == f)
|
if (*prev == f)
|
||||||
{
|
{
|
||||||
*prev = f->next;
|
*prev = f->next;
|
||||||
if (f->callback)
|
if (f->callback)
|
||||||
{
|
{
|
||||||
(*f->callback) (dpy, f->w, f->gone);
|
(*f->callback) (dpy, f->w, f->gone);
|
||||||
}
|
}
|
||||||
free (f);
|
free (f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -318,20 +316,24 @@ set_fade (Display *dpy, win *w, double start, double finish, double step,
|
||||||
f = find_fade (w);
|
f = find_fade (w);
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
if (start == finish)
|
||||||
|
return;
|
||||||
f = malloc (sizeof (fade));
|
f = malloc (sizeof (fade));
|
||||||
f->next = 0;
|
f->next = 0;
|
||||||
f->w = w;
|
f->w = w;
|
||||||
f->titleHeight = w->titleHeight;
|
f->decoHash = w->decoHash;
|
||||||
f->cur = start;
|
f->cur = start;
|
||||||
enqueue_fade (dpy, f);
|
enqueue_fade (dpy, f);
|
||||||
}
|
}
|
||||||
else if(!override)
|
else if(!override)
|
||||||
return;
|
return;
|
||||||
else
|
else if (start == finish)
|
||||||
{
|
{
|
||||||
if (exec_callback && f->callback)
|
dequeue_fade(dpy,f);
|
||||||
(*f->callback)(dpy, f->w, f->gone);
|
return;
|
||||||
}
|
}
|
||||||
|
else if (exec_callback && f->callback)
|
||||||
|
(*f->callback)(dpy, f->w, f->gone);
|
||||||
|
|
||||||
if (finish < 0)
|
if (finish < 0)
|
||||||
finish = 0;
|
finish = 0;
|
||||||
|
@ -346,7 +348,7 @@ set_fade (Display *dpy, win *w, double start, double finish, double step,
|
||||||
f->callback = callback;
|
f->callback = callback;
|
||||||
w->opacity = f->cur * OPAQUE;
|
w->opacity = f->cur * OPAQUE;
|
||||||
if (wholeWin)
|
if (wholeWin)
|
||||||
w->titleHeight = 0;
|
w->decoHash = 0;
|
||||||
#if 0
|
#if 0
|
||||||
printf ("set_fade start %g step %g\n", f->cur, f->step);
|
printf ("set_fade start %g step %g\n", f->cur, f->step);
|
||||||
#endif
|
#endif
|
||||||
|
@ -393,7 +395,7 @@ run_fades (Display *dpy)
|
||||||
win *w = f->w;
|
win *w = f->w;
|
||||||
next = f->next;
|
next = f->next;
|
||||||
f->cur += f->step * steps;
|
f->cur += f->step * steps;
|
||||||
if (f->cur >= 1)
|
if (f->cur > 1)
|
||||||
f->cur = 1;
|
f->cur = 1;
|
||||||
else if (f->cur < 0)
|
else if (f->cur < 0)
|
||||||
f->cur = 0;
|
f->cur = 0;
|
||||||
|
@ -408,7 +410,6 @@ run_fades (Display *dpy)
|
||||||
{
|
{
|
||||||
w->opacity = f->finish*OPAQUE;
|
w->opacity = f->finish*OPAQUE;
|
||||||
need_dequeue = True;
|
need_dequeue = True;
|
||||||
/*dequeue_fade (dpy, f);*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -417,7 +418,6 @@ run_fades (Display *dpy)
|
||||||
{
|
{
|
||||||
w->opacity = f->finish*OPAQUE;
|
w->opacity = f->finish*OPAQUE;
|
||||||
need_dequeue = True;
|
need_dequeue = True;
|
||||||
/*dequeue_fade (dpy, f);*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (w->shadow)
|
if (w->shadow)
|
||||||
|
@ -426,10 +426,10 @@ run_fades (Display *dpy)
|
||||||
w->shadow = None;
|
w->shadow = None;
|
||||||
w->extents = win_extents(dpy, w);
|
w->extents = win_extents(dpy, w);
|
||||||
}
|
}
|
||||||
determine_mode (dpy, w);
|
determine_mode (dpy, w);
|
||||||
/* Must do this last as it might destroy f->w in callbacks */
|
/* Must do this last as it might destroy f->w in callbacks */
|
||||||
if (need_dequeue)
|
if (need_dequeue)
|
||||||
dequeue_fade (dpy, f);
|
dequeue_fade (dpy, f);
|
||||||
}
|
}
|
||||||
fade_time = now + fade_delta;
|
fade_time = now + fade_delta;
|
||||||
}
|
}
|
||||||
|
@ -917,13 +917,18 @@ win_extents (Display *dpy, win *w)
|
||||||
{
|
{
|
||||||
double opacity = shadowOpacity;
|
double opacity = shadowOpacity;
|
||||||
if (w->shadowSize > 100)
|
if (w->shadowSize > 100)
|
||||||
opacity = opacity/(w->shadowSize*0.01);
|
opacity = opacity/(w->shadowSize*0.015);
|
||||||
if (w->mode == WINDOW_TRANS)
|
if (w->mode == WINDOW_TRANS)
|
||||||
opacity = opacity * ((double)w->opacity)/((double)OPAQUE);
|
opacity = opacity * ((double)w->opacity)/((double)OPAQUE);
|
||||||
w->shadow = shadow_picture (dpy, opacity, w->alphaPict,
|
w->shadow = shadow_picture (dpy, opacity, w->alphaPict,
|
||||||
w->a.width + w->a.border_width * 2 - 2*(shadowRadius - (w->shadowSize*shadowRadius/100)) ,
|
w->a.width + w->a.border_width * 2 - 2*(shadowRadius - (w->shadowSize*shadowRadius/100)) ,
|
||||||
w->a.height + w->a.border_width * 2 - 2*(shadowRadius - (w->shadowSize*shadowRadius/100)),
|
w->a.height + w->a.border_width * 2 - 2*(shadowRadius - (w->shadowSize*shadowRadius/100)),
|
||||||
&w->shadow_width, &w->shadow_height);
|
&w->shadow_width, &w->shadow_height);
|
||||||
|
/*int kill;
|
||||||
|
w->alpha = shadow_picture (dpy, 0.9, w->alphaPict,
|
||||||
|
w->a.width + w->a.border_width * 2,
|
||||||
|
w->a.height + w->a.border_width * 2,
|
||||||
|
&kill, &kill);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sr.x = w->a.x + w->shadow_dx;
|
sr.x = w->a.x + w->shadow_dx;
|
||||||
|
@ -971,7 +976,7 @@ border_size (Display *dpy, win *w)
|
||||||
}
|
}
|
||||||
|
|
||||||
static XserverRegion
|
static XserverRegion
|
||||||
title_size (Display *dpy, win *w)
|
deco_region (Display *dpy, win *w)
|
||||||
{
|
{
|
||||||
XserverRegion title;
|
XserverRegion title;
|
||||||
XRectangle r; /*titlebounding rect*/
|
XRectangle r; /*titlebounding rect*/
|
||||||
|
@ -982,21 +987,21 @@ title_size (Display *dpy, win *w)
|
||||||
* of creates, that way you'd just end up with an empty region
|
* of creates, that way you'd just end up with an empty region
|
||||||
* instead of an invalid XID.
|
* instead of an invalid XID.
|
||||||
*/
|
*/
|
||||||
r.x = w->a.x - w->a.border_width;
|
r.x = w->a.x - w->a.border_width + _LEFTWIDTH_(w->decoHash);
|
||||||
r.y = w->a.y - w->a.border_width;
|
r.y = w->a.y - w->a.border_width + _TOPHEIGHT_(w->decoHash);
|
||||||
r.width = w->a.width + w->a.border_width * 2;
|
r.width = w->a.width + w->a.border_width * 2 - _LEFTWIDTH_(w->decoHash) - _RIGHTWIDTH_(w->decoHash);
|
||||||
r.height = w->titleHeight + w->a.border_width;
|
r.height = w->a.height + w->a.border_width - _TOPHEIGHT_(w->decoHash) - _BOTTOMHEIGHT_(w->decoHash);
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
title = XFixesCreateRegion (dpy, &r, 1);
|
title = XFixesCreateRegion (dpy, &r, 1);
|
||||||
if (!w->borderSize)
|
if (!w->borderSize)
|
||||||
w->borderSize = border_size (dpy, w);
|
w->borderSize = border_size (dpy, w);
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesIntersectRegion(dpy, title, w->borderSize, title);
|
XFixesSubtractRegion(dpy, title, w->borderSize, title);
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
static XserverRegion
|
static XserverRegion
|
||||||
content_size (Display *dpy, win *w)
|
content_region (Display *dpy, win *w)
|
||||||
{
|
{
|
||||||
XserverRegion content;
|
XserverRegion content;
|
||||||
XRectangle r; /*contentbounding rect*/
|
XRectangle r; /*contentbounding rect*/
|
||||||
|
@ -1007,10 +1012,10 @@ content_size (Display *dpy, win *w)
|
||||||
* of creates, that way you'd just end up with an empty region
|
* of creates, that way you'd just end up with an empty region
|
||||||
* instead of an invalid XID.
|
* instead of an invalid XID.
|
||||||
*/
|
*/
|
||||||
r.x = w->a.x - w->a.border_width;
|
r.x = w->a.x - w->a.border_width + _LEFTWIDTH_(w->decoHash);
|
||||||
r.y = w->a.y - w->a.border_width + w->titleHeight;
|
r.y = w->a.y - w->a.border_width + _TOPHEIGHT_(w->decoHash);
|
||||||
r.width = w->a.width + w->a.border_width * 2;
|
r.width = w->a.width + w->a.border_width * 2 - _LEFTWIDTH_(w->decoHash) - _RIGHTWIDTH_(w->decoHash);
|
||||||
r.height = w->a.height + w->a.border_width - w->titleHeight;
|
r.height = w->a.height + w->a.border_width - _TOPHEIGHT_(w->decoHash) - _BOTTOMHEIGHT_(w->decoHash);
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
content = XFixesCreateRegion (dpy, &r, 1);
|
content = XFixesCreateRegion (dpy, &r, 1);
|
||||||
if (!w->borderSize)
|
if (!w->borderSize)
|
||||||
|
@ -1101,17 +1106,17 @@ paint_all (Display *dpy, XserverRegion region)
|
||||||
XFixesDestroyRegion (dpy, w->borderSize);
|
XFixesDestroyRegion (dpy, w->borderSize);
|
||||||
w->borderSize = None;
|
w->borderSize = None;
|
||||||
}
|
}
|
||||||
if (w->titleSize)
|
if (w->decoRegion)
|
||||||
{
|
{
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesDestroyRegion (dpy, w->titleSize);
|
XFixesDestroyRegion (dpy, w->decoRegion);
|
||||||
w->titleSize = None;
|
w->decoRegion = None;
|
||||||
}
|
}
|
||||||
if (w->contentSize)
|
if (w->contentRegion)
|
||||||
{
|
{
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesDestroyRegion (dpy, w->contentSize);
|
XFixesDestroyRegion (dpy, w->contentRegion);
|
||||||
w->contentSize = None;
|
w->contentRegion = None;
|
||||||
}
|
}
|
||||||
if (w->extents)
|
if (w->extents)
|
||||||
{
|
{
|
||||||
|
@ -1128,7 +1133,7 @@ paint_all (Display *dpy, XserverRegion region)
|
||||||
w->borderSize = border_size (dpy, w);
|
w->borderSize = border_size (dpy, w);
|
||||||
if (!w->extents)
|
if (!w->extents)
|
||||||
w->extents = win_extents (dpy, w);
|
w->extents = win_extents (dpy, w);
|
||||||
if ((w->mode == WINDOW_SOLID) || ((w->mode == WINDOW_TRANS) && (transMode < All) && w->titleHeight))
|
if ((w->mode == WINDOW_SOLID) || ((w->mode == WINDOW_TRANS) && w->decoHash))
|
||||||
{
|
{
|
||||||
int x, y, wid, hei;
|
int x, y, wid, hei;
|
||||||
#if HAS_NAME_WINDOW_PIXMAP
|
#if HAS_NAME_WINDOW_PIXMAP
|
||||||
|
@ -1152,36 +1157,23 @@ paint_all (Display *dpy, XserverRegion region)
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer,
|
XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer,
|
||||||
0, 0, 0, 0, x, y, wid, hei);
|
0, 0, 0, 0, x, y, wid, hei);
|
||||||
if (w->dimPicture)
|
if (w->dimPicture)
|
||||||
XRenderComposite (dpy, PictOpOver, w->dimPicture, None, rootBuffer, 0, 0, 0, 0, x, y, wid, hei);
|
XRenderComposite (dpy, PictOpOver, w->dimPicture, None, rootBuffer, 0, 0, 0, 0, x, y, wid, hei);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
switch (transMode) {
|
{
|
||||||
case Title:
|
if (!w->contentRegion)
|
||||||
{
|
w->contentRegion = content_region (dpy, w);
|
||||||
if (!w->contentSize)
|
XFixesSubtractRegion (dpy, region, region, w->contentRegion);
|
||||||
w->contentSize = content_size (dpy, w);
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesSubtractRegion (dpy, region, region, w->contentSize);
|
/*solid part*/
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer,
|
||||||
/*solid part*/
|
_LEFTWIDTH_(w->decoHash), _TOPHEIGHT_(w->decoHash), 0, 0,
|
||||||
XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer,
|
x + _LEFTWIDTH_(w->decoHash),
|
||||||
0, w->titleHeight, 0, 0, x, y+w->titleHeight, wid, hei - w->titleHeight);
|
y + _TOPHEIGHT_(w->decoHash),
|
||||||
break;
|
wid - _LEFTWIDTH_(w->decoHash) - _RIGHTWIDTH_(w->decoHash),
|
||||||
}
|
hei - _TOPHEIGHT_(w->decoHash) - _BOTTOMHEIGHT_(w->decoHash));
|
||||||
case Content:
|
}
|
||||||
{
|
|
||||||
if (!w->titleSize)
|
|
||||||
w->titleSize = title_size (dpy, w);
|
|
||||||
XFixesSubtractRegion (dpy, region, region, w->titleSize);
|
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
|
||||||
/*solid part*/
|
|
||||||
XRenderComposite (dpy, PictOpSrc, w->picture, None, rootBuffer,
|
|
||||||
0, 0, 0, 0, x, y, wid, w->titleHeight);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!w->borderClip)
|
if (!w->borderClip)
|
||||||
{
|
{
|
||||||
|
@ -1255,25 +1247,46 @@ paint_all (Display *dpy, XserverRegion region)
|
||||||
hei = w->a.height;
|
hei = w->a.height;
|
||||||
#endif
|
#endif
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
if (!w->titleHeight)
|
if (!w->decoHash)
|
||||||
|
{
|
||||||
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
||||||
0, 0, 0, 0, x, y, wid, hei);
|
0, 0, 0, 0, x, y, wid, hei);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
switch (transMode) {
|
{
|
||||||
case All:
|
|
||||||
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
|
||||||
0, 0, 0, 0, x, y, wid, hei);
|
|
||||||
break;
|
|
||||||
/*trans part*/
|
/*trans part*/
|
||||||
case Title:
|
/* PICTURE ;)
|
||||||
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
|-----------------------------|
|
||||||
0, 0, 0, 0, x, y, wid, w->titleHeight);
|
| top |
|
||||||
break;
|
|-----------------------------|
|
||||||
case Content:
|
|l | | r|
|
||||||
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
|e | | i|
|
||||||
0, w->titleHeight, 0, 0, x, y+w->titleHeight, wid, hei - w->titleHeight);
|
|f | | g|
|
||||||
break;
|
|t | | h|
|
||||||
}
|
|--------------------------| t|
|
||||||
|
| bottom | |
|
||||||
|
|--------------------------|--|*/
|
||||||
|
/*top*/
|
||||||
|
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
||||||
|
0, 0, 0, 0, x, y, wid, _TOPHEIGHT_(w->decoHash));
|
||||||
|
/*right*/
|
||||||
|
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
||||||
|
wid - _RIGHTWIDTH_(w->decoHash), _TOPHEIGHT_(w->decoHash),
|
||||||
|
0, 0,
|
||||||
|
x + wid - _RIGHTWIDTH_(w->decoHash),
|
||||||
|
y + _TOPHEIGHT_(w->decoHash), _RIGHTWIDTH_(w->decoHash),
|
||||||
|
hei - _TOPHEIGHT_(w->decoHash));
|
||||||
|
/*bottom*/
|
||||||
|
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
||||||
|
0, hei - _BOTTOMHEIGHT_(w->decoHash), 0, 0,
|
||||||
|
x, y + hei - _BOTTOMHEIGHT_(w->decoHash),
|
||||||
|
wid - _RIGHTWIDTH_(w->decoHash), _BOTTOMHEIGHT_(w->decoHash));
|
||||||
|
/*left*/
|
||||||
|
XRenderComposite (dpy, PictOpOver, w->picture, w->alphaPict, rootBuffer,
|
||||||
|
0, _TOPHEIGHT_(w->decoHash), 0, 0,
|
||||||
|
x, y + _TOPHEIGHT_(w->decoHash),
|
||||||
|
_LEFTWIDTH_(w->decoHash), hei - _TOPHEIGHT_(w->decoHash) - _BOTTOMHEIGHT_(w->decoHash));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (w->mode == WINDOW_ARGB)
|
else if (w->mode == WINDOW_ARGB)
|
||||||
{
|
{
|
||||||
|
@ -1434,18 +1447,18 @@ finish_unmap_win (Display *dpy, win *w)
|
||||||
w->borderSize = None;
|
w->borderSize = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->titleSize)
|
if (w->decoRegion)
|
||||||
{
|
{
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesDestroyRegion (dpy, w->titleSize);
|
XFixesDestroyRegion (dpy, w->decoRegion);
|
||||||
w->titleSize = None;
|
w->decoRegion = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->contentSize)
|
if (w->contentRegion)
|
||||||
{
|
{
|
||||||
set_ignore (dpy, NextRequest (dpy));
|
set_ignore (dpy, NextRequest (dpy));
|
||||||
XFixesDestroyRegion (dpy, w->contentSize);
|
XFixesDestroyRegion (dpy, w->contentRegion);
|
||||||
w->contentSize = None;
|
w->contentRegion = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->shadow)
|
if (w->shadow)
|
||||||
|
@ -1578,14 +1591,14 @@ get_shapable_prop(Display *dpy, win *w)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
get_titleHeight_prop(Display *dpy, win *w)
|
get_decoHash_prop(Display *dpy, win *w)
|
||||||
{
|
{
|
||||||
Atom actual;
|
Atom actual;
|
||||||
int format;
|
int format;
|
||||||
unsigned long n, left;
|
unsigned long n, left;
|
||||||
|
|
||||||
unsigned char *data = NULL;
|
unsigned char *data = NULL;
|
||||||
int result = XGetWindowProperty(dpy, w->id, titleHeightAtom, 0L, 1L, False,
|
int result = XGetWindowProperty(dpy, w->id, decoHashAtom, 0L, 1L, False,
|
||||||
XA_CARDINAL, &actual, &format,
|
XA_CARDINAL, &actual, &format,
|
||||||
&n, &left, &data);
|
&n, &left, &data);
|
||||||
if (result == Success && data != NULL && format == 32 )
|
if (result == Success && data != NULL && format == 32 )
|
||||||
|
@ -1596,7 +1609,7 @@ get_titleHeight_prop(Display *dpy, win *w)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return 0; /*no titlebar*/
|
return 0; /*no titlebar*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
get_dim_prop(Display *dpy, win *w)
|
get_dim_prop(Display *dpy, win *w)
|
||||||
|
@ -1857,7 +1870,7 @@ add_win (Display *dpy, Window id, Window prev)
|
||||||
new->shadow_height = 0;
|
new->shadow_height = 0;
|
||||||
new->opacity = OPAQUE;
|
new->opacity = OPAQUE;
|
||||||
new->shadowSize = 100;
|
new->shadowSize = 100;
|
||||||
new->titleHeight = 0;
|
new->decoHash = 0;
|
||||||
|
|
||||||
new->borderClip = None;
|
new->borderClip = None;
|
||||||
new->prev_trans = 0;
|
new->prev_trans = 0;
|
||||||
|
@ -1868,7 +1881,7 @@ add_win (Display *dpy, Window id, Window prev)
|
||||||
new->opacity = get_opacity_prop (dpy, new, OPAQUE);
|
new->opacity = get_opacity_prop (dpy, new, OPAQUE);
|
||||||
new->shadowSize = get_shadow_prop (dpy, new);
|
new->shadowSize = get_shadow_prop (dpy, new);
|
||||||
new->shapable = get_shapable_prop(dpy, new);
|
new->shapable = get_shapable_prop(dpy, new);
|
||||||
new->titleHeight = get_titleHeight_prop(dpy, new);
|
new->decoHash = get_decoHash_prop(dpy, new);
|
||||||
unsigned int tmp = get_dim_prop(dpy, new);
|
unsigned int tmp = get_dim_prop(dpy, new);
|
||||||
new->dimPicture = (tmp < OPAQUE) ? solid_picture (dpy, True, (double)tmp/OPAQUE, 0.1, 0.1, 0.1) : None;
|
new->dimPicture = (tmp < OPAQUE) ? solid_picture (dpy, True, (double)tmp/OPAQUE, 0.1, 0.1, 0.1) : None;
|
||||||
new->windowType = determine_wintype (dpy, new->id);
|
new->windowType = determine_wintype (dpy, new->id);
|
||||||
|
@ -2275,7 +2288,6 @@ typedef enum _option{
|
||||||
FadeInStep,
|
FadeInStep,
|
||||||
FadeDelta,
|
FadeDelta,
|
||||||
DisableARGB,
|
DisableARGB,
|
||||||
TransMode_,
|
|
||||||
NUMBEROFOPTIONS
|
NUMBEROFOPTIONS
|
||||||
} Option;
|
} Option;
|
||||||
|
|
||||||
|
@ -2297,7 +2309,6 @@ options[NUMBEROFOPTIONS] = {
|
||||||
"FadeInStep", /*13*/
|
"FadeInStep", /*13*/
|
||||||
"FadeDelta", /*14*/
|
"FadeDelta", /*14*/
|
||||||
"DisableARGB", /*15*/
|
"DisableARGB", /*15*/
|
||||||
"TransMode", /*16*/
|
|
||||||
/*put your thingy in here...*/
|
/*put your thingy in here...*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2361,17 +2372,6 @@ setValue(Option option, char *value ){
|
||||||
compMode = CompSimple; /*default*/
|
compMode = CompSimple; /*default*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TransMode_:
|
|
||||||
if( strcasecmp(value, "Title") == 0 ){
|
|
||||||
transMode = Title;
|
|
||||||
}
|
|
||||||
else if( strcasecmp(value, "Content") == 0 ){
|
|
||||||
transMode = Content;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
transMode = All; /*default*/
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Display_:
|
case Display_:
|
||||||
break;
|
break;
|
||||||
display = strdup(value);
|
display = strdup(value);
|
||||||
|
@ -2413,7 +2413,9 @@ loadConfig(char *filename){
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
const char *configfile = "/.xcompmgrrc";
|
const char *configfile = "/.xcompmgrrc";
|
||||||
wasNull = True;
|
wasNull = True;
|
||||||
filename = (char*)malloc((strlen(home)+strlen(configfile)+1)*sizeof(char));
|
int n = strlen(home)+strlen(configfile)+1;
|
||||||
|
filename = (char*)malloc(n*sizeof(char));
|
||||||
|
memset(filename,0,n);
|
||||||
|
|
||||||
strcat(filename, home);
|
strcat(filename, home);
|
||||||
strcat(filename, configfile);
|
strcat(filename, configfile);
|
||||||
|
@ -2630,7 +2632,7 @@ main (int argc, char **argv)
|
||||||
opacityAtom = XInternAtom (dpy, OPACITY_PROP, False);
|
opacityAtom = XInternAtom (dpy, OPACITY_PROP, False);
|
||||||
shadeAtom = XInternAtom (dpy, SHADE_PROP, False);
|
shadeAtom = XInternAtom (dpy, SHADE_PROP, False);
|
||||||
shapableAtom = XInternAtom (dpy, SHAPABLE_PROP, False);
|
shapableAtom = XInternAtom (dpy, SHAPABLE_PROP, False);
|
||||||
titleHeightAtom = XInternAtom (dpy, TITLEHEIGHT_PROP, False);
|
decoHashAtom = XInternAtom (dpy, DECOHASH_PROP, False);
|
||||||
dimAtom = XInternAtom (dpy, DIM_PROP, False);
|
dimAtom = XInternAtom (dpy, DIM_PROP, False);
|
||||||
deskChangeAtom = XInternAtom (dpy, DESKCHANGE_PROP, False);
|
deskChangeAtom = XInternAtom (dpy, DESKCHANGE_PROP, False);
|
||||||
winTypeAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE", False);
|
winTypeAtom = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE", False);
|
||||||
|
@ -2817,12 +2819,12 @@ main (int argc, char **argv)
|
||||||
else
|
else
|
||||||
printf("arrrg, window not found\n");
|
printf("arrrg, window not found\n");
|
||||||
}
|
}
|
||||||
else if (ev.xproperty.atom == titleHeightAtom)
|
else if (ev.xproperty.atom == decoHashAtom)
|
||||||
{
|
{
|
||||||
win * w = find_win(dpy, ev.xproperty.window);
|
win * w = find_win(dpy, ev.xproperty.window);
|
||||||
if (w)
|
if (w)
|
||||||
{
|
{
|
||||||
w->titleHeight = get_titleHeight_prop(dpy, w);
|
w->decoHash = get_decoHash_prop(dpy, w);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("arrrg, window not found\n");
|
printf("arrrg, window not found\n");
|
||||||
|
@ -2856,8 +2858,9 @@ main (int argc, char **argv)
|
||||||
if (ev.xproperty.atom == opacityAtom)
|
if (ev.xproperty.atom == opacityAtom)
|
||||||
{
|
{
|
||||||
tmp = get_opacity_prop(dpy, w, OPAQUE);
|
tmp = get_opacity_prop(dpy, w, OPAQUE);
|
||||||
if (tmp == w->opacity)
|
/*THis will most probably happen if window is in fade - resulting in that the fade process isn't updated or broken -> we may have a wrong opacity in the future*/
|
||||||
break; /*skip if opacity does not change*/
|
/*if (tmp == w->opacity)
|
||||||
|
break;*/ /*skip if opacity does not change*/
|
||||||
if (fadeTrans)
|
if (fadeTrans)
|
||||||
{
|
{
|
||||||
set_fade (dpy, w, w->opacity*1.0/OPAQUE, (tmp*1.0)/OPAQUE, fade_out_step, 0, False, True, True, False);
|
set_fade (dpy, w, w->opacity*1.0/OPAQUE, (tmp*1.0)/OPAQUE, fade_out_step, 0, False, True, True, False);
|
||||||
|
|
|
@ -191,6 +191,7 @@ unsigned long Options::updateSettings()
|
||||||
dockShadowSize = config->readNumEntry("DockShadowSize", 80);
|
dockShadowSize = config->readNumEntry("DockShadowSize", 80);
|
||||||
removeShadowsOnMove = config->readBoolEntry("RemoveShadowsOnMove", true);
|
removeShadowsOnMove = config->readBoolEntry("RemoveShadowsOnMove", true);
|
||||||
removeShadowsOnResize = config->readBoolEntry("RemoveShadowsOnResize", true);
|
removeShadowsOnResize = config->readBoolEntry("RemoveShadowsOnResize", true);
|
||||||
|
onlyDecoTranslucent = config->readBoolEntry("OnlyDecoTranslucent",false);
|
||||||
if (resetKompmgr = config->readBoolEntry("ResetKompmgr", false))
|
if (resetKompmgr = config->readBoolEntry("ResetKompmgr", false))
|
||||||
config->writeEntry("ResetKompmgr",FALSE);
|
config->writeEntry("ResetKompmgr",FALSE);
|
||||||
|
|
||||||
|
|
|
@ -297,6 +297,7 @@ class Options : public KDecorationOptions
|
||||||
uint activeWindowShadowSize;
|
uint activeWindowShadowSize;
|
||||||
uint inactiveWindowShadowSize;
|
uint inactiveWindowShadowSize;
|
||||||
uint dockShadowSize;
|
uint dockShadowSize;
|
||||||
|
bool onlyDecoTranslucent;
|
||||||
bool resetKompmgr;
|
bool resetKompmgr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue