Unable to change cursor with GTK3
<p>I am trying to change the cursor of a window dynamically with GTK3 but <code>gtk_widget_get_parent_window</code> doesn't seem to work.</p>

<p>Could someone please point out what I'm doing wrong? Thanks!</p>

<pre><code>// https://developer.gnome.org/gtk3/stable/gtk-getting-started.html
// minimal example
#include &lt;gtk/gtk.h&gt;

static void
activate (GtkApplication* app,
          gpointer        user_data)
{
  GtkWidget *window;

  window = gtk_application_window_new (app);
  gtk_window_set_title (GTK_WINDOW (window), "Window");
  gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);

  // Here \/\/\/\/\/ .
  GdkWindow* w = gtk_widget_get_parent_window(window);
  GdkCursor* c = gdk_cursor_new_for_display(gdk_display_get_default(), GDK_WATCH);
  gdk_window_set_cursor(w, c);
  //      /\/\/\/\/\ .

  gtk_widget_show_all (window);
}

int
main (int    argc,
      char **argv)
{
  GtkApplication *app;
  int status;

  app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
  g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
  status = g_application_run (G_APPLICATION (app), argc, argv);
  g_object_unref (app);

  return status;
}
</code></pre>

<blockquote>
  <p>(main.exe:16508): Gdk-CRITICAL **: gdk_window_set_cursor: assertion
  'GDK_IS_WINDOW (window)' failed</p>
</blockquote>

<p>I am using GTK 3.16 with msys2</p>

<p>Many thanks in advance.</p>