]> Pileus Git - ~andy/gtk/commitdiff
Redo the fix for bug #492117, by adding a getter for the private drag
authorRichard Hult <richard@imendio.com>
Thu, 1 Nov 2007 08:45:30 +0000 (08:45 +0000)
committerRichard Hult <rhult@src.gnome.org>
Thu, 1 Nov 2007 08:45:30 +0000 (08:45 +0000)
2007-11-01  Richard Hult  <richard@imendio.com>

* gdk/quartz/GdkQuartzWindow.c:
* gdk/quartz/GdkQuartzWindow.h:
* gdk/quartz/gdkdnd-quartz.c:
* gdk/quartz/gdkquartz.h:
* gtk/gtkdnd-quartz.c: Redo the fix for bug #492117, by adding a
getter for the private drag context info so we don't need to
expose so much in the public quartz header file.

svn path=/trunk/; revision=18959

ChangeLog
gdk/quartz/GdkQuartzWindow.c
gdk/quartz/GdkQuartzWindow.h
gdk/quartz/gdkdnd-quartz.c
gdk/quartz/gdkquartz.h
gtk/gtkdnd-quartz.c

index a781584aeef5ffdf412ff2e80be708a2d384b730..df861b07b930651a93cefd880d816aa4b87375ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-11-01  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/GdkQuartzWindow.c:
+       * gdk/quartz/GdkQuartzWindow.h:
+       * gdk/quartz/gdkdnd-quartz.c:
+       * gdk/quartz/gdkquartz.h:
+       * gtk/gtkdnd-quartz.c: Redo the fix for bug #492117, by adding a
+       getter for the private drag context info so we don't need to
+       expose so much in the public quartz header file.
+
 2007-11-01  Richard Hult  <richard@imendio.com>
 
        * gdk/quartz/GdkQuartzWindow.h: Fix build, bug #492117.
index ee32e3aa580f4dcd988aa8c4144b480976b94508..7200035a5f1e10786c3b8aea9686830380ceec4d 100644 (file)
@@ -411,7 +411,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
 
 - (void)draggingEnded:(id <NSDraggingInfo>)sender
 {
-  g_object_unref (current_context);
+  if (current_context)
+    g_object_unref (current_context);
   current_context = NULL;
 }
 
index 629f4e430aa92e03cbbacc0ab42d47b690072d27..f081908fd45eb183abe76b0c72974b28fc16e01f 100644 (file)
@@ -18,7 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#import <Cocoa/Cocoa.h>
+#import <AppKit/AppKit.h>
+#import <Foundation/Foundation.h>
 #include <glib.h>
 
 @interface GdkQuartzWindow : NSWindow {
index 69e3f705fdfea0b36f837d827ed7926a3f30e8ed..40e90afe5bff665b2232ec193a222dabb68fa1a7 100644 (file)
@@ -210,3 +210,9 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
   /* FIXME: Implement */
   return FALSE;
 }
+
+id
+gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
+{
+  return GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info;
+}
index 0db36fed4233b7f3720ee56ad6ad494efee65f67..2950e733a66d3eef9cc75bdc98fc8b0244dbc799 100644 (file)
@@ -1,16 +1,34 @@
+/* gdkquartz.h
+ *
+ * Copyright (C) 2005-2007 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
 #ifndef __GDK_QUARTZ_H__
 #define __GDK_QUARTZ_H__
 
 #include <AppKit/AppKit.h>
 #include "gdk/gdkprivate.h"
-#include "gdkprivate-quartz.h"
-#include "gdkdrawable-quartz.h"
-#include "gdkwindow-quartz.h"
 
 G_BEGIN_DECLS
 
-NSView  *gdk_quartz_window_get_nsview  (GdkWindow *window);
-NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
+NSView  *gdk_quartz_window_get_nsview                          (GdkWindow      *window);
+NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only             (GdkPixbuf      *pixbuf);
+id       gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context);
 
 G_END_DECLS
 
index 606aaf085679028715032bdabe65ec08727af96d..4bfc34e7f2e5d5dd34041824ebffd5705cca3581 100644 (file)
@@ -181,12 +181,15 @@ gtk_drag_get_data (GtkWidget      *widget,
                   GdkAtom         target,
                   guint32         time)
 {
-  id <NSDraggingInfo> dragging_info = GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info;
-  NSPasteboard *pasteboard = [dragging_info draggingPasteboard];
+  id <NSDraggingInfo> dragging_info;
+  NSPasteboard *pasteboard;
   GtkSelectionData *selection_data;
   GtkDragDestInfo *info;
   GtkDragDestSite *site;
 
+  dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context);
+  pasteboard = [dragging_info draggingPasteboard];
+
   info = gtk_drag_get_dest_info (context, FALSE);
   site = g_object_get_data (G_OBJECT (widget), "gtk-drag-dest");
 
@@ -976,8 +979,8 @@ gtk_drag_dest_find_target (GtkWidget      *widget,
                            GdkDragContext *context,
                            GtkTargetList  *target_list)
 {
-  id <NSDraggingInfo> dragging_info = GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info;
-  NSPasteboard *pasteboard = [dragging_info draggingPasteboard];
+  id <NSDraggingInfo> dragging_info;
+  NSPasteboard *pasteboard;
   GtkWidget *source_widget;
   GList *tmp_target;
   GList *tmp_source = NULL;
@@ -987,6 +990,9 @@ gtk_drag_dest_find_target (GtkWidget      *widget,
   g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE);
   g_return_val_if_fail (!context->is_source, GDK_NONE);
 
+  dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context);
+  pasteboard = [dragging_info draggingPasteboard];
+
   source_widget = gtk_drag_get_source_widget (context);
 
   if (target_list == NULL)