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:
parent
3955d891d6
commit
6c62fcd400
4 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
1
client.h
1
client.h
|
@ -587,6 +587,7 @@ private:
|
|||
bool move_resize_has_keyboard_grab;
|
||||
bool unrestrictedMoveResize;
|
||||
int moveResizeStartScreen;
|
||||
static bool s_haveResizeEffect;
|
||||
|
||||
Position mode;
|
||||
QPoint moveOffset;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue