Kodi 17.1 turns to black screen and crashes after Alt-Tab

I am currently running Kodi 17.1 on Mythbuntu 16.04.2 LTS which is basically Ubuntu with XFCE as it’s GUI.

Lately I have been having a strange bug with Kodi that while playing a video and I decide to switch to another window with Alt-Tab and come back to Kodi, it will become a black screen and play audio for like 5 seconds before everything stops and it’s just a black screen.

I normally have to kill Kodi forcibly and open it again.

I tried Kodi 18.0 Alpha 1 and still the same issue.