Repository navigation
Fix font-dependent gaps in X11 maximized frames - #585
Conversation
KWin applies character resize increments before reporting native maximization. Select pixelwise Xlib/Xcb constraints in one typed adapter while preserving editor grid requests and other backends. Cover native maximize/fullscreen, font changes and exact character resizing with isolated KWin GUI regressions. The native maximization test failed on the rebuilt baseline before the fix. Verified with nextest: 72 runtime unit tests, one live GNU oracle, three TUI comparisons and six GUI tests across X11 and Wayland.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🔵 Needs a closer look
It changes X11 resize-increment behavior for all window managers (making ordinary border dragging pixelwise) in an unsafe Xlib FFI area with environment-dependent KWin tests, so broad-impact behavior warrants human verification.
No open issues 🎉
What changed in this PR
This PR fixes issue #582, where KWin applied WM_NORMAL_HINTS character increments while maximizing/fullscreening an X11 frame, leaving font-dependent gaps at screen edges. The fix introduces a NativeResizeGrid projection in the shared geometry-hints adapter that forces pixelwise resize increments for Xlib/Xcb handles (so the WM can allocate the exact workarea before Neomacs observes the configure), while preserving character-grid increments for Wayland/other backends and retaining base/min sizes and existing coordinate conversions. It adds unit tests, isolated KWin/X11 GUI regression tests, a research document, and the required native WM tooling to Linux CI.
Changes:
- Add
NativeResizeGrid(Pixels for X11, Characters otherwise) and apply it to all geometry-hint publishing. - Add unit tests for the projection plus KWin/X11 integration tests (native maximize, native fullscreen, GNU fullscreen) with an Elisp coordination fixture.
- Install native WM/X11 tooling (
wmctrl,kwin-x11,dbus) and corresponding required-command checks in CI.
| File | Description |
|---|---|
| crates/neomacs-display-runtime/src/render_thread/geometry_hints.rs | Introduces NativeResizeGrid enum/projection and applies pixelwise increments for X11 before publishing hints. |
| crates/neomacs-display-runtime/src/render_thread/geometry_hints/tests/geometry_hints_test.rs | Unit tests asserting X11 pixelwise projection, preserved base/min sizes, and Wayland character-grid retention. |
| crates/neomacs-gui-tests/tests/issue_582_fullscreen.rs | KWin-driven X11 regression tests asserting maximized/fullscreen outer geometry and hint policy across font heights. |
| crates/neomacs-gui-tests/fixtures/issue-582-fullscreen.el | Elisp fixture coordinating font/column changes with native geometry observations via request/ack files. |
| scripts/ci/setup-linux.sh | Adds native WM/X11 packages and required-command checks for the new tests. |
| docs/research/2026-10-23-issue-582-window-size-hints.md | Documents GNU/ICCCM/EWMH/KWin/winit research and the implementation/verification record. |
Review effort: Balanced
KWin applies
WM_NORMAL_HINTScharacter increments while maximizing a window, leaving font-dependent gaps. The regression failed on the rebuilt baseline: a 1280×800 display received a 1276×790 maximized outer frame.Select pixelwise Xlib/Xcb constraints through an exhaustive
NativeResizeGridprojection in the shared geometry adapter. Preserve editor character-based size requests, base/minimum sizes, coordinate conversions, and other backends' existing hints. Updating constraints after maximization cannot recover the already rounded allocation. The source research covers GNU Emacs, ICCCM/EWMH, KWin, and pinned winit.Compatibility: ordinary X11 border dragging now resizes pixelwise. Lisp requests retain exact character sizing, including the tested 91-column resize. Wayland retains its state-aware grid snapping.
Add isolated KWin/X11 regressions for native maximization, fullscreen, font heights 100–140, font changes while maximized, and restoration. Check all four outer edges and native state independently; retain geometry, hints, font-resolution records and PNGs. Install the required native WM tools in Linux CI.
Validation against the development executable (default features plus video), with matching bootstrap/final dumps regenerated, using cargo nextest:
The Wayland live-font fixture initially lacked Ubuntu Mono. Supplying that existing prerequisite through private fontconfig configuration made its unchanged assertion pass. Local native tests used KWin 6.6.6 and GNU Emacs 31.1; Times New Roman resolved to Liberation Serif, recorded in the artifacts. Plasma 5 behavior was studied in source.
Fixes #582.