forked from AuroraMiddleware/gtk
quartz: NSWindow NULL check in get_scale_factor
Sending backingScaleFactor to a NULL NSWindow will silently give the value 0 for the scale factor, causing insidious divide-by-zero bugs down the line. This checks if the NSWindow is NULL first, as seems to happen throughout the rest of the file. Note that I don't have a hi-DPI OS X machine to test this on, though. https://bugzilla.gnome.org/show_bug.cgi?id=738338
This commit is contained in:
parent
4bd787f2af
commit
ec37fbe2e2
@ -2852,7 +2852,7 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
|
|||||||
|
|
||||||
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||||
|
|
||||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
|
if (impl->toplevel != NULL && gdk_quartz_osx_version() >= GDK_OSX_LION)
|
||||||
return [(id <ScaleFactor>) impl->toplevel backingScaleFactor];
|
return [(id <ScaleFactor>) impl->toplevel backingScaleFactor];
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user