Apply values for 'force' rules to existing windows immediately after
they're created (#89849). svn path=/trunk/kdebase/kwin/; revision=354752icc-effect-5.14.5
parent
d7cfd3204a
commit
f1145f7bd8
|
@ -1705,9 +1705,6 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
|
||||||
if( !isMaximizable())
|
if( !isMaximizable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( isShade()) // SELI SHADE
|
|
||||||
setShade( ShadeNone );
|
|
||||||
|
|
||||||
MaximizeMode old_mode = max_mode;
|
MaximizeMode old_mode = max_mode;
|
||||||
// 'adjust == true' means to update the size only, e.g. after changing workspace size
|
// 'adjust == true' means to update the size only, e.g. after changing workspace size
|
||||||
if( !adjust )
|
if( !adjust )
|
||||||
|
@ -1722,6 +1719,9 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
|
||||||
if( !adjust && max_mode == old_mode )
|
if( !adjust && max_mode == old_mode )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if( isShade()) // SELI SHADE
|
||||||
|
setShade( ShadeNone );
|
||||||
|
|
||||||
++block_geometry; // TODO GeometryBlocker class?
|
++block_geometry; // TODO GeometryBlocker class?
|
||||||
|
|
||||||
// maximing one way and unmaximizing the other way shouldn't happen
|
// maximing one way and unmaximizing the other way shouldn't happen
|
||||||
|
|
41
rules.cpp
41
rules.cpp
|
@ -702,14 +702,55 @@ CHECK_FORCE_RULE( Closeable, bool )
|
||||||
|
|
||||||
// Client
|
// 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 )
|
void Client::setupWindowRules( bool ignore_temporary )
|
||||||
{
|
{
|
||||||
client_rules = workspace()->findWindowRules( this, ignore_temporary );
|
client_rules = workspace()->findWindowRules( this, ignore_temporary );
|
||||||
// check only after getting the rules, because there may be a rule forcing window type
|
// check only after getting the rules, because there may be a rule forcing window type
|
||||||
if( isTopMenu()) // TODO cannot have restrictions
|
if( isTopMenu()) // TODO cannot have restrictions
|
||||||
client_rules = WindowRules();
|
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()
|
void Client::updateWindowRules()
|
||||||
{
|
{
|
||||||
if( !isManaged()) // not fully setup yet
|
if( !isManaged()) // not fully setup yet
|
||||||
|
|
Loading…
Reference in New Issue