From: Pierre-Luc Beaudoin Date: Wed, 20 May 2009 21:39:39 +0000 (-0400) Subject: The window has to be realized (on show) before setting the cursor X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2001111130c39fe87ed7898af8ec5e9f475a89df;p=libchamplain The window has to be realized (on show) before setting the cursor --- diff --git a/champlain-gtk/champlain-view-embed.c b/champlain-gtk/champlain-view-embed.c index 6c7549b..12121a0 100644 --- a/champlain-gtk/champlain-view-embed.c +++ b/champlain-gtk/champlain-view-embed.c @@ -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