Skip to content

Replace UI overlays (and any "get screen area to restore it later") with UI layers #4825

@dacap

Description

@dacap

We have a super hacky UI implementation to handle floating popups/tooltips/draggable widgets/tabs using overlays (ui::Overlay/ui::OverlayManager) that makes things really tricky (and slow/GPU unfriendly) where we are saving the surface below to restore it just in time when we paint in the background of the overlay bounds (ui::OverlayManager::restoreOverlappedAreas).

Something similar happens with ui::move_region, where we try to blit/re-use a screen region to scroll it. A thing from the DOS/Allegro/CPU-based era that doesn't make any sense. A similar technique is used in the brush preview for certain cursors (Eraser border) where we get the pixels of the screen to restore them.

Recently I've found an issue where the cursor left a trail on macOS when the Color Management is enabled (and probably in other unknown cases yet, related to #1091?). Found the same issue reported by other users:

We should remove all this code and replace it using a new kind of ui::Layer that can compose visible UI components at different levels without the need of restoring anything below.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions