diff --git a/atoms.cpp b/atoms.cpp index 3bbf2a2bfa..1c460ff3a9 100644 --- a/atoms.cpp +++ b/atoms.cpp @@ -75,6 +75,9 @@ Atoms::Atoms() atoms[n] = &net_wm_window_shade; names[n++] = (char*) "_KDE_WM_WINDOW_SHADE"; + + atoms[n] = &net_wm_window_shapable; + names[n++] = (char*) "_KDE_WM_WINDOW_SHAPABLE"; Atom fake; atoms[n] = &fake; diff --git a/atoms.h b/atoms.h index cd5bb0caad..cf84c28cc9 100644 --- a/atoms.h +++ b/atoms.h @@ -40,6 +40,7 @@ class Atoms Atom net_wm_window_opacity; Atom net_wm_window_shadow; Atom net_wm_window_shade; + Atom net_wm_window_shapable; Atom xdnd_aware; Atom xdnd_position; }; diff --git a/client.cpp b/client.cpp index 61e329fe19..0849c21554 100644 --- a/client.cpp +++ b/client.cpp @@ -358,6 +358,7 @@ void Client::detectNoBorder() default: assert( false ); } + setShapable(FALSE); } void Client::updateFrameStrut() @@ -419,12 +420,18 @@ void Client::setUserNoBorder( bool set ) void Client::updateShape() { if ( shape() ) + { XShapeCombineShape(qt_xdisplay(), frameId(), ShapeBounding, clientPos().x(), clientPos().y(), window(), ShapeBounding, ShapeSet); + setShapable(TRUE); + } else + { XShapeCombineMask( qt_xdisplay(), frameId(), ShapeBounding, 0, 0, None, ShapeSet); + setShapable(TRUE); + } // workaround for #19644 - shaped windows shouldn't have decoration if( shape() && !noBorder()) { @@ -467,6 +474,12 @@ QRegion Client::mask() const return QRegion( 0, 0, width(), height()); return _mask; } + +void Client::setShapable(bool b) + { + uint tmp = b?1:0; + XChangeProperty(qt_xdisplay(), frameId(), atoms->net_wm_window_shapable, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tmp, 1L); + } void Client::hideClient( bool hide ) { diff --git a/client.h b/client.h index 8d0df5e2d4..2c368abde0 100644 --- a/client.h +++ b/client.h @@ -292,6 +292,7 @@ class Client : public QObject, public KDecorationDefines bool isBMP(); void setBMP(bool b); bool touches(const Client* c); + void setShapable(bool b); private slots: void autoRaise(); diff --git a/options.cpp b/options.cpp index 592956b0e5..082af2fa98 100644 --- a/options.cpp +++ b/options.cpp @@ -186,6 +186,7 @@ unsigned long Options::updateSettings() activeWindowShadowSize = config->readNumEntry("ActiveWindowShadowSize", 100); inactiveWindowShadowSize = config->readNumEntry("InactiveWindowShadowSize", 100); dockShadowSize = config->readNumEntry("DockShadowSize", 100); + removeShadowsOnResize = config->readBoolEntry("RemoveShadowsOnResize", true); if (resetKompmgr = config->readBoolEntry("ResetKompmgr", false)) config->writeEntry("ResetKompmgr",FALSE); diff --git a/options.h b/options.h index 44789de65e..35cb8b4922 100644 --- a/options.h +++ b/options.h @@ -264,6 +264,7 @@ class Options : public KDecorationOptions uint inactiveWindowOpacity; bool translucentMovingWindows; uint movingWindowOpacity; + bool removeShadowsOnResize; bool translucentDocks; uint dockOpacity; bool keepAboveAsActive;