Avoid unnecessary window flushes
The code was calling _gdk_window_ref_cairo_surface in a few places where the intent was not to read/write to the surface, but just look at its type (to e.g. create a similar surface). This is bad, as that operation causes a flush which may cause unnecessary work and/or flashing. Instead we just get the impl surface in these cases.
Showing with 3 additions and 2 deletions