qt: parity tier 3 batch 9 — window-step-resize (C2)

C2 — `window-step-resize` now drives QWidget::setSizeIncrement
from the latest CELL_SIZE action's cell width/height. Cleared back
to pixel-precise when the config bit is false. Honored by X11
WMs via WM_NORMAL_HINTS step; usually ignored by Wayland
compositors (no protocol equivalent). Config docs say "currently
only supported on macOS / has no effect on Linux" — this is a
strict bonus where it works.

Co-Authored-By: claude-flow <ruv@ruv.net>
pull/12846/head
ntomsic 2026-05-21 09:35:28 -05:00
parent 8bd64d0fa9
commit 8b3877d67e
1 changed files with 12 additions and 2 deletions

View File

@ -1584,10 +1584,20 @@ void MainWindow::setSizeLimits(uint32_t minW, uint32_t minH, uint32_t maxW,
maxH ? int(maxH) : QWIDGETSIZE_MAX));
}
// CELL_SIZE: just store the value for later. Snap-to-grid resizing is
// not implemented yet.
// CELL_SIZE: store the value and apply window-step-resize. The
// `window-step-resize` config asks Qt to resize in cell increments;
// QWidget::setSizeIncrement is honored on X11 by most WMs but is
// usually ignored by Wayland compositors (the protocol has no
// equivalent of WM_NORMAL_HINTS step). Best-effort: it works where
// it works, no-op otherwise. Config docs explicitly say "currently
// only supported on macOS / has no effect on Linux," so this is
// strictly a bonus.
void MainWindow::setCellSize(uint32_t w, uint32_t h) {
m_cellSize = QSize(int(w), int(h));
if (configBool("window-step-resize", false))
setSizeIncrement(int(w), int(h));
else
setSizeIncrement(0, 0); // back to pixel-precise
}
// Process-wide undo state — see MainWindow.h.