make kwin adjust to shape changes

svn path=/trunk/kdebase/kwin/; revision=71049
icc-effect-5.14.5
Matthias Ettrich 2000-11-16 19:08:05 +00:00
parent 8dde856133
commit 258a7be78a
2 changed files with 17 additions and 11 deletions

View File

@ -544,8 +544,8 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial )
if ( XGetClassHint(qt_xdisplay(), win, &classHint) != 0 ) { if ( XGetClassHint(qt_xdisplay(), win, &classHint) != 0 ) {
if ( classHint.res_class ) if ( classHint.res_class )
ignorePPosition = ( options->ignorePositionClasses.find(QString::fromLatin1(classHint.res_class)) != options->ignorePositionClasses.end() ); ignorePPosition = ( options->ignorePositionClasses.find(QString::fromLatin1(classHint.res_class)) != options->ignorePositionClasses.end() );
XFree(classHint.res_name); XFree(classHint.res_name);
XFree(classHint.res_class); XFree(classHint.res_class);
} }
if ( ( (xSizeHint.flags & PPosition) && !ignorePPosition ) || if ( ( (xSizeHint.flags & PPosition) && !ignorePPosition ) ||
@ -592,6 +592,7 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial )
move( x(), area.bottom() - height() ); move( x(), area.bottom() - height() );
} }
XShapeSelectInput( qt_xdisplay(), win, ShapeNotifyMask );
if ( (is_shape = Shape::hasShape( win )) ) { if ( (is_shape = Shape::hasShape( win )) ) {
updateShape(); updateShape();
} }
@ -835,6 +836,8 @@ bool Client::windowEvent( XEvent * e)
if ( isActive() ) if ( isActive() )
workspace()->updateColormap(); workspace()->updateColormap();
default: default:
if ( e->type == Shape::shapeEvent() )
updateShape();
break; break;
} }

View File

@ -90,7 +90,7 @@ static bool block_focus = FALSE;
// does the window w need a shape combine mask around it? // does the window w need a shape combine mask around it?
bool Shape::hasShape( WId w){ bool Shape::hasShape( WId w){
int xws, yws, xbs, ybs; int xws, yws, xbs, ybs;
unsigned wws, hws, wbs, hbs; unsigned int wws, hws, wbs, hbs;
int boundingShaped, clipShaped; int boundingShaped, clipShaped;
if (!kwin_has_shape) if (!kwin_has_shape)
return FALSE; return FALSE;
@ -1180,7 +1180,7 @@ QPopupMenu* Workspace::clientPopup( Client* c )
void Workspace::showWindowMenuAt( unsigned long id, int x, int y ) void Workspace::showWindowMenuAt( unsigned long id, int x, int y )
{ {
Client *target = findClient( id ); Client *target = findClient( id );
if (!target) if (!target)
return; return;
@ -1957,22 +1957,24 @@ bool Workspace::netCheck( XEvent* e )
*/ */
void Workspace::propagateClients( bool onlyStacking ) 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; int i;
if ( !onlyStacking ) { if ( !onlyStacking ) {
cl = new WId[ clients.count()]; cl = new Window[ clients.count()];
i = 0; i = 0;
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it ) for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it )
cl[i++] = (*it)->window(); cl[i++] = (*it)->window();
rootInfo->setClientList( (Window*) cl, i ); rootInfo->setClientList( cl, i );
delete [] cl; delete [] cl;
} }
cl = new WId[ stacking_order.count()]; cl = new Window[ stacking_order.count()];
i = 0; i = 0;
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it)
cl[i++] = (*it)->window(); cl[i++] = (*it)->window();
rootInfo->setClientListStacking( (Window*) cl, i ); rootInfo->setClientListStacking( cl, i );
delete [] cl; delete [] cl;
} }
@ -2033,13 +2035,14 @@ bool Workspace::iconifyMeansWithdraw( Client* c)
*/ */
void Workspace::propagateSystemTrayWins() void Workspace::propagateSystemTrayWins()
{ {
WId* cl = new WId[ systemTrayWins.count()]; Window *cl = new Window[ systemTrayWins.count()];
int i = 0; int i = 0;
for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) { for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) {
cl[i++] = (*it).win; cl[i++] = (*it).win;
} }
rootInfo->setKDESystemTrayWindows( (Window*) cl, i ); rootInfo->setKDESystemTrayWindows( cl, i );
delete [] cl; delete [] cl;
} }