It's probably worth pointing out that this has quite some potential for causing regressions in performance. swapchain_blit_gdi() is not fast, and ideally we'd work on reducing the number of cases where it's needed.
The fundamental idea here is that setting and restoring the pixel format is even worse, since we always need to recreate the GLX drawable when we do that. And as far as I can tell, this patch doesn't force GDI blitting in any other circumstance.
That said, what about Mac? I don't really know what's going on here; set_pixel_format() seems to be cheap, but I can't easily tell if that's because it really is cheap, or because setting the pixel format just doesn't work. Either way this patch is questionable as-is.