]> err.no Git - libchamplain/commitdiff
The window has to be realized (on show) before setting the cursor
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 20 May 2009 21:39:39 +0000 (17:39 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 20 May 2009 21:39:53 +0000 (17:39 -0400)
champlain-gtk/champlain-view-embed.c

index 6c7549bd73cbe5eb981cee076940669fca630aed..12121a0407da3b5abf058352247d286c8ef5dbdd 100644 (file)
@@ -64,6 +64,8 @@ static gboolean mouse_button_cb (GtkWidget *widget, GdkEventButton *event,
     ChamplainViewEmbed *view);
 static void view_size_allocated_cb (GtkWidget *widget,
     GtkAllocation *allocation, ChamplainViewEmbed *view);
+static void view_show_cb (GtkWidget *widget,
+    ChamplainViewEmbed *view);
 
 G_DEFINE_TYPE (ChamplainViewEmbed, champlain_view_embed, GTK_TYPE_ALIGNMENT);
 
@@ -168,6 +170,10 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
                     "size-allocate",
                     G_CALLBACK (view_size_allocated_cb),
                     embed);
+  g_signal_connect (priv->clutter_embed,
+                    "show",
+                    G_CALLBACK (view_show_cb),
+                    embed);
   g_signal_connect (priv->clutter_embed,
                     "button-press-event",
                     G_CALLBACK (mouse_button_cb),
@@ -188,6 +194,16 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
   embed->priv = priv;
 }
 
+static void
+view_show_cb (GtkWidget *widget,
+    ChamplainViewEmbed *view)
+{
+  ChamplainViewEmbedPrivate *priv = view->priv;
+
+  // Setup mouse cursor to a hand
+  gdk_window_set_cursor (priv->clutter_embed->window, priv->cursor_hand_open);
+}
+
 static void
 view_size_allocated_cb (GtkWidget *widget,
                         GtkAllocation *allocation,
@@ -196,9 +212,6 @@ view_size_allocated_cb (GtkWidget *widget,
   ChamplainViewEmbedPrivate *priv = view->priv;
 
   champlain_view_set_size(priv->view, allocation->width, allocation->height);
-
-  // Setup mouse cursor to a hand
-  gdk_window_set_cursor( priv->clutter_embed->window, priv->cursor_hand_open);
 }
 
 static gboolean