How to track the state of a window toggle with python? With bpy I can call the following function:
bpy.ops.wm.window_fullscreen_toggle()

But how can I track the state of the toggle so that I avoid unnecessary calls to the bpy.ops.wm.window_fullscreen_toggle() function?
You can use the code
size = bpy.context.window.y
if size == 0:
     # it's fullscreen
else:
     # it's not fullscreen

I don't know if that's the proper way to do it, but it works for me