Find if windowed mode has been maximised

Hey everyone,

I am running into an issue where i am trying to detect when a user has maximised a unity window from windowed mode. I’ve tried comparing Screen.height / width against Screen.currentResolution but when maximising from windowed mode, Screen.height takes into account the task bar so it never reaches currentResolution.height.

Is there a event or another way i can check to see if the user has maximised the window? I cant seem to find anything on the internet.

This is a windows project.

Cheers!

You can’t tell if the window itself has been maximised or not, because Unity doesn’t give you that low level access to their windows.

What you could possibly do is use Screen.width/height, or Display.displays[0].renderedWidth/Height to check the size of the window when it comes back into focus after being maximised, using OnApplicationFocus(), and then use that to determine what behaviour you want to happen