Im using Xmonad as a window manager. To automatically handle fullscreen window i use XMonad.Hooks.EwmhDesktops.fullscreenEventHook. And put this in my config: