Occasionally, I want to screenshot a window that is comprised solely of Qt interface elements, such that it can be rendered on a presentation. For this, the best solution for me is to render a VM at 4K, and screenshot its windows. That is painful.
Instead, when I capture a screenshot, could the compositor not act as Print To PDF does, insofar as it captures interface elements as vectors, leaving solely the few bitmaps that might be rendered within the screenshot (wallpapers, videos in YouTube) as such?
@jinliu, that was actually what prompted me to ask:
Because I now know that it would be difficult, what’s of more interest is whether something inherently prevents it, like the QStyles or QQuickStyles themselves being raster-based, etcetera. Considering that Breeze’s Qt 6 QStyle and QQuickStyle lack bitmap components, for they appear to render at any scale, and GTK 4 and Union are CSS-based, I’ve asked Qt and GNOME:
I don’t think it’s “inherently” impossible. Just most UI toolkits are designed to render to screen only. So I said “impractical” because you need a major rewrite of the toolkit.
Actually, @jinliu, I’ve since managed to achieve it for QWidgets, per the Qt Forum thread. GTK doesn’t appear to support it, though, and I don’t know whether QML or any of the more exotic QWidget-compatible, but OS-provided, elements shall.
The most significant shame is that KWin (and Mutter) don’t appear to allow a user to ask all visible windows’ owners to output, meaning that I would need to inject the code per-application, even from the same toolkit. Perhaps, it’s a Wayland-imposed restriction.