Incorrect window border alignment during animations

Bug #1103768 reported by ainq
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Gala
Fix Released
Medium
Unassigned

Bug Description

Here is an image gallery detailing the issue:
http://imgur.com/a/xbzB5

To reproduce:

Click the button in the top right corner of any window, and/or drag the window to the left or right screen edge, and let go.

This is how I see it:
When animating window resizes, gala stretches the size of the initial window to the size of the resized window, and then flashes in the image of the resized window.

The problem with this approach:

For every edge that differs in whether or not a shadow is rendered for the initial and transitioned state, the margins do not "line up", because Gala counts the window shadows as part of the size of the initial and transitioned windows.

Possible solutions:

1. Hardcode the size and margins of the shadow for each resize transition (e.g. maximize, restore, snap left, snap right, etc...)

2. Crop the window image so that only the window, and not the shadows is animated, and render the shadows as the image is transformed, so the margins always line up between the last frame of the animation and the final state.

3. This isn't really a fix, but it would reduce the eyestrain involved in resizing windows: fade the transition from displaying the initial window state to the final window state.

IMHO, the best solution (that doesn't involve live resizing) would be a combination of 2 and 3, as that would fix the margins not aligning during the animation, and the eyestrain that results from the flashing.

Tags: animation
ainq (ainq)
description: updated
summary: - Border "snapping" on window resize animation
+ Incorrect window border alignment during animations
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

A quess from <ainq> in IRC: "Simply adding some additional padding to the values should fix it"

Changed in elementaryos:
status: New → Invalid
Revision history for this message
ainq (ainq) wrote :

Specifically on lines 591-594 in plugin.vala:
    float scale_x = (float)ew / width;
    float scale_y = (float)eh / height;
    float anchor_x = (float)(x - ex) * width / (ew - width);
    float anchor_y = (float)(y - ey) * height / (eh - height);

Revision history for this message
ainq (ainq) wrote :

That's only for maximize. Adjust the use cases for each animation.

Revision history for this message
ainq (ainq) wrote :

Possibly use a ClutterClone, animate that upscaling using a cached window image, and then fade/scale in the actual actor after a slight delay?

Revision history for this message
ainq (ainq) wrote :

Or instead of the clutterclone, fade the actual actor out 1/2way, fade/scale it back in.
A bit uglier, but I do have a working implementation.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Hi Y Lin! Could you put your implementation (in case you still have it...) in a branch, so the designers can test and see whether it is better than the current one?

Revision history for this message
ainq (ainq) wrote :

Will do. I still need to fix the margins for the maximize animation (basically, I "freeze" the initial window for 50 milliseconds, and then animate the maximized window, to minimize the flashing area).

I'm currently sorting out my issues with anchor points, but the margins are fixed.

Trying to get the files from my VM ATM.

Changed in gala:
status: New → In Progress
assignee: nobody → Y Lin (ainq)
Changed in gala:
milestone: none → loki-beta1
Cody Garver (codygarver)
Changed in gala:
importance: Undecided → Medium
no longer affects: elementaryos
Changed in gala:
status: In Progress → Confirmed
assignee: ainq (ainq) → nobody
Revision history for this message
Danielle Foré (danrabbit) wrote :

This seems to be fixed now

Changed in gala:
status: Confirmed → Fix Committed
milestone: loki-beta1 → loki-alpha1
tags: added: animation
Changed in gala:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.