diff --git a/client.cpp b/client.cpp index 5186a45b77..340098bdbd 100644 --- a/client.cpp +++ b/client.cpp @@ -544,8 +544,8 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) if ( XGetClassHint(qt_xdisplay(), win, &classHint) != 0 ) { if ( classHint.res_class ) ignorePPosition = ( options->ignorePositionClasses.find(QString::fromLatin1(classHint.res_class)) != options->ignorePositionClasses.end() ); - XFree(classHint.res_name); - XFree(classHint.res_class); + XFree(classHint.res_name); + XFree(classHint.res_class); } if ( ( (xSizeHint.flags & PPosition) && !ignorePPosition ) || @@ -592,6 +592,7 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) move( x(), area.bottom() - height() ); } + XShapeSelectInput( qt_xdisplay(), win, ShapeNotifyMask ); if ( (is_shape = Shape::hasShape( win )) ) { updateShape(); } @@ -835,6 +836,8 @@ bool Client::windowEvent( XEvent * e) if ( isActive() ) workspace()->updateColormap(); default: + if ( e->type == Shape::shapeEvent() ) + updateShape(); break; } diff --git a/workspace.cpp b/workspace.cpp index a8a3ee32a6..62615f76df 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -90,7 +90,7 @@ static bool block_focus = FALSE; // does the window w need a shape combine mask around it? bool Shape::hasShape( WId w){ int xws, yws, xbs, ybs; - unsigned wws, hws, wbs, hbs; + unsigned int wws, hws, wbs, hbs; int boundingShaped, clipShaped; if (!kwin_has_shape) return FALSE; @@ -1180,7 +1180,7 @@ QPopupMenu* Workspace::clientPopup( Client* c ) void Workspace::showWindowMenuAt( unsigned long id, int x, int y ) { Client *target = findClient( id ); - + if (!target) return; @@ -1957,22 +1957,24 @@ bool Workspace::netCheck( XEvent* e ) */ void Workspace::propagateClients( bool onlyStacking ) { - WId* cl; + Window *cl; // MW we should not assume WId and Window to be compatible + // when passig pointers around. + int i; if ( !onlyStacking ) { - cl = new WId[ clients.count()]; + cl = new Window[ clients.count()]; i = 0; for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it ) cl[i++] = (*it)->window(); - rootInfo->setClientList( (Window*) cl, i ); + rootInfo->setClientList( cl, i ); delete [] cl; } - cl = new WId[ stacking_order.count()]; + cl = new Window[ stacking_order.count()]; i = 0; for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) cl[i++] = (*it)->window(); - rootInfo->setClientListStacking( (Window*) cl, i ); + rootInfo->setClientListStacking( cl, i ); delete [] cl; } @@ -2033,13 +2035,14 @@ bool Workspace::iconifyMeansWithdraw( Client* c) */ void Workspace::propagateSystemTrayWins() { - WId* cl = new WId[ systemTrayWins.count()]; + Window *cl = new Window[ systemTrayWins.count()]; + int i = 0; for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) { cl[i++] = (*it).win; } - rootInfo->setKDESystemTrayWindows( (Window*) cl, i ); + rootInfo->setKDESystemTrayWindows( cl, i ); delete [] cl; }