Skip to content

gdkquartz: fix crash on uninitialized attribute

Lukas Oberhuber requested to merge lukaso/gtk:gtk-3-24 into gtk-3-24

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)

Merge request reports