next attempt to make mosfet a bit more happy

svn path=/trunk/kdebase/kwin/; revision=74593
This commit is contained in:
Matthias Ettrich 2000-12-12 19:48:17 +00:00
parent 507a315eb2
commit 58356f65ec

View file

@ -605,16 +605,19 @@ void KDEClient::resizeEvent( QResizeEvent* e)
Client::resizeEvent( e ); Client::resizeEvent( e );
doShape(); doShape();
bool titlebar_moved = FALSE;
if ( e->oldSize().width() != width() ) { if ( e->oldSize().width() != width() ) {
QRect t = titlebar->geometry();
calcHiddenButtons(); calcHiddenButtons();
// make layout update titlebar->geometry() in case some buttons // make layout update titlebar->geometry() in case some buttons
// where shown or hidden in calcHiddenButtons() above // where shown or hidden in calcHiddenButtons() above
QApplication::sendPostedEvents( this, QEvent::LayoutHint ); QApplication::sendPostedEvents( this, QEvent::LayoutHint );
titlebar_moved = t != titlebar->geometry();
} }
if ( !isVisible() ) if ( !isVisible() )
return; return;
// we selected WResizeNoErase and WNorthWestGravity. That means: // we selected WResizeNoErase and WNorthWestGravity. That means:
// on a resize event, we do not get a full paint event and the // on a resize event, we do not get a full paint event and the
// background is not erased. This makes it possible for us to // background is not erased. This makes it possible for us to
@ -624,13 +627,20 @@ void KDEClient::resizeEvent( QResizeEvent* e)
// to erase the background. For that reasons we do not use // to erase the background. For that reasons we do not use
// update(), but post a paint event with the erased flag set to // update(), but post a paint event with the erased flag set to
// FALSE. // FALSE.
if ( e->oldSize().width() != width() ) { if ( e->oldSize().width() != width() ) {
int dx = (width() - titlebar->geometry().right()) + QABS( e->oldSize().width() - width() ); int dx = (width() - titlebar->geometry().right()) + QABS( e->oldSize().width() - width() );
if ( dx ) if ( dx )
update( width() - dx + 1, 0, dx, height() ); update( width() - dx + 1, 0, dx, height() );
// titlebar needs no background int dx2 = width() - e->oldSize().width();
QApplication::postEvent( this, new QPaintEvent( titlebar->geometry(), FALSE ) ); // titlebar needs no background
if ( titlebar_moved )
QApplication::postEvent( this, new QPaintEvent( titlebar->geometry(), FALSE ) );
else if ( dx2 > 0 ) {
dx2 += 2;
QApplication::postEvent( this, new QPaintEvent( QRect( titlebar->geometry().right()-dx2, titlebar->geometry().top(), dx2, titlebar->geometry().height()), FALSE ) );
}
} }
if ( e->oldSize().height() != height() ) { if ( e->oldSize().height() != height() ) {
int dy = 8 + QABS( e->oldSize().height() - height() ); int dy = 8 + QABS( e->oldSize().height() - height() );