diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-03-20 18:09:45 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-03-21 11:56:17 -0400 |
commit | a5a51e325d1fef163d9da4611432d0cefd112395 (patch) | |
tree | 9707f6382ae8fec40e9b15702cb076f6fcc86571 | |
parent | ca63330b19c920a02d02f1bc96463ba156312483 (diff) | |
download | gtk+-a5a51e325d1fef163d9da4611432d0cefd112395.tar.gz |
quartz: Fix up dnd code
Copy changes to drag highlight drawing from gtkdnd.c to gtkdnd-quartz.c.
https://bugzilla.gnome.org/show_bug.cgi?id=763808
-rw-r--r-- | gtk/gtkdnd-quartz.c | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index df2dbff4e4..7fe27b6008 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -337,42 +337,6 @@ gtk_drag_get_source_widget (GdkDragContext *context) return info->source_widget; } -/************************************************************* - * gtk_drag_highlight_draw: - * Callback for expose_event for highlighted widgets. - * arguments: - * widget: - * event: - * data: - * results: - *************************************************************/ - -static gboolean -gtk_drag_highlight_draw (GtkWidget *widget, - cairo_t *cr, - gpointer data) -{ - 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_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); - cairo_rectangle (cr, - 0.5, 0.5, - width - 1, height - 1); - cairo_stroke (cr); - - return FALSE; -} - /** * gtk_drag_highlight: (method) * @widget: a widget to highlight @@ -382,11 +346,7 @@ gtk_drag_highlight (GtkWidget *widget) { g_return_if_fail (GTK_IS_WIDGET (widget)); - g_signal_connect_after (widget, "draw", - G_CALLBACK (gtk_drag_highlight_draw), - NULL); - - gtk_widget_queue_draw (widget); + gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE, FALSE); } /** @@ -398,11 +358,7 @@ gtk_drag_unhighlight (GtkWidget *widget) { g_return_if_fail (GTK_IS_WIDGET (widget)); - g_signal_handlers_disconnect_by_func (widget, - gtk_drag_highlight_draw, - NULL); - - gtk_widget_queue_draw (widget); + gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE); } static NSWindow * |