diff options
Diffstat (limited to 'src/interface-gtk/gtk-info-popup.c')
-rw-r--r-- | src/interface-gtk/gtk-info-popup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/interface-gtk/gtk-info-popup.c b/src/interface-gtk/gtk-info-popup.c index b9ca41c..aaa0a65 100644 --- a/src/interface-gtk/gtk-info-popup.c +++ b/src/interface-gtk/gtk-info-popup.c @@ -47,6 +47,7 @@ struct _TecoGtkInfoPopup { GtkAdjustment *hadjustment, *vadjustment; GtkWidget *flow_box; + GdkCursor *cursor; /*< pointer/hand cursor */ GStringChunk *chunk; teco_stailq_head_t list; guint idle_id; @@ -74,6 +75,9 @@ teco_gtk_info_popup_finalize(GObject *obj_self) while ((entry = teco_stailq_remove_head(&self->list))) g_free(entry); + if (self->cursor) + g_object_unref(self->cursor); + /* chain up to parent class */ G_OBJECT_CLASS(teco_gtk_info_popup_parent_class)->finalize(obj_self); } @@ -354,6 +358,16 @@ teco_gtk_info_popup_idle_add(TecoGtkInfoPopup *self, teco_popup_entry_type_t typ gtk_widget_show_all(hbox); gtk_container_add(GTK_CONTAINER(self->flow_box), hbox); + + GtkWidget *flow_box_child = gtk_widget_get_parent(hbox); + g_assert(GTK_IS_FLOW_BOX_CHILD(flow_box_child)); + GdkWindow *window = gtk_widget_get_window(flow_box_child); + g_assert(window != NULL); + + if (G_UNLIKELY(!self->cursor)) + /* we only initialize it now after guaranteed widget realization */ + self->cursor = gdk_cursor_new_from_name(gdk_window_get_display(window), "pointer"); + gdk_window_set_cursor(window, self->cursor); } static gboolean |