Screen changes in 2023r4 but fine in 2023r3.1

I have some software that has been working fine on Windows with 2023r3.1 (and before) that puts up a splash screen (centered) and does some work and eventually puts up a new window (centered) when everything is ready. In 2023r4, during startup, the splash looks great for a second but then it appears to resize and reposition (I don’t change any resolutions or anything). Then all centering of windows is off and the sizes of my windows look smaller. I’ve attached 2 screenshots to illustrate. I added a debug window with calls to the DesktopDisplay values (AvailableLeft, AvailableTop, Width, Height, AvailableWidth, AvailableHeight, ScaleFactor and ColorDepth) to see if anything thing changes and it doesn’t appear to do so. The line “600, 582” is the size of the splash window before and after the weird resize. Does anyone have any ideas to help narrow down what the heck is happening on 2023r4?


Can you share a demo/simple app for review and test?

That demo can be used to create an issue in xojom.com/issues

1 Like

Yep, make a simple sample showing a window centered as splash with some text in it and resizing magically after a simulated busy time and submit the sample for verification. Add before and after pictures too. Debug values is a plus.

I’ve noticed that you are using a VM with possible not usual screen sizes too. Add those infos too.

You could have found some bug triggered by some unexpected configuration.

R4 had a bug fixed for multiple monitors with different scales on Windows, maybe you have found and triggered some bug in this new code, or the inverse, you were used to a problem that once fixed looks defective.

We need to find out.

1 Like

Did you use the debugger to to step by step the moment the splash screen is displayed ? You may discover what triggers the issue in you code, whether it’s your code or a call that to a framework function.

Yeah I have done the step by step - narrowed it down to the activation of one of my windows where I have a break in the opening event but it happens even before the first line is executed. Baby steps I guess so maybe one of the widgets in that window is acting strangely. More debugging to follow.

1 Like

Ok I did a little test program but I can’t seem to add the project here - won’t allow me to choose it to upload so I’ve included the simple code below and screenshots with Windows resolutions on the right side. It appears that if scaling is 100%, things work great for my real program and this test code but with different scaling, things go south at startup. I’m using the MBS overlay function for the splash window and the AdvisoryWindow is the window that gets shown after all initialization is done in my real program.

=================================================
dim o as OverlayMBS
dim p as Picture
dim w,h,left, top as integer

w=300
h=300
left=DesktopDisplay.DisplayAt(0).Width / 2 - w/2
top=DesktopDisplay.DisplayAt(0).Height / 2 -h/2

o=new OverlayMBS(left, top, w, h)

p=New Picture(300,300,32)
p.Graphics.ForeColor=&c000000
p.Graphics.FillRect 0,0,300,300

o.Pict=p
p=New Picture(300,300,32)
p.Graphics.ForeColor=&c000000
p.Graphics.FillOval 0,0,300,300
p.Graphics.ForeColor=&cFFFFFF
p.Graphics.FillOval 100,100,100,100

o.Mask=p

o.UpdateShow

DelayMBS 5

AdvisoryWindow.CenterWin
o.Hide
AdvisoryWindow.Show




That may be your problem.

Put your sample into a zip and share it using some service as Google Drive or whatever, so @Christian_Schmitz can take a look.

And the symptoms you reported are probably tied to screen scaling math.

Okay, I had time to review the example project.

Problem seems to be that in older Xojo version the app was not doing HighDPI and the new one does.

So OverlayMBS needs coordinates on Windows in pixel (But points on macOS, a difference we can’t easily remove nowadays).

e.g.

Dim w,h,Left, top As Integer
dim pw, ph as integer

Dim Display As DesktopDisplay = DesktopDisplay.DisplayAt(0)
Dim scale As Double = Display.ScaleFactor

w = 300 
h = 300

Left = (DesktopDisplay.DisplayAt(0).Width  - w) / 2
top  = (DesktopDisplay.DisplayAt(0).Height - h) / 2

#if TargetWindows then
  Left = Left * scale
  Top  = Top  * scale
  w    = w    * scale
  h    = h    * scale
  pw = w
  ph = h
#ElseIf TargetMacOS Then
  // always using 1x for window size, but scale for picture size
  pw = w * scale
  ph = h * scale
  scale = 1 
#EndIf

System.DebugLog "w: "+Str(w)
System.DebugLog "h: "+Str(h)

System.DebugLog "left: "+Str(Left)
System.DebugLog "top:  "+Str(top)

o=New OverlayMBS(Left, top, w, h)

So we use picture for content with pw/ph and full resolution.
But use scale for Windows to scale width/height, left and top for the overlay coordinates.

Does it work now?

1 Like