diff options
author | onestone <onestone> | 2007-01-09 18:38:03 +0000 |
---|---|---|
committer | onestone <onestone> | 2007-01-09 18:38:03 +0000 |
commit | 877b8bf057cbc9c92bfe5c09effcb7d4eea9b017 (patch) | |
tree | 4ccf8795402722925ffb229b65e352f6ee095f3d /src/window.cpp | |
parent | 4648e9757d531d51af93cff047243a24a28bf0e6 (diff) | |
download | aquamarine-877b8bf057cbc9c92bfe5c09effcb7d4eea9b017.tar.gz aquamarine-877b8bf057cbc9c92bfe5c09effcb7d4eea9b017.tar.bz2 |
aquamarine: cleanup atoms after beryl exit and use libberyldecoration
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/src/window.cpp b/src/window.cpp index 18bc1fe..42a46c8 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -89,35 +89,36 @@ Aquamarine::Window::Window (QWidget *parent, WId clientId, WId frame, Type type, { if (mType == Normal || mType == Switcher) { - KWin::WindowInfo wInfo = KWin::windowInfo (mClientId, NET::WMState, 0); + KWin::WindowInfo wInfo = KWin::windowInfo (mClientId, NET::WMState, 0); - mState = wInfo.state (); + mState = wInfo.state (); - if (mType == Normal) - { - mName = KWin::readNameProperty (mClientId, XA_WM_NAME); - mIcons = QIconSet (KWin::icon (mClientId, 16, 16, TRUE), - KWin::icon (mClientId, 32, 32, TRUE)); - mOpacity = readPropertyShort (mClientId, Atoms::netWmWindowOpacity, - 0xffff); - } - else - { - mIcons = QIconSet (); - mName = QString (""); - } + if (mType == Normal) + { + mName = KWin::readNameProperty (mClientId, XA_WM_NAME); + mIcons = QIconSet (KWin::icon (mClientId, 16, 16, TRUE), + KWin::icon (mClientId, 32, 32, TRUE)); + updateOpacity(); + updateSaturation(); + updateBrightness(); + } + else + { + mIcons = QIconSet (); + mName = QString (""); + } - updateFrame (frame); + updateFrame (frame); - mGeometry = QRect (x, y, w, h); + mGeometry = QRect (x, y, w, h); - getWindowProtocols (); + getWindowProtocols (); } else { - mIcons = QIconSet (); - mName = QString (""); - mGeometry = QRect (50, 50, 30, 1); + mIcons = QIconSet (); + mName = QString (""); + mGeometry = QRect (50, 50, 30, 1); } setGeometry (QRect (mGeometry.x () + ROOT_OFF_X, @@ -131,26 +132,42 @@ Aquamarine::Window::Window (QWidget *parent, WId clientId, WId frame, Type type, Aquamarine::Window::~Window (void) { + + Atom myAtom = Atoms::netWindowDecor; + if (mType == Window::Default) + myAtom = Atoms::netWindowDecorNormal; + else if (mType == Window::DefaultActive) + myAtom = Atoms::netWindowDecorActive; + + Aquamarine::trapXError (); + XWindowAttributes attr; + if (XGetWindowAttributes (qt_xdisplay (), mClientId, &attr) + && !Aquamarine::popXError ()) + { + XDeleteProperty (qt_xdisplay (), mClientId, myAtom); + } + + if (mShadow) - decor_shadow_destroy (qt_xdisplay (), mShadow); + decor_shadow_destroy (qt_xdisplay (), mShadow); if (mPicture) - XRenderFreePicture (qt_xdisplay (), mPicture); + XRenderFreePicture (qt_xdisplay (), mPicture); if (mTexturePicture) - XRenderFreePicture (qt_xdisplay (), mTexturePicture); + XRenderFreePicture (qt_xdisplay (), mTexturePicture); if (mDecorationPicture) - XRenderFreePicture (qt_xdisplay (), mDecorationPicture); + XRenderFreePicture (qt_xdisplay (), mDecorationPicture); if (mDecor) - delete mDecor; + delete mDecor; if (mPopup) - delete mPopup; + delete mPopup; if (mProcessKiller) - delete mProcessKiller; + delete mProcessKiller; } bool |