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 );
|
return QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WindowWrapper::resizeEvent( QResizeEvent * )
|
void WindowWrapper::resizeEvent( QResizeEvent * )
|
||||||
{
|
{
|
||||||
if ( win && reparented ) {
|
if ( win && reparented ) {
|
||||||
XMoveResizeWindow( qt_xdisplay(), win,
|
if ( ((Client*)parentWidget())->isResize() ) {
|
||||||
0, 0, width(), height() );
|
QTimer::singleShot( 0, this, SLOT( deferredResize() ) );
|
||||||
if ( ((Client*)parentWidget())->shape() )
|
} else {
|
||||||
((Client*)parentWidget())->updateShape();
|
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
|
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 )
|
void Client::setGeometry( int x, int y, int w, int h )
|
||||||
{
|
{
|
||||||
QWidget::setGeometry(x, y, w, 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 ) {
|
if ( !vertically && !horizontally ) {
|
||||||
maximize ( MaximizeRestore );
|
maximize ( MaximizeRestore );
|
||||||
} else {
|
} else {
|
||||||
QRect geom = geometry();
|
|
||||||
MaximizeMode m = MaximizeRestore;
|
MaximizeMode m = MaximizeRestore;
|
||||||
if ( vertically && horizontally )
|
if ( vertically && horizontally )
|
||||||
m = MaximizeFull;
|
m = MaximizeFull;
|
||||||
|
|
5
client.h
5
client.h
|
@ -46,7 +46,9 @@ protected:
|
||||||
void resizeEvent( QResizeEvent * );
|
void resizeEvent( QResizeEvent * );
|
||||||
bool x11Event( XEvent * ); // X11 event
|
bool x11Event( XEvent * ); // X11 event
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void deferredResize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WId win;
|
WId win;
|
||||||
Time lastMouseEventTime;
|
Time lastMouseEventTime;
|
||||||
|
@ -293,6 +295,7 @@ private:
|
||||||
QTimer* autoRaiseTimer;
|
QTimer* autoRaiseTimer;
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
void verifyTransientFor();
|
void verifyTransientFor();
|
||||||
|
friend class WindowWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline WId Client::window() const
|
inline WId Client::window() const
|
||||||
|
|
5
main.cpp
5
main.cpp
|
@ -137,9 +137,10 @@ bool Application::x11EventFilter( XEvent *e )
|
||||||
switch ( e->type ) {
|
switch ( e->type ) {
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
|
kwin_time = e->xbutton.time;
|
||||||
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
kwin_time = (e->type == MotionNotify) ?
|
kwin_time = e->xmotion.time;
|
||||||
e->xmotion.time : e->xbutton.time;
|
|
||||||
break;
|
break;
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
|
|
Loading…
Reference in a new issue