30 #include <QtGui/QBitmap>
31 #include <QDesktopWidget>
32 #include <QtGui/QDialog>
33 #include <QtDBus/QtDBus>
34 #include <QtGui/QX11Info>
35 #include <X11/Xatom.h>
37 struct KWindowInfo::Private
42 ~Private() {
delete info; }
48 QRect frame_geometry_;
52 Private(
const Private& );
72 unsigned long props[ 2 ] = {
properties, properties2 };
73 d->info =
new NETWinInfo( QX11Info::display(), _win, QX11Info::appRootWindow(), props, 2 );
76 if( d->info->name() && d->info->name()[ 0 ] !=
'\0' )
77 d->name_ = QString::fromUtf8( d->info->name() );
82 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
83 d->iconic_name_ = QString::fromUtf8( d->info->iconName());
89 d->info->kdeGeometry( frame, geom );
93 d->valid = !handler.
error(
false );
105 if( --d->ref == 0 ) {
120 if( d != wininfo.d ) {
147 #if !defined(KDE_NO_WARNING_OUTPUT)
149 kWarning(176) <<
"Pass NET::WMState to KWindowInfo";
151 return d->info->state();
156 return (
state() & s ) == s;
161 #if !defined(KDE_NO_WARNING_OUTPUT)
163 kWarning(176) <<
"Pass NET::XAWMState to KWindowInfo";
165 return d->info->mappingState();
170 #if !defined(KDE_NO_WARNING_OUTPUT)
172 kWarning(176) <<
"Pass NET::WM2ExtendedStrut to KWindowInfo";
179 if( str.
left != 0 ) {
182 ext.
left_end = XDisplayHeight( QX11Info::display(), DefaultScreen( QX11Info::display()));
184 if( str.
right != 0 ) {
187 ext.
right_end = XDisplayHeight( QX11Info::display(), DefaultScreen( QX11Info::display()));
192 ext.
top_end = XDisplayWidth( QX11Info::display(), DefaultScreen( QX11Info::display()));
197 ext.
bottom_end = XDisplayWidth( QX11Info::display(), DefaultScreen( QX11Info::display()));
205 #if !defined(KDE_NO_WARNING_OUTPUT)
207 kWarning(176) <<
"Pass NET::WMWindowType to KWindowInfo";
209 if( !d->info->hasWindowType()) {
218 return d->info->windowType( supported_types );
225 s.prepend(QLatin1Char(
'('));
226 s.append(QLatin1Char(
')'));
233 #if !defined(KDE_NO_WARNING_OUTPUT)
235 kWarning(176) <<
"Pass NET::WMVisibleName to KWindowInfo";
237 return d->info->visibleName() && d->info->visibleName()[ 0 ] !=
'\0'
238 ? QString::fromUtf8(d->info->visibleName()) :
name();
243 #if !defined(KDE_NO_WARNING_OUTPUT)
245 kWarning(176) <<
"Pass NET::WMName to KWindowInfo";
254 s.prepend(QLatin1Char(
'('));
255 s.append(QLatin1Char(
')'));
262 #if !defined(KDE_NO_WARNING_OUTPUT)
264 kWarning(176) <<
"Pass NET::WMVisibleIconName to KWindowInfo";
266 if( d->info->visibleIconName() && d->info->visibleIconName()[ 0 ] !=
'\0' )
267 return QString::fromUtf8( d->info->visibleIconName());
268 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
269 return QString::fromUtf8( d->info->iconName());
270 if( !d->iconic_name_.isEmpty())
271 return d->iconic_name_;
277 #if !defined(KDE_NO_WARNING_OUTPUT)
279 kWarning(176) <<
"Pass NET::WMIconName to KWindowInfo";
281 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
282 return QString::fromUtf8( d->info->iconName());
283 if( !d->iconic_name_.isEmpty())
284 return d->iconic_name_;
295 #if !defined(KDE_NO_WARNING_OUTPUT)
297 kWarning(176) <<
"Pass NET::WMDesktop to KWindowInfo";
309 #if !defined(KDE_NO_WARNING_OUTPUT)
311 kWarning(176) <<
"Pass NET::WMDesktop to KWindowInfo";
324 #if !defined(KDE_NO_WARNING_OUTPUT)
326 kWarning(176) <<
"Pass NET::WMDesktop to KWindowInfo";
333 return d->info->desktop();
338 #if !defined(KDE_NO_WARNING_OUTPUT)
340 kWarning(176) <<
"Pass NET::WMGeometry to KWindowInfo";
347 #if !defined(KDE_NO_WARNING_OUTPUT)
349 kWarning(176) <<
"Pass NET::WMFrameExtents to KWindowInfo";
351 return d->frame_geometry_;
356 #if !defined(KDE_NO_WARNING_OUTPUT)
358 kWarning(176) <<
"Pass NET::WM2TransientFor to KWindowInfo";
360 return d->info->transientFor();
365 #if !defined(KDE_NO_WARNING_OUTPUT)
367 kWarning(176) <<
"Pass NET::WM2GroupLeader to KWindowInfo";
369 return d->info->groupLeader();
374 #if !defined(KDE_NO_WARNING_OUTPUT)
376 kWarning(176) <<
"Pass NET::WM2WindowClass to KWindowInfo";
378 return d->info->windowClassClass();
383 #if !defined(KDE_NO_WARNING_OUTPUT)
385 kWarning(176) <<
"Pass NET::WM2WindowClass to KWindowInfo";
387 return d->info->windowClassName();
392 #if !defined(KDE_NO_WARNING_OUTPUT)
394 kWarning(176) <<
"Pass NET::WM2WindowRole to KWindowInfo";
396 return d->info->windowRole();
401 #if !defined(KDE_NO_WARNING_OUTPUT)
403 kWarning(176) <<
"Pass NET::WM2ClientMachine to KWindowInfo";
405 return d->info->clientMachine();
410 #if !defined(KDE_NO_WARNING_OUTPUT)
412 kWarning(176) <<
"Pass NET::WM2AllowedActions to KWindowInfo";
415 return d->info->allowedActions() & action;