]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkdnd-quartz.c
Quartz: gtk_drag_highlight_draw(): Set the GtkStyleContext to the widget.
[~andy/gtk] / gtk / gtkdnd-quartz.c
index d990029cd86cc27fc7e7a30b2b02e839536039c0..b577bb6f105ae4a6d808d6c2b70b87643c773c0f 100644 (file)
@@ -34,7 +34,7 @@
 #include "gtkdnd.h"
 #include "gtkiconfactory.h"
 #include "gtkicontheme.h"
-#include "gtkimage.h"
+#include "gtkimageprivate.h"
 #include "gtkinvisible.h"
 #include "gtkmain.h"
 #include "gtkplug.h"
@@ -147,6 +147,7 @@ struct _GtkDragFindData
   selection_data.data = NULL;
   selection_data.length = -1;
   selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
+  selection_data.display = gdk_display_get_default ();
 
   if (gtk_target_list_find (info->target_list, 
                            selection_data.target, 
@@ -347,11 +348,14 @@ gtk_drag_highlight_draw (GtkWidget *widget,
 {
   int width = gtk_widget_get_allocated_width (widget);
   int height = gtk_widget_get_allocated_height (widget);
+  GtkStyleContext *context = gtk_widget_get_style_context (widget);
 
-  gtk_paint_shadow (gtk_widget_get_style (widget), cr,
-                    GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                    widget, "dnd",
-                    0, 0, width, height);
+  gtk_style_context_save (context);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_DND);
+
+  gtk_render_frame (context, cr, 0, 0, width, height);
+
+  gtk_style_context_restore (context);
 
   cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
   cairo_set_line_width (cr, 1.0);
@@ -1107,6 +1111,7 @@ gtk_drag_begin_internal (GtkWidget         *widget,
 {
   GtkDragSourceInfo *info;
   GdkDragContext *context;
+  GdkDevice *pointer;
   NSWindow *nswindow;
 
   context = gdk_drag_begin (gtk_widget_get_window (widget), NULL);
@@ -1163,7 +1168,8 @@ gtk_drag_begin_internal (GtkWidget         *widget,
 
   g_idle_add_full (G_PRIORITY_HIGH_IDLE, gtk_drag_begin_idle, context, NULL);
 
-  gdk_pointer_ungrab (0);
+  pointer = gdk_drag_context_get_device (info->context);
+  gdk_device_ungrab (pointer, 0);
 
   return context;
 }