Fix a problem with topmenu which shows up when turning topmenus off,

adding menu applet, turning them on, removing applet -> kwin won't
notice it has to manage them.

svn path=/trunk/kdebase/kwin/; revision=294455
icc-effect-5.14.5
Luboš Luňák 2004-03-08 15:31:09 +00:00
parent 4b28eb82db
commit edbcd03ce9
1 changed files with 14 additions and 12 deletions

View File

@ -453,10 +453,7 @@ void Workspace::addClient( Client* c, allowed_t )
if( !unconstrained_stacking_order.contains( c ))
unconstrained_stacking_order.append( c );
if( c->isTopMenu())
{
addTopMenu( c );
updateCurrentTopMenu(); // SELI make sure this is called correctly WRT things done in manage()
}
updateClientArea(); // this cannot be in manage(), because the client got added only now
updateClientLayer( c );
if( c->isDesktop())
@ -764,18 +761,17 @@ void Workspace::slotReconfigure()
else
destroyBorderWindows();
if( options->topMenuEnabled())
if( options->topMenuEnabled() && !managingTopMenus())
{
if( !managingTopMenus() && topmenu_selection->claim( false ))
if( topmenu_selection->claim( false ))
setupTopMenuHandling();
}
else
{
if( managingTopMenus())
{
topmenu_selection->release();
else
lostTopMenuSelection();
}
}
else if( !options->topMenuEnabled() && managingTopMenus())
{
topmenu_selection->release();
lostTopMenuSelection();
}
topmenu_height = 0; // invalidate used menu height
if( managingTopMenus())
@ -1869,6 +1865,7 @@ void Workspace::addTopMenu( Client* c )
updateTopMenuGeometry();
}
updateTopMenuGeometry( c );
updateCurrentTopMenu();
}
// kdDebug() << "NEW TOPMENU:" << c << endl;
}
@ -1880,12 +1877,16 @@ void Workspace::removeTopMenu( Client* c )
assert( c->isTopMenu());
assert( topmenus.contains( c ));
topmenus.remove( c );
updateCurrentTopMenu();
// TODO reduce topMenuHeight() if possible?
}
void Workspace::lostTopMenuSelection()
{
// kdDebug() << "lost TopMenu selection" << endl;
// make sure this signal is always set when not owning the selection
disconnect( topmenu_watcher, SIGNAL( lostOwner()), this, SLOT( lostTopMenuOwner()));
connect( topmenu_watcher, SIGNAL( lostOwner()), this, SLOT( lostTopMenuOwner()));
if( !managing_topmenus )
return;
connect( topmenu_watcher, SIGNAL( lostOwner()), this, SLOT( lostTopMenuOwner()));
@ -1925,6 +1926,7 @@ void Workspace::setupTopMenuHandling()
updateTopMenuGeometry();
topmenu_space->show();
updateClientArea();
updateCurrentTopMenu();
}
int Workspace::topMenuHeight() const