https://bugs.kde.org/show_bug.cgi?id=526031
Bug ID: 526031
Summary: Kitty graphics placement with negative z-index is
hidden by cells with a non-default background color
Classification: Applications
Product: konsole
Version First 26.08.1
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: emulation
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 196420
--> https://bugs.kde.org/attachment.cgi?id=196420&action=edit
z=-1 placement over the default background, image is drawn
DESCRIPTION
A kitty graphics placement with a negative z-index disappears when the cells it
covers have a background color other than the terminal default. The image is
transmitted and placed correctly, but the cell background is painted over it.
According to the kitty graphics protocol, a negative z-index means the image is
drawn
under the text. Only values below INT32_MIN/2 are supposed to be drawn under
cells with non-default background colors. Konsole appears to treat every
negative z-index as the second case.
This breaks image previews in TUI applications that paint a background color,
since they have no way to place an image under the text without also losing it
behind the background.
STEPS TO REPRODUCE
1. Save the script below as kgp.sh and make it executable.
2. Run ./kgp.sh in Konsole. The gradient is visible.
3. Run ./kgp.sh colored. Only difference is that the area is filled with
a background color before the image is placed.
OBSERVED RESULT
With the default background the gradient is drawn. With the filled background
nothing is drawn, only the filled rectangle is visible. Screenshots attached.
EXPECTED RESULT
The gradient is drawn in both cases. z=-1 places the image under the text, not
under the cell background.
SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
Kernel Version: 6.18.52-1-lts (64-bit)
Graphics Platform: Wayland
Konsole: 26.08.1
ADDITIONAL INFORMATION
The background pass in src/terminalDisplay/TerminalPainter.cpp:917 decides
whether to fill a cell:
drawBG = backgroundColor != colorTable[DEFAULT_BACK_COLOR] ||
sixelRegion.contains(QPoint(i + startX, Y));
There is nothing that suppresses the fill for cells covered by an image.
sixelRegion does the opposite, it forces the fill, and only Sixel placements
are
added to it (same file, line 1096). rendition.f.transparent is only set for
cells past the end of a history line (Screen.cpp:1937). This seems to explain
why a
z<0 image is visible today is that the cell background happens to match the
default one.
This is not a 26.08 regression. Diffing v26.04.3..v26.08.1, the only change
touching graphics is a05e38fc6, which explicitly skips Kitty placements.
Downstream report: https://github.com/sxyazi/yazi/issues/4366
Yazi falls back to the older placement path on Konsole because of bug 523718,
which is why it uses per-cell placements with z=-1 here.
--
You are receiving this mail because:
You are watching all bug changes.