Candidate and message windows do not adapt to Per-Monitor High DPI
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- desktop, operating-systems
Research direction
Start in PIME::TextService, where candFontHeight() uses GetDC(NULL) and GetDeviceCaps to size candidate and message window fonts. Check how TextService initializes or updates the font, then trace how it can detect the target window's DPI and refresh sizing when that DPI changes. Done when both windows scale correctly across monitors with different DPI settings; linked pull request #962 shows work is already underway.
Written by the indexing model from the issue text.
Description
Problem Description
Currently, \PIME::TextService\ computes font height for the candidate window and message window using \candFontHeight():
\\cpp
candFontHeight_ = -MulDiv(candFontSize_, GetDeviceCaps(hdc, LOGPIXELSY), 72);
\
where \hdc = GetDC(NULL).
This causes issues on modern Windows 10/11 systems:
- \GetDC(NULL)\ queries only the system primary monitor DPI. In multi-monitor setups with mixed DPI scaling (e.g., 4K screen at 200% alongside 1080p at 100%), the candidate and message windows do not scale to the target monitor's DPI, appearing either blurry, too small, or too large.
- The font is only created once at initialization or when font settings change, and does not dynamically update if typing in a window on a monitor with different DPI scaling.
Proposed Solution
- Introduce a helper to query per-window DPI using \GetDpiForWindow\ with fallback to \GetDeviceCaps\ / 96 DPI.
- Dynamically update font sizing in \TextService\ when target window DPI changes so candidate and message windows scale properly across mixed-DPI monitors.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 244
- Avg merge
- 19h 59m
- Merged PRs (30d)
- 33
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyIME/PIME
-
installer: remove obsolete ensureVCRedist check and VC++ redistributable downloadPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
添加"麼"輕聲 注音˙ㄇㄜ 順序1Openchewing enhancement upstream
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
"麼" 建議加上 ai7Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
蝦米輸入法,使用 Ctrl + / 問題Open
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
EasyIME/PIME#753 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ROCm/rocm-libraries#14027 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Qiskit/qiskit-aer#2487 ·
Maintainers usually reply within 1 day
-
GUI
Difficulty 1/5 Under an hour Newbie friendliness 78/100
qbittorrent/qBittorrent#25104 ·
Maintainers usually reply within 2 days
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scp-fs2open/fs2open.github.com#7914 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days