Not true about focus returning to the desktop. BTW: Selenium works in the browser not the OS desktop.
I assume your test is 1) Open a browser 2) Minimize browser 3) Maximize browser. Who knows whats going on between those steps.
One way is to find out is with something like.... (python) focused_element = driver.switch_to.active_element
Is there any reason a test the focus feature seems to provide no logical validation within a browser test.