Take into account the decoration when resizing windows based off their

min/max size hints.

svn path=/trunk/KDE/kdebase/workspace/; revision=1049889
This commit is contained in:
Lucas Murray 2009-11-16 02:53:12 +00:00
parent efb6055fc0
commit f57028f387
2 changed files with 4 additions and 3 deletions

View file

@ -230,6 +230,8 @@ class Client
bool isElectricBorderMaximizing() const; bool isElectricBorderMaximizing() const;
QRect electricBorderMaximizeGeometry(); QRect electricBorderMaximizeGeometry();
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
/** Set the quick tile mode ("snap") of this window. /** Set the quick tile mode ("snap") of this window.
* This will also handle preserving and restoring of window geometry as necessary. * This will also handle preserving and restoring of window geometry as necessary.
* @param mode The tile mode (left/right) to give this window. * @param mode The tile mode (left/right) to give this window.
@ -426,7 +428,6 @@ class Client
void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1 void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
bool isManaged() const; ///< Returns false if this client is not yet managed bool isManaged() const; ///< Returns false if this client is not yet managed
void updateAllowedActions( bool force = false ); void updateAllowedActions( bool force = false );
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const; QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const;
void changeMaximize( bool horizontal, bool vertical, bool adjust ); void changeMaximize( bool horizontal, bool vertical, bool adjust );
void checkMaximizeGeometry(); void checkMaximizeGeometry();

View file

@ -275,7 +275,7 @@ void ClientGroup::updateMinMaxSize()
} }
// Ensure all windows are within these sizes // Ensure all windows are within these sizes
const QSize size = clients_[visible_]->size(); const QSize size = clients_[visible_]->clientSize();
QSize newSize( QSize newSize(
qBound( minSize_.width(), size.width(), maxSize_.width() ), qBound( minSize_.width(), size.width(), maxSize_.width() ),
qBound( minSize_.height(), size.height(), maxSize_.height() )); qBound( minSize_.height(), size.height(), maxSize_.height() ));
@ -285,7 +285,7 @@ void ClientGroup::updateMinMaxSize()
// There seems to be a race condition when using plainResize() which causes the window // There seems to be a race condition when using plainResize() which causes the window
// to sometimes be located at new window's location instead of the visible window's location // to sometimes be located at new window's location instead of the visible window's location
// when a window with a large min size is added to a group with a small window size. // when a window with a large min size is added to a group with a small window size.
(*i)->setGeometry( QRect( clients_[visible_]->pos(), newSize )); (*i)->setGeometry( QRect( clients_[visible_]->pos(), (*i)->sizeForClientSize( newSize )));
} }
} }