[eog] Support using a sealed GDK library



commit 573d5af2fe62d32972cce7b6089aabf6f34a79b5
Author: Felix Riemann <friemann gnome org>
Date:   Wed Jun 9 23:18:12 2010 +0200

    Support using a sealed GDK library
    
    Only works reliable as of GDK-2.21.2 due to API changes in that
    version.

 cut-n-paste/toolbar-editor/egg-editable-toolbar.c |   14 ++++++++++++++
 src/eog-window.c                                  |    5 +++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
index ada3932..80eeb86 100644
--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
@@ -688,11 +688,20 @@ toolbar_drag_data_received_cb (GtkToolbar         *toolbar,
         {
           gint tpos = get_toolbar_position (etoolbar, GTK_WIDGET (toolbar));
           egg_toolbars_model_add_item (etoolbar->priv->model, tpos, ipos, name);
+#if GTK_CHECK_VERSION(2, 21, 2)
+          gtk_drag_finish (context, TRUE, gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE, time);
+
+#else
           gtk_drag_finish (context, TRUE, context->action == GDK_ACTION_MOVE, time);
+#endif
         }
       else
         {
+#if GTK_CHECK_VERSION(2, 21, 2)
+          gtk_drag_finish (context, FALSE, gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE, time);
+#else
           gtk_drag_finish (context, FALSE, context->action == GDK_ACTION_MOVE, time);
+#endif
         }
     }
 
@@ -751,7 +760,12 @@ toolbar_drag_motion_cb (GtkToolbar         *toolbar,
                                            etoolbar->priv->dnd_toolitem, ipos);
     }
 
+#if GTK_CHECK_VERSION(2, 21, 1)
+  gdk_drag_status (context, gdk_drag_context_get_suggested_action (context),
+  		   time);
+#else
   gdk_drag_status (context, context->suggested_action, time);
+#endif
 
   return TRUE;
 }
diff --git a/src/eog-window.c b/src/eog-window.c
index 6289584..9e9a39c 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -4061,7 +4061,12 @@ eog_window_drag_data_received (GtkWidget *widget,
         if (!gtk_targets_include_uri (&target, 1))
                 return;
 
+#if GTK_CHECK_VERSION(2, 21, 1)
+        if (gdk_drag_context_get_suggested_action (context) == GDK_ACTION_COPY) 
+        {
+#else
         if (context->suggested_action == GDK_ACTION_COPY) {
+#endif
                 window = EOG_WINDOW (widget);
 
                 file_list = eog_util_parse_uri_string_list_to_file_list ((const gchar *) gtk_selection_data_get_data (selection_data));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]