Xcode messes up the MacBook Screen Size

Hi everyone,

I’ve been experiencing a persistent issue with my MacBook Pro (M2 Pro, macOS 15.2) when using Xcode (version 16.2). If Xcode is open and my Mac goes into sleep mode, the screen size changes upon waking. Specifically, I notice 3mm bezels appear on each side of the screen, making the display slightly smaller, and everything scales down to fit this reduced size.

This issue happens multiple times a day and has been ongoing for over a year. It’s quite disruptive to my workflow.

Here is a video to illustrate the problem:

<video src="https://github.com/user-attachments/assets/5039aea3-08cc-4aef-9837-0594141a1925">

Has anyone encountered this before? If so, do you have any suggestions for fixing it or steps I can take to debug the issue?

Thanks in advance for your help and support!

Xcode messes up the MacBook Screen Size
 
 
Q