svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
669 stars 176 forks source link

Window scaling/DPI awareness problem #239

Open AndrasMa opened 2 years ago

AndrasMa commented 2 years ago

Starting the program, the window is scaling well on 4k (UHD, 3840*2160 px) displays, scaling set to 200% in display settings. Upon loading an svg, the main window is reloading, and the scaling is not any more working, everything gets way too small to read.

To Reproduce Steps to reproduce the behavior:

  1. Start grbl-plotter.exe
  2. Looks fine
  3. Click File/Open File...
  4. Load the bunny from examples
  5. Window reloads, lost scaling, everything is small.

Expected behavior Scaling (DPI awareness, etc...) should remain the same as initial starting the program.

Screenshots image

image

Workaround: Right click on exe, properties, compatibility page, modify high DPI setttings button, tick override, and select system (Extended)... (Sorry for non english windows language...)

image

svenhb commented 2 years ago

I can also observe the behavior, but after doing your workarround it seems to work - as you wrote... I think it works for any further program start, problem solved - or not? Would be nice to set this option (Override high dpi scaling) during install...

AndrasMa commented 2 years ago

What happens during loading of saved files? May be it just needs to apply some flags, and settings for the main window.

Before loading it works fine, therefore upon first start scaling is all set up well. I've programmed just a little in Visual Studio C"anything" , so my memories are fading, but upon creating the window you have to set these things, and seems to be right.

May be the bug lies somewhere in UpdateWholeApplication() function (or SetGUISize()) in file GRBL-Plotter/GUI/MainFormUpdate.cs which is called when different INI files is selected.

jem-green commented 2 years ago

Workaround solves part of the problem but the rest of the scaling then breaks image

smakhtin commented 4 months ago

I started the DPI PR here.