mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Added a GTK2/GTK3-compatible cursor unref helper to centralize cleanup logic.
Switched cursor destruction to use the new helper in the widget teardown path.
This commit is contained in:
@@ -150,6 +150,16 @@ static void gtk_xtext_search_fini (xtext_buffer *);
|
|||||||
static gboolean gtk_xtext_search_init (xtext_buffer *buf, const gchar *text, gtk_xtext_search_flags flags, GError **perr);
|
static gboolean gtk_xtext_search_init (xtext_buffer *buf, const gchar *text, gtk_xtext_search_flags flags, GError **perr);
|
||||||
static char * gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent, int *ret_off, int *ret_len, GSList **slp);
|
static char * gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent, int *ret_off, int *ret_len, GSList **slp);
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
gtk_xtext_cursor_unref (GdkCursor *cursor)
|
||||||
|
{
|
||||||
|
#if !HAVE_GTK3
|
||||||
|
gdk_cursor_unref (cursor);
|
||||||
|
#else
|
||||||
|
g_object_unref (cursor);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
xtext_set_source_color (cairo_t *cr, const XTextColor *color, gdouble alpha)
|
xtext_set_source_color (cairo_t *cr, const XTextColor *color, gdouble alpha)
|
||||||
{
|
{
|
||||||
@@ -689,21 +699,13 @@ gtk_xtext_destroy (GtkObject * object)
|
|||||||
|
|
||||||
if (xtext->hand_cursor)
|
if (xtext->hand_cursor)
|
||||||
{
|
{
|
||||||
#if !HAVE_GTK3
|
gtk_xtext_cursor_unref (xtext->hand_cursor);
|
||||||
gdk_cursor_unref (xtext->hand_cursor);
|
|
||||||
#else
|
|
||||||
g_object_unref (xtext->hand_cursor);
|
|
||||||
#endif
|
|
||||||
xtext->hand_cursor = NULL;
|
xtext->hand_cursor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xtext->resize_cursor)
|
if (xtext->resize_cursor)
|
||||||
{
|
{
|
||||||
#if !HAVE_GTK3
|
gtk_xtext_cursor_unref (xtext->resize_cursor);
|
||||||
gdk_cursor_unref (xtext->resize_cursor);
|
|
||||||
#else
|
|
||||||
g_object_unref (xtext->resize_cursor);
|
|
||||||
#endif
|
|
||||||
xtext->resize_cursor = NULL;
|
xtext->resize_cursor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user