Skip to content
Commit 575f56b5 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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)
parent 71b73667
Pipeline #400399 canceled with stage
in 13 minutes and 23 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment