#PB_Event_SizeWindow works different with #Window=0

Post bugreports for the Mac OSX version here
User avatar
Posts: 1831
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

#PB_Event_SizeWindow works different with #Window=0

Post by Shardik »

In his posting "Window resize events" WilliamL has posted an example which generates on MacOS multiple resize events on #PB_Event_SizeWindow with #Window=1 or higher or with #PB_Any. But with #Window=0 always only one resize event is generated.

I have found this bug testing with the following MacOS versions:
  • MacOS 10.6.8 'Snow Leopard'
  • MacOS 10.13.6 'High Sierra'
  • MacOS 10.14.6 'Mojave'
  • MacOS 10.15.6 'Catalina'
I was able to find out that the bug was introduced between PB 5.42 and 5.43 (no difference between x86 and x64):
5.72 +
5.62 +
5.51 +
5.50 +
5.46 +
5.43 +
5.42 -
5.31 -

The bug may have been introduced in responce to the thread [Done] dozens SizeWindow events after resizing a window where Fred at the end remarked "Fixed."

By the way I had already posted in 2014 this cross-platform example in the German forum that demonstrates how to detect the end of a window resizing action in Linux, MacOS and Windows by using PostEvent() to generate a new custom event to indicate that the resizing has been finished.

Unfortunately PureBasic's handling of #PB_Event_SizeWindow events is different on all 3 supported operating systems when resizing a window:
  • Linux: multiple #PB_Event_SizeWindow events are generated.
  • MacOS: for a window with #Window=0 only one #PB_Event_SizeWindow event is generated; for #Window<>0 multiple #PB_Event_SizeWindow events are generated.
  • Windows: only one #PB_Event_SizeWindow event is generated.
You may also take a look into this even more detailed analysis based on an example from mk-soft.

Therefore I would suggest that on all 3 operating systems multiple #PB_Event_SizeWindow events should be generated during the resizing of a window and that a new event (for example #PB_Event_SizeWindowFinished) should be generated at the end of a resizing as demonstrated in my cross-platform example which works in Linux (GTK2 and GTK3), MacOS and Windows...