Store dialog geometry in DPI-independent pixels to prevent size ratcheting

On mixed-DPI multi-monitor setups, dialog sizes grow each time they are
reopened because logical pixel values change when a window moves between
monitors with different scaling factors. The std::max comparison during
restore guarantees monotonic growth since the DPI-scaled value always
exceeds the previously saved unscaled value.

Store width and height as DIP (device-independent pixels) using ToDIP()
on save and FromDIP() on restore. This makes the persisted size stable
regardless of which monitor the dialog was on when closed. A "dip" flag
in the JSON differentiates new DIP-format values from legacy logical
pixel values, which are converted in place on first load.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20120
This commit is contained in:
Seth Hillbrand
2026-02-19 15:21:30 -08:00
parent 426d122b60
commit ee8b2bebce
4 changed files with 56 additions and 9 deletions
+1
View File
@@ -197,6 +197,7 @@ private:
bool migrateSchema1to2();
bool migrateSchema2to3();
bool migrateSchema3to4();
bool migrateSchema4to5();
struct LEGACY_3D_SEARCH_PATH
{