Skip to content

Use TransitionBuilder for maximizing - #2890

Merged
lenemter merged 3 commits into
mainfrom
leolost/refactor-maximizing
Aug 13, 2026
Merged

Use TransitionBuilder for maximizing#2890
lenemter merged 3 commits into
mainfrom
leolost/refactor-maximizing

Conversation

@leolost2605

@leolost2605 leolost2605 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Use TransitionBuilder for maximizing. While here do a bit of cleanup and drop some hacks. I checked how GNOME Shell handles the general flow and followed that a bit more:

  • If we already know we won't animate, don't capture a snapshot and complete size change immediately
  • Introduce a pending size change map. Now instead of having only one size change info we can have multiple pending. This is required because it sometimes happens that we have multiple size_change before size_changed and we would drop snapshots then and animate a window with a wrong snapshot
  • The last one also fixes the last error in size accouting errors.
  • In the actual maximize animation we can remove the hack with the FLASH_PREVENT_TIMEOUT
  • By dropping the unnecessary workarounds the animation code is now the same when maximizing and unmaximizing (just like in gnome shell) so we can merge it

Fixes elementary/wingpanel#661
Fixes #2674

@leolost2605
leolost2605 force-pushed the leolost/refactor-maximizing branch from 73f26d9 to ba6c9c8 Compare August 11, 2026 13:38
@leolost2605
leolost2605 marked this pull request as ready for review August 11, 2026 13:39
@leolost2605
leolost2605 requested review from a team August 11, 2026 13:39
@leolost2605
leolost2605 force-pushed the leolost/refactor-maximizing branch 2 times, most recently from de8b38c to 318e76b Compare August 11, 2026 22:00
@lenemter

lenemter commented Aug 12, 2026

Copy link
Copy Markdown
Member

With this branch I get this when unmaximizing:
Screenshot from 2026-08-12 09 15 20

The reason we calculate offset there is because maximized windows don't have shadows, but non-maximized do have them.

And about FLASH_PREVENT_TIMEOUT. It was needed on X11 because some gtk3 windows are so slow to redraw that it flashed in places the window texture was missing, but this doesn't happen on Wayland for some reason. Since we don't plan to support X11 anymore, 👍 from me

@leolost2605
leolost2605 force-pushed the leolost/refactor-maximizing branch from 318e76b to 58e931f Compare August 12, 2026 22:32
@leolost2605

Copy link
Copy Markdown
Member Author

@lenemter thanks for the info that's really useful!

The reason we calculate offset there is because maximized windows don't have shadows, but non-maximized do have them.

I added back the offset calculation but since we have access to the window after its rects have been updated we can get the unmaximized geometry immediately from there and don't need window listener unmaximized geometry tracking. However I still kept the tracking since it will be needed anyways in #2789

I double checked with a 10 seconds animation time that both when maximizing and unmaximizing the actor and the snapshot match exactly.

Regarding the screenshot just to be sure: It was meant to illustrate the offset or did the snapshot stay after the animation finished?

@lenemter

lenemter commented Aug 13, 2026

Copy link
Copy Markdown
Member

@leolost2605 I wanted to illustrate the incorrect offset. Sorry for the confusion

@leolost2605

Copy link
Copy Markdown
Member Author

@leolost2605 I wanted to illustrate the incorrect offset. Sorry for the confusion

Ah great then this should be ready again :)

@lenemter lenemter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and works as expected. Great cleanup!

@lenemter
lenemter merged commit 6d5d5e2 into main Aug 13, 2026
7 checks passed
@lenemter
lenemter deleted the leolost/refactor-maximizing branch August 13, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No maximize animation when panel is not transparent Maximize/Restore animation stopped working

2 participants