View Issue Details

IDProjectCategoryView StatusLast Update
0033002LazarusLCLpublic2018-01-28 19:37
ReporterPavol S Assigned ToOndrej Pokorny  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindows 
Product Version1.8 
Summary0033002: Runtime created forms is not scaled (with multiple monitors)
DescriptionRuntime created forms is not scaled to new DPI (with Manifest V2 file) after main form moved to another monitor with different DPI.
Steps To Reproduce1. place button on form
2. create event to create new form run it
3. drag main form to second monitor (with different DPI) click Button, -> new form is not scaled.
TagsNo tags attached.
Fixed in Revision57156
LazTarget-
Widgetset
Attached Files

Activities

Pavol S

2018-01-10 14:25

reporter  

scaled.png (12,010 bytes)   
scaled.png (12,010 bytes)   

Ondrej Pokorny

2018-01-10 17:12

developer   ~0105629

Did you read http://wiki.lazarus.freepascal.org/High_DPI section "High DPI in Lazarus 1.8 and above", especially the 4th point "If you create controls run-time"?

Pavol S

2018-01-10 18:35

reporter   ~0105633

yes of course, there is no problem with scaling on same monitor for example when app start with 200% zoom, all forms is corrected created (with auto scale). But when I run app on 100% zoom and move main form to monitor with 200% zoom.

Ouch, all controls on example is in autosize mode and Popupform.Parent := MainForm.

Ondrej Pokorny

2018-01-11 03:37

developer   ~0105648

OK, please upload a test application. I'll look at it.

Pavol S

2018-01-11 14:51

reporter  

dpitest.zip (131,212 bytes)

Pavol S

2018-01-11 14:58

reporter   ~0105665

Test application uploaded. There is one Form and one Frame (two buttons). Frame creation is OK. Form is broken.

When form is created with Application as owner, without parent and with Position
:= poOwnerFormCenter DPI scalling is correct.

This code works:
    Frm := TForm2.Create(Application);
    Frm.Name := '';
    Frm.BorderStyle := bsNone;
    Frm.Align := alClient;
    Frm.Show;

Ondrej Pokorny

2018-01-12 16:44

developer   ~0105705

OK, now I see the problem. The issue is "Popupform.Parent := MainForm". Yes, I probably forgot about this case. I'll fix it when I have a 2nd monitor to test.

Ondrej Pokorny

2018-01-27 14:22

developer   ~0106070

Fixed, please test and close if OK.

Pavol S

2018-01-28 19:37

reporter   ~0106101

Working well. Thanks.

Pavol S

2018-01-28 19:37

reporter   ~0106102

Tested. Working.

Issue History

Date Modified Username Field Change
2018-01-10 14:25 Pavol S New Issue
2018-01-10 14:25 Pavol S File Added: scaled.png
2018-01-10 17:12 Ondrej Pokorny Note Added: 0105629
2018-01-10 18:35 Pavol S Note Added: 0105633
2018-01-11 03:14 Ondrej Pokorny Assigned To => Ondrej Pokorny
2018-01-11 03:14 Ondrej Pokorny Status new => assigned
2018-01-11 03:37 Ondrej Pokorny Note Added: 0105648
2018-01-11 14:51 Pavol S File Added: dpitest.zip
2018-01-11 14:58 Pavol S Note Added: 0105665
2018-01-12 16:44 Ondrej Pokorny Note Added: 0105705
2018-01-27 14:22 Ondrej Pokorny Fixed in Revision => 57156
2018-01-27 14:22 Ondrej Pokorny LazTarget => -
2018-01-27 14:22 Ondrej Pokorny Note Added: 0106070
2018-01-27 14:22 Ondrej Pokorny Status assigned => resolved
2018-01-27 14:22 Ondrej Pokorny Resolution open => fixed
2018-01-28 19:37 Pavol S Note Added: 0106101
2018-01-28 19:37 Pavol S Note Added: 0106102
2018-01-28 19:37 Pavol S Status resolved => closed