Fix edge cases that have possibly appeared after making the decorations non-scaled
The work in #61 (closed) created some possible edge cases where some things (like hit testing) might glitch a little bit when a window straddles more than one output. List below; I have more detailed notes on my laptop:
- Window menu might be mispositioned if the trigger area for it is on the non-primary output for the window.
- Maximize/tile/snap is computed at the primary decorations scale, so if the window is moved to another output, it might re-max/re-tile/re-snap incorrectly. This depends on the order of operations: if the decorations primary scale changes before it gets re-anchored, then it's ok.
- Primary output might oscillate when the window is roughly 50% straddling outputs. The layout is recalculated when switching outputs, so that recalculation might result in more of the titlebar being back on the other output, which would make it switch, recalculate, find that it's wrong again, and switch back.
- Since the window's bbox is reported as the max bbox for all outputs, there might be spurious
wl_surface.output_enteror.output_leaveevents. - There might be situations where there's a feedback loop in the render cache, related to the bbox, because the min-render-scale is driven by the bbox. This isn't terrible, because the feedback loop should be damped (I think), but it's... undesirable.
- There can be over-damage of the window contents on the primary output. Same cause: bbox again.
- There can be over-capture of clicks in the shadow area on the higher-DPI output.
- There could be dead clicks (or fallthrough to windows behind) near the seam between outputs.
- The above can result in unexpected keyboard focus (and possibly window stacking) changes.
- When a window straddles two outputs but then fully leaves the previous output (that is, after it's been fully moved and now is only on a single output), we don't immediately clear the render cache of layouts for the old output. This means that bbox etc. may report an area that is larger than needed.
Edited by Brian Tarricone