summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp73
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