paned: quietly handle missing cursors

The row-/col-resize cursors should really be present, but if they
aren't we don't need to crash.

https://bugzilla.gnome.org/show_bug.cgi?id=771963
This commit is contained in:
Matthias Clasen 2016-09-27 14:55:13 -04:00
parent fea851b3eb
commit 6181ff2552

View File

@ -1689,6 +1689,7 @@ gtk_paned_realize (GtkWidget *widget)
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK); GDK_POINTER_MOTION_MASK);
attributes.cursor = NULL;
attributes_mask = GDK_WA_X | GDK_WA_Y; attributes_mask = GDK_WA_X | GDK_WA_Y;
if (gtk_widget_is_sensitive (widget)) if (gtk_widget_is_sensitive (widget))
{ {
@ -1701,8 +1702,7 @@ gtk_paned_realize (GtkWidget *widget)
priv->handle = gdk_window_new (window, priv->handle = gdk_window_new (window,
&attributes, attributes_mask); &attributes, attributes_mask);
gtk_widget_register_window (widget, priv->handle); gtk_widget_register_window (widget, priv->handle);
if (attributes_mask & GDK_WA_CURSOR) g_clear_object (&attributes.cursor);
g_object_unref (attributes.cursor);
priv->child1_window = gtk_paned_create_child_window (paned, priv->child1); priv->child1_window = gtk_paned_create_child_window (paned, priv->child1);
priv->child2_window = gtk_paned_create_child_window (paned, priv->child2); priv->child2_window = gtk_paned_create_child_window (paned, priv->child2);