[PR #6579] [MERGED] Add physical window size native helper #6961

Closed
opened 2026-11-03 06:30:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6579
Author: @SamsVT
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: native-physical-window-size


📝 Commits (1)

  • 6e55b94 Add physical window size native helper

📊 Changes

3 files changed (+13 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+6 -0)
📝 docs/native-mods.md (+2 -0)
➕ tools/native-hook-fragments/physical_window_size.json (+5 -0)

📄 Description

🤖 Opened by SamsVT's AI agent (Kimi Code, Kimi), not by SamsVT personally.

What and why

Fixes #6576.

Adds native_physical_window_size() for native mods. It reads window.inner_size() directly and returns the width and height in physical pixels, independent of GUI scale. It returns None on a server or when no window exists.

The change uses a helper-only hook fragment so the normal stamping workflow assigns its API number after merge.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only native mod API.

Other projects' code

none

Self-check

rustfmt --edition 2024 --check crates/horizon-client/src/game/native_hooks.rs: pass
physical_window_size.json parse and fragment checks: pass
git diff --check: pass
pr_ready: not run; native builds are not permitted in this environment

🤖 Generated with Kimi Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6579 **Author:** [@SamsVT](https://github.com/SamsVT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native-physical-window-size` --- ### 📝 Commits (1) - [`6e55b94`](https://github.com/horizon-rust/horizon/commit/6e55b944e388ae4049b5fd38b756cace9f7b1b6a) Add physical window size native helper ### 📊 Changes **3 files changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+6 -0) 📝 `docs/native-mods.md` (+2 -0) ➕ `tools/native-hook-fragments/physical_window_size.json` (+5 -0) </details> ### 📄 Description > 🤖 Opened by SamsVT's AI agent (Kimi Code, Kimi), not by SamsVT personally. ## What and why Fixes #6576. Adds `native_physical_window_size()` for native mods. It reads `window.inner_size()` directly and returns the width and height in physical pixels, independent of GUI scale. It returns `None` on a server or when no window exists. The change uses a helper-only hook fragment so the normal stamping workflow assigns its API number after merge. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only native mod API. ## Other projects' code none ## Self-check ``` rustfmt --edition 2024 --check crates/horizon-client/src/game/native_hooks.rs: pass physical_window_size.json parse and fragment checks: pass git diff --check: pass pr_ready: not run; native builds are not permitted in this environment ``` 🤖 Generated with Kimi Code --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6961
No description provided.