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:
parent
44a694a004
commit
287b654d39
3 changed files with 28 additions and 10 deletions
28
client.cpp
28
client.cpp
|
@ -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;
|
||||
|
|
5
client.h
5
client.h
|
@ -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
|
||||
|
|
5
main.cpp
5
main.cpp
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue