gdk/quartz: Fix mixup in attributes usage creating window implementation

First, attributes can be NULL (which is always the case when calling
gdk_window_ensure_native) so do not unconditionally dereference it.

Then the window_type should be taken directly from the GdkWindow as
in other backends (such as the X11 one for example).

https://bugzilla.gnome.org/show_bug.cgi?id=744942
This commit is contained in:
Thibault Saunier
2015-02-22 13:01:17 +01:00
parent e2e37c772f
commit e2d89d21d4

View File

@@ -873,7 +873,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = NULL;
switch (attributes->window_type)
switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
@@ -901,8 +901,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
window->width,
window->height);
if (attributes->window_type == GDK_WINDOW_TEMP ||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
if (window->window_type == GDK_WINDOW_TEMP ||
((attributes_mask & GDK_WA_TYPE_HINT) &&
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
{
style_mask = NSBorderlessWindowMask;
}