diff --git a/geometry.cpp b/geometry.cpp index 6fbd4730cb..726eca153b 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -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 diff --git a/rules.cpp b/rules.cpp index c3d44a7512..0051697f98 100644 --- a/rules.cpp +++ b/rules.cpp @@ -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