Use the system frame of the window, instead of the terrible program frame (or add a switch to the settings, for example, as implemented in the telegram).
As far as I noticed, the macOS version is fine, the window system frame is used.