For the record, the first commit corresponds to 099bc21df7f for d3d9. We don't get WM_MOVE because we are minimizing a window that was maximized and then restoring it, which doesn't change its position at all. Not sure what circumstances the window can actually be moved?
Second commit: we should in theory already *have* focus from the previous ShowWindow(focus_window, SW_SHOWNORMAL), I think? But d3d9 does the same thing anyway (introduced with the tests in 36553d862, specifically the line marked "For KDE".) Since this is probably a winex11 bug and orthogonal to the tests anyway I think it makes sense.