Commit 741c22c6 authored by Sébastien Wilmet's avatar Sébastien Wilmet

Fix critical messages with NULL cursor

gdk_cursor_new_from_name() can return NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=757639
parent b4130a94
......@@ -467,7 +467,7 @@ set_cursor_according_to_state (GtkTextView *view,
if (left_window != NULL)
gdk_window_set_cursor (left_window, cursor);
g_object_unref (cursor);
g_clear_object (&cursor);
}
else
{
......@@ -478,7 +478,7 @@ set_cursor_according_to_state (GtkTextView *view,
if (left_window != NULL)
gdk_window_set_cursor (left_window, NULL);
g_object_unref (cursor);
g_clear_object (&cursor);
}
}
......
......@@ -1954,7 +1954,6 @@ static void
set_busy (GeditFileBrowserWidget *obj,
gboolean busy)
{
GdkCursor *cursor;
GdkWindow *window;
window = gtk_widget_get_window (GTK_WIDGET (obj->priv->treeview));
......@@ -1965,11 +1964,12 @@ set_busy (GeditFileBrowserWidget *obj,
if (busy)
{
GdkDisplay *display;
GdkCursor *cursor;
display = gtk_widget_get_display (GTK_WIDGET (obj));
cursor = gdk_cursor_new_from_name (display, "progress");
gdk_window_set_cursor (window, cursor);
g_object_unref (cursor);
g_clear_object (&cursor);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment