We can use Math.round(width/2) to avoid the issue when the width is not an even number. Fractional number in the x co-ordinate will throw an error.
In windows, when I tried x=300 it automatically changed that to x=301 during execution and hence I faced this issue.
https://github.com/StephenGrider/ElectronCode/blob/02c76dd7cbb7c0bfb5851c70e885d7a07971c69a/completed_code/tasky/app/timer_tray.js#L27
We can use Math.round(width/2) to avoid the issue when the width is not an even number. Fractional number in the x co-ordinate will throw an error. In windows, when I tried x=300 it automatically changed that to x=301 during execution and hence I faced this issue.