MATLAB: The figure position returned within the Figure ResizeFcn gives unexpected result.

Why does the figure position return unexpected results when we query for the position from inside figure resize callback functions (ResizeFcn property) on UNIX-based platforms?

Best Answer

On UNIX-based platforms, when a figure has a ResizeFcn that changes the position of the callback figure (the figure returned by "gcbf"), the results are not always as expected. The unexpected behavior happens when the ResizeFcn is triggered by manually changing the figure's size using the mouse. In this case, the ResizeFcn is fired several times during the manual resize, and is always fired with the final manually-applied position value, but this final call can happen before the mouse button is released. However, MATLAB might not be able to resize a figure while it is being manually resized by the mouse. Unfortunately there is no workaround for this issue.
This behavior differs from the behavior on Windows, where the ResizeFcn is not called during the manual resize, but instead is called one time after the mouse button is released.