-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.10.0
-
None
-
OS: Archlinux
WM: Hyprland
When displaying more than 2 Windows, content rendered inside them, (atleast in a qquickwindow) appears very broken. The computed size of the red rectangle is correct and does for example compute the mouse area properly, meaning this appears to be a purely visual issue. In addition to that this issue seems to only manifest itself when I use a fractional scale (1.6 in my case), and seems to be absent at 1x or 2x scaling. Attached below is a minimal example and a video showcasing the behaviour.
#include <qguiapplication.h> #include <qquickwindow.h> #include <qpainter.h> #include <qquickpainteditem.h> class RedRectangle : public QQuickPaintedItem { public: RedRectangle(QQuickItem *parent = nullptr) : QQuickPaintedItem(parent) {} void paint(QPainter *painter) override { painter->fillRect(boundingRect(), Qt::red); } }; void init_window(QQuickWindow* window) { RedRectangle* rect = new RedRectangle(); rect->setParentItem(window->contentItem()); rect->setWidth (100); rect->setHeight(100); window->show(); } int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); QQuickWindow window_0{}; init_window(&window_0); // Both lines commented out for first example QQuickWindow window_1{}; init_window(&window_1); return QGuiApplication::exec(); }
Querying both screens yields:
Screen: "DP-1" Logical DPI: 96 Device Pixel Ratio: 2 Geometry: QRect(0,0 2400x1350)
Screen: "DP-3" Logical DPI: 96 Device Pixel Ratio: 2 Geometry: QRect(2400,0 2400x1350)