Repository navigation
GUI: 拡大率の違うモニター間で窓の大きさが飛ぶのを winit の修正で直す - #88
Merged
Merged
Conversation
- winit 0.30.13 に、引きずり中の WM_DPICHANGED で Windows の勧める位置をそのまま使う修正を当てた版を third_party/winit に置き、[patch.crates-io] で差し替える(本家 0.31 系の rust-windowing/winit#4341 と同じ。iced-rs/winit#20 と同じ差分) - アプリ側で窓の大きさを戻していた処理(dpi.rs)は要らなくなったので外す(PC の実機で winit の修正だけで直ることを確認) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CWLHMbVoTnnqKGRnfxnAti
Owner
Author
独立レビュー(0f774fc): OK確認したこと
メモ
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by masa · project thread
Closes #84(2・3 は #85 で対応済み)
原因
Windows で 100%/150% のモニターの境目を引きずると、winit 0.30 が WM_DPICHANGED で Windows の勧める位置(suggested rect)を使わず自前の位置に窓を置くため、窓が元のモニター側に戻って拡大率の変更が数十 ms ごとに繰り返され、変わる前の大きさを新しい拡大率で換算して窓が 1/1.5・1.5 倍に飛ぶ(PC の記録で確認)。winit 本家は 0.31 系で同じ修正(rust-windowing/winit#4341)が入っているが、0.31 はまだ beta で、eframe は最新の 0.37 でも winit 0.30 を使うため上げられない。
変更
third_party/winit: crates.io の winit 0.30.13 に、引きずり中は suggested rect をそのまま使う 1 か所の修正(On Windows, stop a dragged window bouncing between mixed-DPI monitors iced-rs/winit#20 と同じ差分、LENSBENCH_PATCH.diff)を当てたもの。ルートの[patch.crates-io]で差し替え、ワークスペースからは除く。説明はthird_party/winit/LENSBENCH.md。eframe が winit 0.31 以降に移ったら外す。dpi.rsの KeepSize)を外す。winit の修正だけで、引きずり・再起動時の位置とも直ることを PC の実機(100%/150%)で確認した。[patch]は効かない。マージ後に非公開側のCargo.tomlにも同じ差し替え(この リポジトリの rev のwinit)を足す。確認
cargo test -p lensbench-gui、cargo fmt --all --check、clippy(linux・x86_64-pc-windows-gnu)Generated by Claude Code