an attempt to reduce the slowliness of opaque resize with non-Qt application

svn path=/trunk/kdebase/kwin/; revision=73641
This commit is contained in:
Matthias Ettrich 2000-12-06 15:03:59 +00:00
parent 44a694a004
commit 287b654d39
3 changed files with 28 additions and 10 deletions

View file

@ -254,17 +254,31 @@ QSizePolicy WindowWrapper::sizePolicy() const
return QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
}
void WindowWrapper::resizeEvent( QResizeEvent * )
{
if ( win && reparented ) {
XMoveResizeWindow( qt_xdisplay(), win,
0, 0, width(), height() );
if ( ((Client*)parentWidget())->shape() )
((Client*)parentWidget())->updateShape();
if ( ((Client*)parentWidget())->isResize() ) {
QTimer::singleShot( 0, this, SLOT( deferredResize() ) );
} else {
XMoveResizeWindow( qt_xdisplay(), win,
0, 0, width(), height() );
if ( ((Client*)parentWidget())->shape() )
((Client*)parentWidget())->updateShape();
}
}
}
void WindowWrapper::deferredResize()
{
XMoveResizeWindow( qt_xdisplay(), win,
0, 0, width(), height() );
((Client*)parentWidget())->sendSynteticConfigureNotify();
if ( ((Client*)parentWidget())->shape() )
((Client*)parentWidget())->updateShape();
QApplication::syncX(); // process our own configure events synchronously.
}
/*!
Reimplemented to do map() as well
*/
@ -1518,7 +1532,8 @@ void Client::leaveEvent( QEvent * )
void Client::setGeometry( int x, int y, int w, int h )
{
QWidget::setGeometry(x, y, w, h);
sendSynteticConfigureNotify();
if ( !isResize() )
sendSynteticConfigureNotify();
}
/*!
@ -1730,7 +1745,6 @@ void Client::maximizeRaw( bool vertically, bool horizontally )
if ( !vertically && !horizontally ) {
maximize ( MaximizeRestore );
} else {
QRect geom = geometry();
MaximizeMode m = MaximizeRestore;
if ( vertically && horizontally )
m = MaximizeFull;

View file

@ -46,7 +46,9 @@ protected:
void resizeEvent( QResizeEvent * );
bool x11Event( XEvent * ); // X11 event
private slots:
void deferredResize();
private:
WId win;
Time lastMouseEventTime;
@ -293,6 +295,7 @@ private:
QTimer* autoRaiseTimer;
Colormap cmap;
void verifyTransientFor();
friend class WindowWrapper;
};
inline WId Client::window() const

View file

@ -137,9 +137,10 @@ bool Application::x11EventFilter( XEvent *e )
switch ( e->type ) {
case ButtonPress:
case ButtonRelease:
kwin_time = e->xbutton.time;
break;
case MotionNotify:
kwin_time = (e->type == MotionNotify) ?
e->xmotion.time : e->xbutton.time;
kwin_time = e->xmotion.time;
break;
case KeyPress:
case KeyRelease: