Arduino IDE suddenly stops working.

The Arduino IDE has started to act really weird these past few weeks. At first i thought it was something maybe i did, but since then i have been careful and the problem keep appearing.
The IDE would stop working in the middle of editing code, uploading or using the serial monitor.
The tabs stay open, but i cant switch from one tab to another, i cant close the tabs and i cant edit,save or copy my code.
If i havent saved the code before it glitches out, i would have lost that work, and sometimes it is hours of work.
I have to restart my computer to start working again because the tabs wont close.
In the video that is linked, i am constatly left and right clicking on the ide, tabs and start menu.
Please fix this soon as it has made the IDE unusable.
Thank you for reading.

(deleted)

I use win10, have avast av but its disabled and i dont see how that would affect it. It started doing this maybe 1 or 2 releases ago. I have been using it for 1.5-2 years and this has never happened before

You neglected to say WHICH version of the IDE exactly ?

There are multiple causes for short hangs especially with windows and under powered hardware. Avast and indeed many Antivirus / anti malware programs can cause those short hangs too. More so if they are using "on demand" background scanning. Much better to add the Arduino install locations to the AV's exclusions / white list.

Other background programs can also have similar effects.

Lack of physical memory, lack of hard drive space, Embedded OS devices, laptops, low end graphics cards, incorrect system drivers or missing drivers, are only a few things that can also be a source of short hangs.

Win 10 with less than 4 gb of ram can be especially problematic as it will be switching in and out of paged memory / cache.

Could you also take a few moments to Learn How To Use The Forum. It will help you get the best out of the forum in the future. Other general help and troubleshooting advice can be found here.