Skip to content

Fix font-dependent gaps in X11 maximized frames - #585

Merged
eval-exec merged 1 commit into
mainfrom
fix/issue-582-native-window-sizing
Oct 23, 2026
Merged

eval-exec merged 1 commit into
mainfrom
fix/issue-582-native-window-sizing

Conversation

@eval-exec

Copy link
Copy Markdown
Owner

KWin applies WM_NORMAL_HINTS character 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 NativeResizeGrid projection 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:

  • 72 runtime unit tests passed.
  • One live GNU Emacs oracle test passed.
  • Three TUI comparisons passed.
  • Six GUI tests passed: three KWin/GNU X11 cases and three existing Wayland HiDPI/fullscreen cases.
  • The native maximization regression failed before the fix.
  • Workspace formatting, cargo check, shell syntax and diff checks passed.

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.

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.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 05:43
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e9839dbd-7383-4f97-a537-f91eade96cbc
📥 Commits

Reviewing files that changed from the base of the PR and between 0f45b90 and 0ff7af8.

📒 Files selected for processing: 6
  • crates/neomacs-display-runtime/src/render_thread/geometry_hints.rs
  • crates/neomacs-display-runtime/src/render_thread/geometry_hints/tests/geometry_hints_test.rs
  • crates/neomacs-gui-tests/fixtures/issue-582-fullscreen.el
  • crates/neomacs-gui-tests/tests/issue_582_fullscreen.rs
  • docs/research/2026-10-23-issue-582-window-size-hints.md
  • scripts/ci/setup-linux.sh

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

For Xlib and XCB windows, native resize hints now use one-pixel increments. Other handles and handle lookup failures retain character-grid increments. The PR adds unit and Linux X11/KWin integration tests for maximize, fullscreen, font changes, restoration, and column resizing, plus supporting test tooling and research notes.

Changes: Fullscreen sizing

Layer / File(s) Summary
Native resize-grid projection
crates/neomacs-display-runtime/src/render_thread/geometry_hints.rs, crates/neomacs-display-runtime/src/render_thread/geometry_hints/tests/*, docs/research/2026-10-23-issue-582-window-size-hints.md
Xlib and XCB handles use one-pixel resize increments. Other handles and handle lookup failures retain character-grid increments. Unit tests cover projected hints and Wayland behavior; the research report records sizing findings and verification results.
Fixture and test harness
crates/neomacs-gui-tests/fixtures/issue-582-fullscreen.el, crates/neomacs-gui-tests/tests/issue_582_fullscreen.rs, scripts/ci/setup-linux.sh
The fixture processes sequenced font, column, and observation requests and writes acknowledgements. The Linux harness starts an isolated X11 display and KWin session. The ecosystem CI profile adds required X11 tools.
Window-state and geometry checks
crates/neomacs-gui-tests/tests/issue_582_fullscreen.rs
Integration tests check maximize and fullscreen geometry across font heights, native resize hints, restored floating hints, and column resizing.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~50 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 0ff7a

The change is ready to merge after normal checks; no actionable sizing regression remains identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 18.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 4 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: fixing font-dependent gaps in maximized X11 frames.
Description check Passed The description directly explains the X11 sizing issue, the pixelwise constraint fix, affected backends, added regression tests, and validation results.
Linked Issues check Passed Issue #582 requires fullscreen windows to fill all screen edges for font heights 100–140. The shared geometry adapter selects pixel increments for Xlib and Xcb while preserving base and minimum sizes.…
Out of Scope Changes check Passed The changes remain connected to issue #582. The maximization, restoration, font-change, and 91-column tests cover the same native X11 size-hint regression and preserve editor sizing behavior. The GNU …
Full details: Linked Issues check

Explanation

Issue #582 requires fullscreen windows to fill all screen edges for font heights 100–140. The shared geometry adapter selects pixel increments for Xlib and Xcb while preserving base and minimum sizes. The added native_kwin_fullscreen_fills_screen_for_every_reported_font_height test covers heights 100, 110, 120, 130, and 140. It independently checks fullscreen state and all outer edges against the root rectangle. The test also checks pixelwise WM_NORMAL_HINTS and records geometry, hints, and screenshots. The focused geometry tests verify that Wayland keeps character increments and that editor grid requests remain unchanged.

Full details: Out of Scope Changes check

Explanation

The changes remain connected to issue #582. The maximization, restoration, font-change, and 91-column tests cover the same native X11 size-hint regression and preserve editor sizing behavior. The GNU Emacs oracle test, Wayland regression coverage, research document, and Linux CI tool installation support compatibility validation for the geometry fix. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 18.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 4 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@eval-exec
eval-exec merged commit 890e349 into main Oct 23, 2026
28 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fullscreen leaves a gap to the screen edge with certain font heights

2 participants