• Andreas Haratzis's avatar
    Fix for occasional background glitches behind transparent Menus, especially... · 855d4497
    Andreas Haratzis authored and Nate Graham's avatar Nate Graham committed
    Fix for occasional background glitches behind transparent Menus, especially when hovering over menu elements.
    Bug: 399680
    Breeze sets the WA_TranslucentBackground attribute on Menu widgets to achieve transparency.
    This implies WA_NoSystemBackground, which makes Qt not repaint the background when content changes.
    This is fine for things like tooltips which don't change content, but for dynamic content (like hovering over menus), Breeze ends up painting over the previous frame.
    We render menu panels with CompositionMode_Source to ensure the previous frame is obliterated.
    We could reset the buffer by painting transparent pixels first, but that is wasteful.
    I have ensured that overlapping transparent menus still appear OK (they are rendered over each other with the compositor).
    On Wayland, occasionally colours appear behind the rounded borders. I believe this is a kwin issue because it doesn't occur in X11.
    (cherry picked from commit 01f0c885)