4.6 KiB
4.6 KiB
Surveillance Client DPI Next Steps
Date: 2026-03-25
Goal
Find the lowest-risk path to make the legacy client usable on high-resolution monitors without breaking multi-window video layout behavior.
Recommended Work Plan
Phase 1: Establish Runtime Baseline
- Test the current executable under Windows with no compatibility overrides.
- Test with external manifest variants or compatibility settings that force:
- DPI unaware
- System DPI aware
- Per-monitor aware
- Capture screenshots and note:
- overall UI size
- text crispness
- icon scaling
- video view scaling
- behavior when moving between monitors with different DPI
Reason:
- This determines whether the practical answer is an OS-scaling solution or a true binary patch.
- For a Qt 4-era application, this experiment can save a lot of unnecessary reverse engineering.
Phase 2: Finish Startup Mapping In Ghidra
- Trace
0x004c7260in more detail until theQApplicationconstructor call is isolated. - Identify the first top-level widget or main window constructor.
- Identify where
show,showNormal, orshowFullScreenis first invoked for the main UI. - Identify where
window_statusdata is applied back onto live windows afterload_window_status_from_settings.
Reason:
- If a binary patch is needed, the ideal injection point is after
QApplicationexists but before the first user-visible window is shown.
Phase 3: Decide On Patch Strategy
Option A: Keep The App DPI-Unaware And Let Windows Scale It
Use this if:
- the UI becomes acceptably sized
- video rendering remains correct
- visual blur is acceptable
Advantages:
- lowest engineering risk
- no need to understand all custom Qt painting and layout code
- least likely to break camera preview surfaces
Risks:
- text and controls may remain blurry
- behavior may vary by Windows version
Option B: System-DPI-Aware Patch Plus Geometry Reset/Migration
Use this if:
- the app looks tiny now because it is already treated as DPI aware in some configuration
- Qt scales fonts and base metrics acceptably at startup when system DPI is exposed
Required work:
- Add or patch early DPI-awareness setup before UI creation.
- Clear or rescale persisted
windowGeometryand related layout state. - Verify icons, toolbars, tab metrics, and preview panes at 125%, 150%, and 200%.
Risks:
- still no clean per-monitor behavior
- custom pixel-sized controls may remain too small
Option C: Application-Side Qt Scaling Retrofit
Use this if:
- Windows scaling is visually unacceptable
- a crisp interface is required
Required work:
- Patch after
QApplicationcreation. - Scale fonts globally.
- Scale icon sizes and style metrics.
- Scale or invalidate stored
QRectwindow geometry. - Verify custom widgets and video panes.
Likely implementation ideas:
- patching application font defaults
- patching style pixel metrics through an existing proxy style path
- scaling saved geometry before it is applied
- forcing a first-run reset of
window_status
Risks:
- highest reverse-engineering effort
- most likely to require multiple iteration cycles
Specific Reverse-Engineering Targets
The next Ghidra pass should answer these exact questions:
- Where is
QApplicationconstructed? - What function creates the main window?
- Where does the program apply
windowGeometryfromQSettings? - Are there custom widgets using hardcoded pixel sizes?
- Are video preview surfaces tied to raw pixel assumptions that could regress under scaling?
Settings To Watch Closely
These keys are likely to interfere with a DPI patch and should be considered for migration or reset:
mainwindow/sizemainwindow/fullscreenwindow_statusview_statusmainview_statusscreenIndexscreenBeginIndexisScreenEnlarge
Practical Recommendation
Start with a runtime experiment matrix before editing the binary.
If Windows-side scaling already produces acceptable results, stop there.
If it does not, the next best path is:
- isolate
QApplicationcreation - isolate main-window show
- patch startup before show
- neutralize or migrate persisted geometry
- validate video panes and multi-monitor layout behavior
Exit Criteria For A Successful Fix
The fix should only be considered successful if all of the following hold:
- Main UI is readable at common desktop scales such as 125%, 150%, and 200%.
- Camera preview panes are not clipped or distorted.
- Multi-window layouts still restore correctly.
- Moving the app between monitors does not make it unusably small.
- Saved geometry does not trap the app in an old tiny layout after restart.