Active window keeps making itself inactive, device becomes unusable without a restart
I'm running 26.2 on my M4 MacBook Pro and recently started seeing an issue that (so far) I can't fix without a restart. After working fine for days at a time, it will go into a mode where the front-most, active window instantly (tenths of a second, maybe a second at most sometimes) moves into the background and is inactive. Clicking on the window brings it to the front again, but then it immediately goes into the background again, rinse and repeat. A restart fixes the issue until it strikes again. This seems to affect multiple different applications (certainly Safari and Outlook).
I've tried searching but nothing seems to come up in other threads here. Anybody got a clue what's happening?