Jump to content
Sign in to follow this  
luebbe

Drawing bug with VCL Styles

Recommended Posts

Hi Folks,

 

I have a strange bug when a VCL styled application is maximized in a dual monitor configuration.

 

Steps to reproduce:

1. Set your windows task bar position to "top"

2. Create a minimal application and activate a VCL style (add a main menu if you like)

3. Run the application and:

   * maximize it on the primary monitor (fine)

   * maximize it on the secondary monitor (The top part of the application, probably the height of the windows task bar, becomes transparent)

 

image.png.e31a4c7c4e2f5ab4ff4584e2749209cd.pngimage.png.cfbf9f86cad7acdccfeb4ddee2ac9cb1.png

 

left: maximized on primary monitor

right: maximized on secondary monitor

 

Additional Info:

* My two monitors have different resolutions and they have a vertical offset

* This bug doesn't seem to affect many people (no customer has reported it so far ;-))

* This is not a new bug. I've seen for years (three to four) it in several Delphi versions, but I can't put a date on it

 

Today I tried to find out if it is a problem with our main form's settings, but since it also happens with a minimal application, it probably isn't.

Has anybody encountered this as well?

Does anyone know how to fix it?

Do I have to wait for Emba to fix it?

 

Cheers & thanks

Lübbe

 

Share this post


Link to post

Do the two screens have different DPI?

What kind of HighDPI settings do you have in the manifest?

Share this post


Link to post
Posted (edited)

I didn't touch anything knowingly in the manifest. Just dropped a menu on the form and activated a VCL style.

The minimal app has "per monitor v2"

Our standard app has "none"

So I guess it doesn't have anything to do with dpi awareness?

Edited by luebbe

Share this post


Link to post

Can you zip the project and attach the minimal app source here so that I can try your exact experiment on my two screen solutiuon?

I have two 4k screens, but of different size, and the smaller has a different scaling.

 

Share this post


Link to post

I cannot replicate your problem on first try.
Menu and title bar looks ok maximized on both screens.

The size of the window adjusts according to DPI as I drag it from one screen to the other.

Share this post


Link to post

Also tried resizing the size of one monitor and aligning it to the top, as well as to the bottom.

No unexpected size effects.

image.png.01c34a1d7ba67e67089220f222725221.png

 

Are you sure you are not running some Windows video driver software that manages windows?

 

Share this post


Link to post

I was half fearing @lars' answer :)
Thanks to @dwrbudr for confirming it.

 

This is my monitor setup with (1) being the laptop monitor as secondary screen and (2) the desktop monitor as primary screen.

image.thumb.png.39adca32b891edc7534acd1c83015bd9.png

Share this post


Link to post

I didn't try that offset config. I always aligned the top or the bottom edges?

Share this post


Link to post

Ok, I tried with the vertical offsets as well.  No change. Maximized perfectly - even when spanning both displays.

I suspect driver antics?

 

What are the resolutions and scaling of monitor 1 and 2 ?

Share this post


Link to post
Posted (edited)

Sorry for the late reply. It was a very busy week.

 

Monitor 1: 1920x1080 (??" Laptop screen)

Monitor 2: 2560x1440 (27")

Both set to 100% font scaling

 

It also happens on my desktop PC at work, which has two 24" monitors with different resolutions

Monitor 1: 2560x1440 (24")

Monitor 2: 1920x1080 (24")

Both set to 100% font scaling

They have a slight vertical offset IIRC (working from home, desktop is in the office)

 

May be driver antics, but our IT department keeps everything as up-to-date as possible.

 

I'll compile it with the community edition on my home PC and try what happens there.

Edited by luebbe

Share this post


Link to post
Posted (edited)

Yes, immediately reproducible on my home PC

 

Screen layout:

image.png.cf410c88b4c911629b95642ef115b54a.png

 

Monitor 1: 1920x1080 (24")

Monitor 2: 2560x1440 (27")

 

When both monitors align at the top, everything is fine.

 

This is also sufficient.

image.png.07af4102c7eefbf52febbade5a9e176f.png

 

You have to toggle the app between normal and maximized mode after you change the screen alignment. If you leave the app maximized while changing the screen alignment, everything will stay ok.

Edited by luebbe

Share this post


Link to post
Posted (edited)

Lucky you 😉

 

10.4.2 + all patches (work laptop)

10.4.1 + all patches (work desktop)

10.3.x community edition (home)

Edited by luebbe

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×