1
/*****************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
7
You can Freely distribute this program under the GNU General Public
8
License. See the file "COPYING" for the exact licensing terms.
9
******************************************************************/
11
#include "unmanaged.h"
13
#include "workspace.h"
17
#include <X11/extensions/shape.h>
22
Unmanaged::Unmanaged( Workspace* ws )
27
Unmanaged::~Unmanaged()
31
bool Unmanaged::track( Window w )
33
XWindowAttributes attr;
35
if( !XGetWindowAttributes(display(), w, &attr) || attr.map_state != IsViewable )
40
if( attr.c_class == InputOnly )
45
setWindowHandles( w, w ); // the window is also the frame
46
XSelectInput( display(), w, StructureNotifyMask );
47
geom = QRect( attr.x, attr.y, attr.width, attr.height );
49
bit_depth = attr.depth;
50
unsigned long properties[ 2 ];
51
properties[ NETWinInfo::PROTOCOLS ] =
55
properties[ NETWinInfo::PROTOCOLS2 ] =
58
info = new NETWinInfo( display(), w, rootWindow(), properties, 2 );
60
if( Extensions::shapeAvailable())
61
XShapeSelectInput( display(), w, ShapeNotifyMask );
66
static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowStacking();
70
void Unmanaged::release()
72
Deleted* del = Deleted::create( this );
75
static_cast<EffectsHandlerImpl*>(effects)->windowClosed( effectWindow());
76
scene->windowClosed( this, del );
79
workspace()->removeUnmanaged( this, Allowed );
80
if( Extensions::shapeAvailable())
81
XShapeSelectInput( display(), window(), NoEventMask );
82
XSelectInput( display(), window(), NoEventMask );
83
addWorkspaceRepaint( geometry());
84
disownDataPassedToDeleted();
86
deleteUnmanaged( this, Allowed );
89
void Unmanaged::deleteUnmanaged( Unmanaged* c, allowed_t )
94
int Unmanaged::desktop() const
96
return NET::OnAllDesktops; // TODO for some window types should be the current desktop?
99
QPoint Unmanaged::clientPos() const
101
return QPoint( 0, 0 ); // unmanaged windows don't have decorations
104
QSize Unmanaged::clientSize() const
109
void Unmanaged::debug( kdbgstream& stream ) const
111
stream << "\'ID:" << window() << "\'";
116
#include "unmanaged.moc"