Things Are Weird in The Penguin World

While continuing the setup of my Linux machine, I've encountered an intriguing issue with the window management script I'm creating. Specifically, after hiding a Vesktop or Discord window, the very next click would unexpectedly bring a Cursor window to the front. Regarding Discord, it typically minimizes to the tray but also forces its window to appear on the taskbar unless KWin's window…