Make use of resize effect when resizing windows

Fixes a regression. When resize effect is available we can do a
fast resizing by only perform the resizing after the user ended
resizing the window.

REVIEW: 103363
This commit is contained in:
Martin Gräßlin 2011-12-09 20:44:06 +01:00
parent 3955d891d6
commit 6c62fcd400
4 changed files with 12 additions and 2 deletions

View file

@ -71,6 +71,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin
{
bool Client::s_haveResizeEffect = false;
// Creating a client:
// - only by calling Workspace::createClient()
// - it creates a new client and calls manage() for it

View file

@ -587,6 +587,7 @@ private:
bool move_resize_has_keyboard_grab;
bool unrestrictedMoveResize;
int moveResizeStartScreen;
static bool s_haveResizeEffect;
Position mode;
QPoint moveOffset;

View file

@ -811,6 +811,8 @@ void Client::finishCompositing()
Toplevel::finishCompositing();
updateVisibility();
updateDecoration(true, true);
// for safety in case KWin is just resizing the window
s_haveResizeEffect = false;
}
bool Client::shouldUnredirect() const

View file

@ -2580,6 +2580,7 @@ bool Client::startMoveResize()
}
moveResizeMode = true;
s_haveResizeEffect = effects && static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::Resize);
moveResizeStartScreen = screen();
workspace()->setClientIsMoving(this);
initialMoveResizeGeom = moveResizeGeom = geometry();
@ -3034,7 +3035,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root)
return;
#ifdef HAVE_XSYNC
if (isResize() && syncRequest.counter != None) {
if (isResize() && syncRequest.counter != None && !s_haveResizeEffect) {
if (!syncRequest.timeout) {
syncRequest.timeout = new QTimer(this);
connect(syncRequest.timeout, SIGNAL(timeout()), SLOT(performMoveResize()));
@ -3062,7 +3063,11 @@ void Client::performMoveResize()
#ifdef KWIN_BUILD_TILING
if (!workspace()->tiling()->isEnabled())
#endif
setGeometry(moveResizeGeom);
{
if (isMove() || (isResize() && !s_haveResizeEffect)) {
setGeometry(moveResizeGeom);
}
}
#ifdef HAVE_XSYNC
if (isResize() && syncRequest.counter != None)
addRepaintFull();