display – Screen freezes but mouse/keyboard/sound working

Lately I have been experiencing screen freezes when I am playing some games. Screen is locked, only mouse pointer moves. I can still hear and talk through vc and have sound from game. Keyboard is also working( I tested alt+tab + random gibberish on notes and it was saved). Until today I thought that only workaround is to force reboot my Mac but today I tried replugging my monitors and it worked too. I have m1 Mac mini from release day and this problem only showed about 1-2 weeks ago.

My setup:

  • Mac mini m1
  • 1 monitor -> hdmi -> Mac mini
  • 1 monitor -> hdmi -> usb-c hub -> Mac mini

This happens mostly when playing some games, not all thought.

Having workaround to replug cables is fine for now but I would prefer to fix it.