aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorShaun McCance <Shaun McCance>2009-10-06 04:09:46 +0800
committerShaun McCance <shaunm@gnome.org>2009-11-25 05:15:30 +0800
commitadade63c475294db24a422c3a0e5f6b3879641b6 (patch)
treef9e5d5c272c540bc82031a2196bc962cc38f6f50 /src/empathy-chat-window.c
parentbbe8c4eadaf0aadd45b3f70cb55dfad44bd4ba49 (diff)
downloadgsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar.gz
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar.bz2
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar.lz
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar.xz
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.tar.zst
gsoc2013-empathy-adade63c475294db24a422c3a0e5f6b3879641b6.zip
Move GtkTargetLists into priv so they're no longer static
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index a6bd5f259..cd2aeaffe 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -80,6 +80,8 @@ typedef struct {
NotifyNotification *notification;
NotificationData *notification_data;
+ GtkTargetList *move_targets;
+
/* Menu items. */
GtkUIManager *ui_manager;
GtkAction *menu_conv_insert_smiley;
@@ -1335,15 +1337,12 @@ chat_window_drag_motion (GtkWidget *widget,
guint time,
EmpathyChatWindow *window)
{
- static GtkTargetList *list = NULL;
GdkAtom target;
+ EmpathyChatWindowPriv *priv;
- if (list == NULL) {
- list = gtk_target_list_new (drag_types_dest_move,
- G_N_ELEMENTS (drag_types_dest_move));
- }
+ priv = GET_PRIV (window);
- target = gtk_drag_dest_find_target (widget, context, list);
+ target = gtk_drag_dest_find_target (widget, context, priv->move_targets);
/* If target != GDK_NONE, this target type is a type we should move
instead of copy. That's a notebook tab. Other drag types, such
as files or contacts, use copy.
@@ -1518,6 +1517,10 @@ chat_window_finalize (GObject *object)
}
}
+ if (priv->move_targets) {
+ gtk_target_list_unref (priv->move_targets);
+ }
+
chat_windows = g_list_remove (chat_windows, window);
gtk_widget_destroy (priv->dialog);
@@ -1629,6 +1632,10 @@ empathy_chat_window_init (EmpathyChatWindow *window)
g_object_unref (accel_group);
+ /* Set up drag target lists */
+ priv->move_targets = gtk_target_list_new (drag_types_dest_move,
+ G_N_ELEMENTS (drag_types_dest_move));
+
/* Set up smiley menu */
smiley_manager = empathy_smiley_manager_dup_singleton ();
submenu = empathy_smiley_menu_new (smiley_manager,