diff --git a/manage.cpp b/manage.cpp index 299ac46601..66bc8a4098 100644 --- a/manage.cpp +++ b/manage.cpp @@ -227,18 +227,22 @@ bool Client::manage( Window w, bool isMapped ) placementDone = true; } - if ( isMapped || session || placementDone - || ( isTransient() && !isUtility() && !isDialog() && !isSplash())) - { // TODO - placementDone = TRUE; - } + bool usePosition = false; + if ( isMapped || session || placementDone ) + placementDone = true; // use geometry + else if( isTransient() && !isUtility() && !isDialog() && !isSplash()) + usePosition = true; else if( isTransient() && !hasNETSupport()) - placementDone = true; - else if( isDialog() && hasNETSupport()) // see Placement::placeDialog() + usePosition = true; + else if( isDialog() && hasNETSupport()) + // if the dialog is actually non-NETWM transient window, don't try to apply placement to it, + // it breaks with too many things (xmms, display) ; // force using placement policy else if( isSplash()) ; // force using placement policy else + usePosition = true; + if( !rules()->checkIgnorePosition( !usePosition )) { bool ignorePPosition = ( options->ignorePositionClasses.contains(QString::fromLatin1(resourceClass()))); @@ -249,11 +253,12 @@ bool Client::manage( Window w, bool isMapped ) // disobey xinerama placement option for now (#70943) area = workspace()->clientArea( PlacementArea, geom.center(), desktop()); } + } + if( true ) // size is always obeyed for now, only with constraints applied if ( (xSizeHint.flags & USSize) || (xSizeHint.flags & PSize) ) { // keep in mind that we now actually have a size :-) } - } if (xSizeHint.flags & PMaxSize) geom.setSize( geom.size().boundedTo( diff --git a/placement.cpp b/placement.cpp index 348989dcd6..bc09909d01 100644 --- a/placement.cpp +++ b/placement.cpp @@ -418,10 +418,6 @@ void Placement::placeUtility(Client* c, QRect& area ) void Placement::placeDialog(Client* c, QRect& area ) { - // if the dialog is actually non-NETWM transient window, don't apply placement to it, - // it breaks with too many things (xmms, display) - if( !c->hasNETSupport()) - return; placeOnMainWindow( c, area ); } diff --git a/rules.cpp b/rules.cpp index c4bba4ec17..56ac378014 100644 --- a/rules.cpp +++ b/rules.cpp @@ -37,6 +37,7 @@ Rules::Rules() , sizerule( UnusedSetRule ) , minsizerule( UnusedForceRule ) , maxsizerule( UnusedForceRule ) + , ignorepositionrule( UnusedForceRule ) , desktoprule( UnusedSetRule ) , typerule( UnusedForceRule ) , maximizevertrule( UnusedSetRule ) @@ -126,6 +127,7 @@ void Rules::readFromCfg( KConfig& cfg ) READ_FORCE_RULE( maxsize, Size, ); if( maxsize.isEmpty()) maxsizerule = UnusedForceRule; + READ_FORCE_RULE( ignoreposition, Bool, ); READ_SET_RULE( desktop, Num, ); type = readType( cfg, "type" ); typerule = type != NET::Unknown ? readForceRule( cfg, "typerule" ) : UnusedForceRule; @@ -211,6 +213,7 @@ void Rules::write( KConfig& cfg ) const WRITE_SET_RULE( size, ); WRITE_FORCE_RULE( minsize, ); WRITE_FORCE_RULE( maxsize, ); + WRITE_FORCE_RULE( ignoreposition, ); WRITE_SET_RULE( desktop, ); WRITE_FORCE_RULE( type, ); WRITE_SET_RULE( maximizevert, ); @@ -430,6 +433,7 @@ bool Rules::applySize( QSize& s, bool init ) const APPLY_FORCE_RULE( minsize, MinSize, QSize ) APPLY_FORCE_RULE( maxsize, MaxSize, QSize ) +APPLY_FORCE_RULE( ignoreposition, IgnorePosition, bool ) APPLY_RULE( desktop, Desktop, int ) APPLY_FORCE_RULE( type, Type, NET::WindowType ) @@ -572,6 +576,7 @@ CHECK_RULE( Position, QPoint ) CHECK_RULE( Size, QSize ) CHECK_FORCE_RULE( MinSize, QSize ) CHECK_FORCE_RULE( MaxSize, QSize ) +CHECK_FORCE_RULE( IgnorePosition, bool ) CHECK_RULE( Desktop, int ) CHECK_FORCE_RULE( Type, NET::WindowType ) CHECK_RULE( MaximizeVert, KDecorationDefines::MaximizeMode ) diff --git a/rules.h b/rules.h index 494d84110f..c0259c10ab 100644 --- a/rules.h +++ b/rules.h @@ -45,6 +45,7 @@ class WindowRules QSize checkSize( QSize s, bool init = false ) const; QSize checkMinSize( QSize s ) const; QSize checkMaxSize( QSize s ) const; + bool checkIgnorePosition( bool ignore ) const; int checkDesktop( int desktop, bool init = false ) const; NET::WindowType checkType( NET::WindowType type ) const; MaximizeMode checkMaximize( MaximizeMode mode, bool init = false ) const; @@ -85,6 +86,7 @@ class Rules bool applySize( QSize& s, bool init ) const; bool applyMinSize( QSize& s ) const; bool applyMaxSize( QSize& s ) const; + bool applyIgnorePosition( bool& ignore ) const; bool applyDesktop( int& desktop, bool init ) const; bool applyType( NET::WindowType& type ) const; bool applyMaximizeVert( MaximizeMode& mode, bool init ) const; @@ -151,6 +153,8 @@ class Rules ForceRule minsizerule; QSize maxsize; ForceRule maxsizerule; + bool ignoreposition; + ForceRule ignorepositionrule; int desktop; SetRule desktoprule; NET::WindowType type; // type for setting