diff options
Diffstat (limited to 'src/decorator.cpp')
-rw-r--r-- | src/decorator.cpp | 65 |
1 files changed, 57 insertions, 8 deletions
diff --git a/src/decorator.cpp b/src/decorator.cpp index 8e61c8c..58c8c7c 100644 --- a/src/decorator.cpp +++ b/src/decorator.cpp @@ -84,6 +84,7 @@ Aquamarine::Decorator::Decorator (void) : DCOPObject ("KWinInterface"), { KGlobal::locale()->insertCatalogue("kdelibs"); KGlobal::locale()->setActiveCatalogue("aquamarine"); + XSync (qt_xdisplay(), false); mReady = false; mRestart = false; @@ -109,7 +110,9 @@ Aquamarine::Decorator::Decorator (void) : DCOPObject ("KWinInterface"), mActiveWM = XGetSelectionOwner(qt_xdisplay(),Atoms::wmSn); if (mActiveWM == None) return; + Aquamarine::trapXError (); XSelectInput (qt_xdisplay(), mActiveWM, StructureNotifyMask); + if (Aquamarine::popXError ()) return; KCmdLineArgs *args = KCmdLineArgs::parsedArgs (); @@ -137,7 +140,6 @@ Aquamarine::Decorator::Decorator (void) : DCOPObject ("KWinInterface"), } return; } - decor_set_dm_check_hint (qt_xdisplay (), 0); mConfig = new KConfig ("kwinrc"); @@ -199,26 +201,73 @@ Aquamarine::Decorator::~Decorator (void) for (it = mClients.begin (); it != mClients.end (); it++) delete (*it); + mClients.clear (); + mFrames.clear (); + mWindows.clear (); + if (mDefaultShadow) { decor_shadow_destroy (qt_xdisplay (), mDefaultShadow); mDefaultShadow = NULL; } + if (mNoBorderShadow) + { + decor_shadow_destroy (qt_xdisplay (), mNoBorderShadow); + mNoBorderShadow = NULL; + Aquamarine::trapXError (); + XDeleteProperty (qt_xdisplay (), qt_xrootwin (), + Atoms::netWindowDecorBare); + Aquamarine::popXError (); + } + if (mDecorNormal) + { delete mDecorNormal; + mDecorNormal = NULL; + } if (mDecorActive) + { delete mDecorActive; + mDecorActive = NULL; + } - /* XXX: mCompositeWindow is not deleted, some plugins seem to rely on - it not being deleted... not sure what to do about this. */ + if (mOptions) + { + delete mOptions; + mOptions = NULL; + } - delete mOptions; - delete mPlugins; - delete mConfig; - delete mKWinModule; - delete mRootInfo; + if (mPlugins) + { + delete mPlugins; + mPlugins = NULL; + } + + if (mConfig) + { + delete mConfig; + mConfig = NULL; + } + + if (mKWinModule) + { + delete mKWinModule; + mKWinModule = NULL; + } + + if (mRootInfo) + { + delete mRootInfo; + mRootInfo = NULL; + } + + if (mCompositeWindow) + { + delete mCompositeWindow; + mCompositeWindow = 0; + } } bool Aquamarine::Decorator::enableDecorations (Time timestamp, int damageEvent) |