Ensure that KDecoration::width() etc. and KDecoration::widget()->width are
in sync. svn path=/trunk/kdebase/kwin/; revision=252350
This commit is contained in:
parent
a8b5c7365c
commit
d5dd99ba82
3 changed files with 20 additions and 2 deletions
|
@ -138,6 +138,9 @@ Client::Client( Workspace *ws )
|
|||
|
||||
cmap = None;
|
||||
|
||||
frame_geometry = QRect( 0, 0, 100, 100 ); // so that decorations don't start with size being (0,0)
|
||||
client_size = QSize( 100, 100 );
|
||||
|
||||
// SELI initialize xsizehints??
|
||||
}
|
||||
|
||||
|
@ -255,6 +258,7 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
|
|||
if( !force && (( decoration == NULL && noBorder())
|
||||
|| ( decoration != NULL && !noBorder())))
|
||||
return;
|
||||
bool do_show = false;
|
||||
++block_geometry;
|
||||
if( force )
|
||||
destroyDecoration();
|
||||
|
@ -272,7 +276,7 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
|
|||
setGeometry( QRect( calculateGravitation( false ), sizeForClientSize( clientSize())));
|
||||
workarea_diff_x = save_workarea_diff_x;
|
||||
workarea_diff_y = save_workarea_diff_y;
|
||||
decoration->widget()->show();
|
||||
do_show = true;
|
||||
}
|
||||
else
|
||||
destroyDecoration();
|
||||
|
@ -280,6 +284,8 @@ void Client::updateDecoration( bool check_workspace_pos, bool force )
|
|||
checkWorkspacePosition();
|
||||
--block_geometry;
|
||||
setGeometry( geometry(), true );
|
||||
if( do_show )
|
||||
decoration->widget()->show();
|
||||
updateFrameStrut();
|
||||
}
|
||||
|
||||
|
|
13
events.cpp
13
events.cpp
|
@ -1064,6 +1064,19 @@ bool Client::eventFilter( QObject* o, QEvent* e )
|
|||
return motionNotifyEvent( decorationId(), qtToX11State( ev->state()),
|
||||
ev->x(), ev->y(), ev->globalX(), ev->globalY() );
|
||||
}
|
||||
if( e->type() == QEvent::Resize )
|
||||
{
|
||||
QResizeEvent* ev = static_cast< QResizeEvent* >( e );
|
||||
// Filter out resize events that inform about size different than frame size.
|
||||
// This will ensure that decoration->width() etc. and decoration->widget()->width() will be in sync.
|
||||
// These events only seem to be delayed events from initial resizing before show() was called
|
||||
// on the decoration widget.
|
||||
if( ev->size() != size())
|
||||
{
|
||||
kdDebug( 1212 ) << "Filtering out decoration resize event:" << size() << ":" << ev->size() << ":" << ev->oldSize() << endl;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -281,7 +281,6 @@ bool Client::manage( Window w, bool isMapped )
|
|||
if ( placementDone )
|
||||
move( geom.x(), geom.y() ); // before gravitating
|
||||
|
||||
resize( 100, 100 ); // so that the decoration doesn't get the size as (0,0) CHECKME
|
||||
updateDecoration( false ); // also gravitates
|
||||
resize ( sizeForClientSize( geom.size() ) );
|
||||
|
||||
|
|
Loading…
Reference in a new issue