Environment
- QCAD Professional 3.32.9 / Qt 6.11.0 / Linux x86_64 / xcb (Flatpak, ‘‘org.qcad.QCAD’’)
- Ubuntu, GNOME on Wayland, single 6144x3456 display, devicePixelRatio 1
- Reproduces on a completely stock configuration
Problem
With QCAD open, no drawing loaded and no user interaction, ‘‘qcad-bin’’ sits at
50-70% CPU indefinitely. Xwayland simultaneously consumes a further ~60%.
The cause is a self-perpetuating repaint loop on the ruler viewport margins.
QCAD reserves a 53px margin above and to the left of the graphics view for
‘‘RRulerQt’’ (‘‘HorizontalRuler’’ / ‘‘VerticalRuler’’). Those two strips are
repainted approximately 2175 times per second.
The repaints produce no visible change. I captured both damage regions
directly from the X server with GetImage: each is a single uniform colour,
RGB(239,239,239), 100% of pixels, and byte-identical between captures taken one
second apart. The rulers render no ticks, no labels, nothing.
Evidence
Per-iteration X11 request sequence, repeated ~2175x/sec on the main window:
opcode 59 SetClipRectangles (2 rects)
opcode 130 MIT-SHM PutImage x2 (the two ruler strips)
opcode 56 ChangeGC (clip-mask -> None)
opcode 43 GetInputFocus (blocking XSync round-trip)
Damage rectangles, in main-window coordinates (window 3864x2545):
- horizontal: x=266 y=302 w=3475 h=53 (above the canvas)
- vertical: x=213 y=355 w=53 h=1876 (left of the canvas)
‘‘strace -c’’ over 5s: 57163 write, 45730 poll, 22866 writev, 22864 read.
2.2M voluntary context switches. Qt’s event dispatcher polls with a 0 ms
timeout continuously, i.e. the event queue is never empty and the application
never goes idle.
Ruled out (each tested independently)
- Platform plugin: ~62% under both ‘’-platform xcb’’ and ‘’-platform wayland’’
- Widget style: default / ‘’-style fusion’’ / ‘’-style windows’’ → 50 / 50 / 60%
- Document state: loading a drawing makes it worse (flange.dxf 60%, example01.dxf 70%)
- Configuration: pristine ‘‘QCAD3.conf’’ still reproduces at 60%
Additional note on the Wayland plugin
Under ‘’-platform wayland’’ the cost shifts to the compositor and gets worse:
QCAD calls ‘‘memfd_create’’ + ‘‘ftruncate(11272664)’’ to allocate a new 11 MB
wl_shm buffer 36 times per second rather than reusing a pool, alongside ~1835
surface commits/sec. This pins gnome-shell at 100% CPU and makes the entire
desktop unresponsive. Under xcb the damage is absorbed by Xwayland instead.
Not attached: no DXF/DWG is needed - this reproduces on the empty
“Untitled 1” document at startup.