Apply values for 'force' rules to existing windows immediately after

they're created (#89849).

svn path=/trunk/kdebase/kwin/; revision=354752
icc-effect-5.14.5
Luboš Luňák 2004-10-15 14:29:47 +00:00
parent d7cfd3204a
commit f1145f7bd8
2 changed files with 44 additions and 3 deletions

View File

@ -1705,9 +1705,6 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
if( !isMaximizable())
return;
if( isShade()) // SELI SHADE
setShade( ShadeNone );
MaximizeMode old_mode = max_mode;
// 'adjust == true' means to update the size only, e.g. after changing workspace size
if( !adjust )
@ -1722,6 +1719,9 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
if( !adjust && max_mode == old_mode )
return;
if( isShade()) // SELI SHADE
setShade( ShadeNone );
++block_geometry; // TODO GeometryBlocker class?
// maximing one way and unmaximizing the other way shouldn't happen

View File

@ -702,14 +702,55 @@ CHECK_FORCE_RULE( Closeable, bool )
// Client
#define FORCE_RULE( rule, type, getf, setf ) \
{ \
type val = client_rules.check##rule( getf()); \
if( val != getf()) \
setf( val ); \
}
void Client::setupWindowRules( bool ignore_temporary )
{
client_rules = workspace()->findWindowRules( this, ignore_temporary );
// check only after getting the rules, because there may be a rule forcing window type
if( isTopMenu()) // TODO cannot have restrictions
client_rules = WindowRules();
if( isManaged())
{ // apply force rules
// Placement - does need explicit update, just like some others below
// Geometry : setGeometry() doesn't check rules
QRect geom = client_rules.checkGeometry( geometry());
if( geom != geometry())
setGeometry( geom );
// MinSize, MaxSize handled by Geometry
// IgnorePosition
setDesktop( desktop());
// Type
maximize( maximizeMode());
// Minimize : functions don't check, and there are two functions
if( client_rules.checkMinimize( isMinimized()))
minimize();
else
unminimize();
setShade( shadeMode());
setSkipTaskbar( skipTaskbar(), true );
setSkipPager( skipPager());
setKeepAbove( keepAbove());
setKeepBelow( keepBelow());
setFullScreen( isFullScreen(), true );
setUserNoBorder( isUserNoBorder());
// FSP
// AcceptFocus :
if( workspace()->mostRecentlyActivatedClient() == this
&& !client_rules.checkAcceptFocus( true ))
workspace()->activateNextClient( this );
// MoveResizeMode
// Closeable
}
}
#undef FORCE_RULE
void Client::updateWindowRules()
{
if( !isManaged()) // not fully setup yet