Skip to content

effects/magiclamp: Improve animation direction heuristic

If the panel is placed between two outputs, the magic lamp can pick wrong direction and the animation will look bad.

This change improves the direction heuristic by making it analyze the position of the center point of the screen where the window is relative to the center point of the icon in the task manager.

The screen center is used instead of the window center in order to properly handle edge cases such as where the window center is offscreen.

For example, if the panel is vertical (e.g. it's attached to the left side of a monitor), the magic lamp will pick the following directions:

  • if the window is to the left side of the panel, the window will be animated so it moves to the right hand side
  • if the window is to the right side of the panel, the window will be animated so it moves to the left hand side

Without this change, the window will always move to the left hand side.

BUG: 463581 (cherry picked from commit 124d9154)

Merge request reports