gdkquartz: fix crash on uninitialized attribute
gdk_quartz_display_get_monitor_at_window
crashes when it tries to access the NSWindow on
an offscreen window. The attribute toplevel
of impl
is uninitialized and
causes a segfault.
The solution is to walk up the parent tree to find a valid proxy which will contain a valid NSWindow
.
Additionally, the code nulls out the impl->toplevel
variable when it is not set.
This partially fixes: gimp#7608 (closed)