MacBook apps keep getting rapidly deselected
My MacBook keeps deselecting my app (the app loses the focus, the top bar turns into the color of a background app). When I restart it the problem get temporarily fixed but it comes back every 1-2 days. This has become increasingly annoying to deal with. Even with every app closed except google chrome, the problem still persists. I have seen many people online with the same problem, but I can't find a way to permanently solve this problem, they only say to restart. I have also not downloaded anything sketchy on this MacBook that would cause this problem. The top bar on the screen still says chrome is the app when it gets deselected, however I have no other instances running that could have been selected. The rapid deselection also happened if I'm not touching the laptop or mouse. All relevant software plus macOS is up to date.
MacBook Pro (2017 – 2020)