Hi Mehdi,
I understand that app2 becomes visible when its position is altered from the master app, even though its “Visible” property is set to “off”. I was able to reproduce the issue in MATLAB R2023b.
I have verified that this issue is not present in MATLAB R2024a. If you wish, you may upgrade to the latest MATLAB version.
You can work around the issue in MATLAB R2023b by toggling visibility to “on” and then back to “off” right after updating its position:
app.ap2.UIFigure.Visible = "on";
app.ap2.UIFigure.Visible = "off";
However, the UI figure might still be briefly displayed on the screen before getting hidden.
Hope this helps.