Optimize away XMoveWindow() calls in the common click-and-drag case
This implements an optimization similar to one in compiz which defers updating the backing X window during a window move until the move is terminated. This helps alleviate some choppiness when using composite + vsync. REVIEW: 107256icc-effect-5.14.5
parent
6979e0a9eb
commit
a04e9cbc6f
|
@ -135,6 +135,7 @@ Client::Client(Workspace* ws)
|
|||
, electricMaximizing(false)
|
||||
, activitiesDefined(false)
|
||||
, needsSessionInteract(false)
|
||||
, needsXWindowMove(false)
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
, m_menuAvailable(false)
|
||||
#endif
|
||||
|
|
1
client.h
1
client.h
|
@ -987,6 +987,7 @@ private:
|
|||
bool activitiesDefined; //whether the x property was actually set
|
||||
|
||||
bool needsSessionInteract;
|
||||
bool needsXWindowMove;
|
||||
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
bool m_menuAvailable;
|
||||
|
|
14
geometry.cpp
14
geometry.cpp
|
@ -1902,7 +1902,14 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
|
|||
}
|
||||
updateShape();
|
||||
} else {
|
||||
XMoveWindow(display(), frameId(), x, y);
|
||||
if (moveResizeMode && compositing()) {
|
||||
// Defer the X update until we leave this mode
|
||||
needsXWindowMove = true;
|
||||
} else {
|
||||
XMoveWindow(display(), frameId(), x, y);
|
||||
}
|
||||
|
||||
// Unconditionally move the input window: it won't affect rendering
|
||||
if (inputId()) {
|
||||
const QPoint pos = QPoint(x, y) + inputPos();
|
||||
XMoveWindow(display(), inputId(), pos.x(), pos.y());
|
||||
|
@ -2665,6 +2672,11 @@ void Client::finishMoveResize(bool cancel)
|
|||
|
||||
void Client::leaveMoveResize()
|
||||
{
|
||||
if (needsXWindowMove) {
|
||||
// Do the deferred move
|
||||
XMoveWindow(display(), frameId(), geom.x(), geom.y());
|
||||
needsXWindowMove = false;
|
||||
}
|
||||
if (geometryTip) {
|
||||
geometryTip->hide();
|
||||
delete geometryTip;
|
||||
|
|
Loading…
Reference in New Issue