ChangeDisplaySize() vs SetDisplayAttributes()

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

ChangeDisplaySize() vs SetDisplayAttributes()

Post 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)
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ChangeDisplaySize() vs SetDisplayAttributes()

Post by airsoftsoftwair »

lazi wrote: Sun Feb 06, 2022 2:10 pm Now the question: bug or feature? :-)
Looks like a bug, I'll check ;)
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ChangeDisplaySize() vs SetDisplayAttributes()

Post 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
Post Reply