Merge lp://staging/~townsend/compiz/fix-snap-window-resize-0.9.10 into lp://staging/compiz/0.9.10

Proposed by Christopher Townsend
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 3795
Merged at revision: 3796
Proposed branch: lp://staging/~townsend/compiz/fix-snap-window-resize-0.9.10
Merge into: lp://staging/compiz/0.9.10
Diff against target: 81 lines (+0/-71)
1 file modified
plugins/snap/src/snap.cpp (+0/-71)
To merge this branch: bzr merge lp://staging/~townsend/compiz/fix-snap-window-resize-0.9.10
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+189157@code.staging.launchpad.net

Commit message

Remove seemingly useless code in the SnapWindow::resizeNotify() method where a snapped window that is being resized on the opposite side of the snap would cause orders of magnitude more calls to window->resize() and kill performance.

Description of the change

= Issue =
Set Default Resizing mode to Normal. Snap a window to an edge such as the Launcher or the Panel or screen edge. Resize the opposite side of the snapped edge. Terrible performance ensues.

= Fix =
A seemingly useless code block in the SnapWindow::resizeNotify() method would make orders of magnitude more calls to window->resize() in this case. Each call destroys/creates a new X Window. For example a normal resize may call resize 5 times, but with this code in place, it may call 5000 times or more.

= Note =
I could not figure out what the real intent of the code block was for when resizing a window. It just didn't seem like it was supposed to do anything. As a matter of fact, when using the Default Resizing mode as Rectangle, this code was never touched, so it's not as if resizing a snapped window needed to do something special. At any rate, some pretty good testing of various resizing should be done to ensure there is no regressions by removing this code.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

But would like someone else to test it out :)

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

This seems to work well here, I was jut worried by the possibility that this could lead to non working snapping when resizing a window (if enabled), but I don't see that working even in normal version... So I think this is fine

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches