From 68eb8a80fb45b0cd287b59058ee803f57f1079f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 2 Jan 2003 13:00:52 +0000 Subject: [PATCH] _NET_CLIENT_LIST is now ok, except for small stupid detail. svn path=/trunk/kdebase/kwin/; revision=196944 --- COMPLIANCE | 6 ++++-- workspace.cpp | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/COMPLIANCE b/COMPLIANCE index c0e4b3c8de..9d3b971a96 100644 --- a/COMPLIANCE +++ b/COMPLIANCE @@ -42,14 +42,16 @@ _NET_SUPPORTED root window property COMPLETE | sence that all implemented properties are listed here. | +----------------------------------------------------------------+ CHECKME : check it's complete -_NET_CLIENT_LIST root window property COMPLETE +_NET_CLIENT_LIST root window property PARTIAL +----------------------------------------------------------------+ | With xprop it seems only one WinID is stored, whereas an array | | of all managed windows should be stored instead! | | This is caused by xprop printing only first element of WINDOW | | type properties, xprop has to be patched to see them all. | + | The spec requires this list contains the windows in their | + | initial mapping order, which is not true for NET::Desktop | + | windows. | +----------------------------------------------------------------+ - CHECKME : check that the list includes all windows _NET_CLIENT_LIST_STACKING root window property COMPLETE +----------------------------------------------------------------+ | With xprop it seems only one WinID is stored, whereas an array | diff --git a/workspace.cpp b/workspace.cpp index 84f5e28100..7ff1afc97f 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -797,9 +797,11 @@ QRect Workspace::geometry() const void Workspace::removeClient( Client* c) { + Q_ASSERT( clients.contains( c ) || desktops.contains( c )); clients.remove( c ); stacking_order.remove( c ); focus_chain.remove( c ); + desktops.remove( c ); propagateClients(); } @@ -818,8 +820,7 @@ bool Workspace::destroyClient( Client* c) storeFakeSessionInfo( c ); - if (clients.contains(c)) - removeClient(c); + removeClient(c); c->invalidateWindow(); clientHidden( c ); @@ -2492,16 +2493,20 @@ void Workspace::propagateClients( bool onlyStacking ) int i; if ( !onlyStacking ) { - cl = new Window[ clients.count()]; + cl = new Window[ desktops.count() + clients.count()]; i = 0; + for ( ClientList::ConstIterator it = desktops.begin(); it != desktops.end(); ++it ) + cl[i++] = (*it)->window(); for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it ) cl[i++] = (*it)->window(); rootInfo->setClientList( cl, i ); delete [] cl; } - cl = new Window[ stacking_order.count()]; + cl = new Window[ desktops.count() + stacking_order.count()]; i = 0; + for ( ClientList::ConstIterator it = desktops.begin(); it != desktops.end(); ++it ) + cl[i++] = (*it)->window(); for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) cl[i++] = (*it)->window(); rootInfo->setClientListStacking( cl, i );