Page 1 of 1

ChangeDisplaySize() vs SetDisplayAttributes()

Posted: Sun Feb 06, 2022 2:10 pm
by lazi
While RapaGUI in on and I want to change a separate -non embedded- display's size, only SetDisplayAttributes() makes visible effect.

Try this test case:

Code: Select all

@REQUIRE "rapagui"
@DISPLAY 1,{hidden=False, title="World", mode="windowed", width=320, height=200}

Const #scrolldisplay = 1

OpenDisplay(#scrolldisplay)

SelectDisplay(#scrolldisplay)
TextOut(#CENTER,#CENTER, "Press LMB")

WaitLeftMouse
ChangeDisplaySize(640,480,{x=#KEEPPOSITION,y=#KEEPPOSITION})
;SetDisplayAttributes({width=640, height=480})

TextOut(#CENTER,#CENTER, "Display changed!")
WaitLeftMouse   
The OpenDisplay() is needed because RapaGUI keeps the display closed by default.
If you run the script, the text will be vanish and the display attributes are changes but the window will keeps the same size.
Then you should uncomment SetDisplayAttributes() and comment out ChangeDisplaySize() and voila, works as expected.

Now the question: bug or feature? :-)

(OS4.1FEu2, Peg2, HW9, RapaGUI 2.1)

Re: ChangeDisplaySize() vs SetDisplayAttributes()

Posted: Sun Feb 13, 2022 4:58 pm
by airsoftsoftwair
lazi wrote: Sun Feb 06, 2022 2:10 pm Now the question: bug or feature? :-)
Looks like a bug, I'll check ;)

Re: ChangeDisplaySize() vs SetDisplayAttributes()

Posted: Sun Aug 18, 2024 9:26 pm
by airsoftsoftwair
Actually, this was a Hollywood bug introduced in version 9.0. It's fixed now.

Code: Select all

- Fix: When using SYSTEMSCALE and the current monitor didn't use any DPI-scaling or when directly setting
  SCALEFACTOR to 1, calling ChangeDisplaySize() didn't work correctly; this bug was introduced version 9.0