From c28f508865f21658ad4319a561f999c87cf94703 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:00:30 +0200 Subject: [lc-p] port caja-icon-dnd to cairo drawing http://git.gnome.org/browse/nautilus/commit/?id=34a376c97717cb05187b3d880e991c2d23511109 --- libcaja-private/caja-icon-dnd.c | 46 +++++++---------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 12cc5cbf..204f9e80 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -98,7 +98,6 @@ create_selection_shadow (CajaIconContainer *container, { EelCanvasGroup *group; EelCanvas *canvas; - GdkBitmap *stipple; int max_x, max_y; int min_x, min_y; GList *p; @@ -115,9 +114,6 @@ create_selection_shadow (CajaIconContainer *container, return NULL; } - stipple = container->details->dnd_info->stipple; - g_return_val_if_fail (stipple != NULL, NULL); - canvas = EEL_CANVAS (container); gtk_widget_get_allocation (GTK_WIDGET (container), &allocation); @@ -164,7 +160,6 @@ create_selection_shadow (CajaIconContainer *container, "x2", (double) x2, "y2", (double) y2, "outline_color", "black", - "outline_stipple", stipple, "width_pixels", 1, NULL); } @@ -1664,6 +1659,7 @@ drag_highlight_expose (GtkWidget *widget, { gint x, y, width, height; GdkWindow *window; + cairo_t *cr; x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); @@ -1682,10 +1678,12 @@ drag_highlight_expose (GtkWidget *widget, NULL, widget, "dnd", x, y, width, height); - gdk_draw_rectangle (window, - (gtk_widget_get_style(widget))->black_gc, - FALSE, - x, y, width - 1, height - 1); + cr = gdk_cairo_create (window); + cairo_set_line_width (cr, 1.0); + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1); + cairo_stroke (cr); + cairo_destroy (cr); return FALSE; } @@ -2029,25 +2027,7 @@ drag_data_received_callback (GtkWidget *widget, } void -caja_icon_dnd_set_stipple (CajaIconContainer *container, - GdkBitmap *stipple) -{ - if (stipple != NULL) - { - g_object_ref (stipple); - } - - if (container->details->dnd_info->stipple != NULL) - { - g_object_unref (container->details->dnd_info->stipple); - } - - container->details->dnd_info->stipple = stipple; -} - -void -caja_icon_dnd_init (CajaIconContainer *container, - GdkBitmap *stipple) +caja_icon_dnd_init (CajaIconContainer *container) { GtkTargetList *targets; int n_elements; @@ -2096,11 +2076,6 @@ caja_icon_dnd_init (CajaIconContainer *container, G_CALLBACK (drag_drop_callback), NULL); g_signal_connect (container, "drag_leave", G_CALLBACK (drag_leave_callback), NULL); - - if (stipple != NULL) - { - container->details->dnd_info->stipple = g_object_ref (stipple); - } } void @@ -2112,11 +2087,6 @@ caja_icon_dnd_fini (CajaIconContainer *container) { stop_auto_scroll (container); - if (container->details->dnd_info->stipple != NULL) - { - g_object_unref (container->details->dnd_info->stipple); - } - caja_drag_finalize (&container->details->dnd_info->drag_info); container->details->dnd_info = NULL; } -- cgit v1.2.1 From dc5d53f773d3a7fa9a0c5ce4e99185cc97789960 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 15:25:58 +0200 Subject: [lc-p] use the 'outline-stippling' property on DnD http://git.gnome.org/browse/nautilus/commit/?id=aa43821e73d60804a3f0f2ebafb66aab53b440e1 --- libcaja-private/caja-icon-dnd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 204f9e80..2e7dc32a 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -160,6 +160,7 @@ create_selection_shadow (CajaIconContainer *container, "x2", (double) x2, "y2", (double) y2, "outline_color", "black", + "outline-stippling", TRUE, "width_pixels", 1, NULL); } -- cgit v1.2.1 From ae33b1c624c008ca0818ab08735968c8d01fae1c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 3 Nov 2012 19:03:17 +0200 Subject: [lc-p] use eel_canvas_item_destroy instead of gtk_object_destroy() http://git.gnome.org/browse/nautilus/commit/?id=f5192b6990cd9240d126974dd587b7b7525ae714 --- libcaja-private/caja-icon-dnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 2e7dc32a..449ceab8 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -375,7 +375,7 @@ caja_icon_container_dropped_icon_feedback (GtkWidget *widget, { /* FIXME bugzilla.gnome.org 42484: * Is a destroy really sufficient here? Who does the unref? */ - gtk_object_destroy (GTK_OBJECT (dnd_info->shadow)); + eel_canvas_item_destroy (dnd_info->shadow); } /* Build the selection list and the shadow. */ @@ -1514,7 +1514,7 @@ caja_icon_container_free_drag_data (CajaIconContainer *container) if (dnd_info->shadow != NULL) { - gtk_object_destroy (GTK_OBJECT (dnd_info->shadow)); + eel_canvas_item_destroy (dnd_info->shadow); dnd_info->shadow = NULL; } -- cgit v1.2.1 From 2e0b6b0a2e689d5af0ca719ee0ef29f90c4f2e0c Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 16:33:39 +0200 Subject: [icon-dnd] remove commented out obsolete code http://git.gnome.org/browse/nautilus/commit/?id=c5eba3314c99059aa1fff13aedcb1004966fdd55 --- libcaja-private/caja-icon-dnd.c | 63 +---------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 449ceab8..470a767e 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -940,63 +940,6 @@ stop_auto_scroll (CajaIconContainer *container) caja_drag_autoscroll_stop (&container->details->dnd_info->drag_info); } -static gboolean -confirm_switch_to_manual_layout (CajaIconContainer *container) -{ -#if 0 - const char *message; - const char *detail; - GtkDialog *dialog; - int response; - - /* FIXME bugzilla.gnome.org 40915: Use of the word "directory" - * makes this FMIconView specific. Move these messages into - * FMIconView so CajaIconContainer can be used for things - * that are not directories? - */ - if (caja_icon_container_has_stored_icon_positions (container)) - { - if (eel_g_list_exactly_one_item (container->details->dnd_info->drag_info.selection_list)) - { - message = no_translate("Do you want to switch to manual layout and leave this item where you dropped it? " - "This will clobber the stored manual layout."); - detail = no_translate("This folder uses automatic layout."); - } - else - { - message = no_translate("Do you want to switch to manual layout and leave these items where you dropped them? " - "This will clobber the stored manual layout."); - detail = no_translate("This folder uses automatic layout."); - } - } - else - { - if (eel_g_list_exactly_one_item (container->details->dnd_info->drag_info.selection_list)) - { - message = no_translate("Do you want to switch to manual layout and leave this item where you dropped it?"); - detail = no_translate("This folder uses automatic layout."); - } - else - { - message = no_translate("Do you want to switch to manual layout and leave these items where you dropped them?"); - detail = no_translate("This folder uses automatic layout."); - - } - } - - dialog = eel_show_yes_no_dialog (message, detail, _("Switch to Manual Layout?"), - GTK_STOCK_CANCEL, - GTK_WINDOW (gtk_widget_get_toplevel(GTK_WIDGET(container)))); - - response = gtk_dialog_run (dialog); - gtk_object_destroy (GTK_OBJECT (dialog)); - - return response == GTK_RESPONSE_YES; -#else - return FALSE; -#endif -} - static void handle_local_move (CajaIconContainer *container, double world_x, double world_y) @@ -1011,11 +954,7 @@ handle_local_move (CajaIconContainer *container, if (container->details->auto_layout) { - if (!confirm_switch_to_manual_layout (container)) - { - return; - } - caja_icon_container_freeze_icon_positions (container); + return; } time (&now); -- cgit v1.2.1 From 2a4433a562b4a9fde5f81961c67fbee8810d63f0 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 00:05:37 +0200 Subject: [libcaja-private] Port to rendering-cleanup-next http://git.gnome.org/browse/nautilus/commit/?id=910191ea13e5647e1b8c793e7585530c6ae4c9b1 --- libcaja-private/caja-icon-dnd.c | 56 ++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 9 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 470a767e..67e0dd32 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1495,18 +1495,23 @@ drag_begin_callback (GtkWidget *widget, GdkDragContext *context, gpointer data) { +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_t *surface; +#else CajaIconContainer *container; GdkScreen *screen; GdkColormap *colormap; GdkPixmap *pixmap; GdkBitmap *mask; + gboolean use_mask; +#endif double x1, y1, x2, y2, winx, winy; int x_offset, y_offset; int start_x, start_y; - gboolean use_mask; container = CAJA_ICON_CONTAINER (widget); +#if !GTK_CHECK_VERSION(3,0,0) screen = gtk_widget_get_screen (widget); colormap = NULL; if (gdk_screen_is_composited (screen)) @@ -1524,12 +1529,17 @@ drag_begin_callback (GtkWidget *widget, colormap = gtk_widget_get_colormap (widget); use_mask = TRUE; } +#endif start_x = container->details->dnd_info->drag_info.start_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); start_y = container->details->dnd_info->drag_info.start_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); /* create a pixmap and mask to drag with */ +#if GTK_CHECK_VERSION(3,0,0) + surface = caja_icon_canvas_item_get_drag_surface (container->details->drag_icon->item); +#else pixmap = caja_icon_canvas_item_get_image (container->details->drag_icon->item, &mask, colormap); +#endif /* we want to drag semi-transparent pixbufs, but X is too slow dealing with stippled masks, so we had to remove the code; this comment is left as a memorial @@ -1543,6 +1553,11 @@ drag_begin_callback (GtkWidget *widget, x_offset = start_x - winx; y_offset = start_y - winy; +#if GTK_CHECK_VERSION(3,0,0) + cairo_surface_set_device_offset (surface, x_offset, y_offset); + gtk_drag_set_icon_surface (context, surface); + cairo_surface_destroy (surface); +#else if (!use_mask && pixmap != NULL) { cairo_t *cr; @@ -1559,6 +1574,7 @@ drag_begin_callback (GtkWidget *widget, colormap, pixmap, (use_mask ? mask : NULL), x_offset, y_offset); +#endif } void @@ -1593,37 +1609,50 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container, } static gboolean +#if GTK_CHECK_VERSION(3,0,0) +drag_highlight_draw (GtkWidget *widget, + cairo_t *cr, + gpointer user_data) +#else drag_highlight_expose (GtkWidget *widget, GdkEventExpose *event, gpointer data) +#endif { gint x, y, width, height; GdkWindow *window; - cairo_t *cr; x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); + window = gtk_widget_get_window (widget); #if GTK_CHECK_VERSION(3, 0, 0) - width = gdk_window_get_width(GDK_WINDOW(gtk_widget_get_window(widget))); - height = gdk_window_get_height(GDK_WINDOW(gtk_widget_get_window(widget))); -#else - gdk_drawable_get_size(gtk_widget_get_window(widget), &width, &height); -#endif + width = gdk_window_get_width (window); + height = gdk_window_get_height (window); - window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); + gtk_paint_shadow (gtk_widget_get_style (widget), + cr, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, + widget, "dnd", + x, y, width, height); +#else + gdk_drawable_get_size(window, &width, &height); gtk_paint_shadow (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "dnd", x, y, width, height); - cr = gdk_cairo_create (window); + cairo_t *cr = gdk_cairo_create (window); +#endif + cairo_set_line_width (cr, 1.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1); cairo_stroke (cr); +#if !GTK_CHECK_VERSION(3,0,0) cairo_destroy (cr); +#endif return FALSE; } @@ -1682,8 +1711,13 @@ start_dnd_highlight (GtkWidget *widget) if (!dnd_info->highlighted) { dnd_info->highlighted = TRUE; +#if GTK_CHECK_VERSION(3,0,0) + g_signal_connect_after (widget, "draw", + G_CALLBACK (drag_highlight_draw), +#else g_signal_connect_after (widget, "expose_event", G_CALLBACK (drag_highlight_expose), +#endif NULL); dnd_highlight_queue_redraw (widget); } @@ -1699,7 +1733,11 @@ stop_dnd_highlight (GtkWidget *widget) if (dnd_info->highlighted) { g_signal_handlers_disconnect_by_func (widget, +#if GTK_CHECK_VERSION(3,0,0) + drag_highlight_draw, +#else drag_highlight_expose, +#endif NULL); dnd_highlight_queue_redraw (widget); dnd_info->highlighted = FALSE; -- cgit v1.2.1 From 07bbb722c57b1f985a8750db9776099f1fadf7f6 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:53:55 +0200 Subject: [icon-dnd] use negative device offsets to set the drag surface http://git.gnome.org/browse/nautilus/commit/?id=f38bad2536faf497fe56c9a491ab852cb00514c0 --- libcaja-private/caja-icon-dnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 67e0dd32..308715fa 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1554,7 +1554,7 @@ drag_begin_callback (GtkWidget *widget, y_offset = start_y - winy; #if GTK_CHECK_VERSION(3,0,0) - cairo_surface_set_device_offset (surface, x_offset, y_offset); + cairo_surface_set_device_offset (surface, -x_offset, -y_offset); gtk_drag_set_icon_surface (context, surface); cairo_surface_destroy (surface); #else -- cgit v1.2.1 From b1cb355a3a65d11101d55846803cbf0296e22da5 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 02:57:24 +0200 Subject: [icon-dnd] cleanup useless comment removing old comment, keeping old pixmap/mask code around for GTK2 was: icon-dnd: cleanup useless code http://git.gnome.org/browse/nautilus/commit/?id=098057414b38aeeddd3fcd81942324336628d341 --- libcaja-private/caja-icon-dnd.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 308715fa..5aa48669 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1541,10 +1541,6 @@ drag_begin_callback (GtkWidget *widget, pixmap = caja_icon_canvas_item_get_image (container->details->drag_icon->item, &mask, colormap); #endif - /* we want to drag semi-transparent pixbufs, but X is too slow dealing with - stippled masks, so we had to remove the code; this comment is left as a memorial - to it, with the hope that we get it back someday as X Windows improves */ - /* compute the image's offset */ eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (container->details->drag_icon->item), &x1, &y1, &x2, &y2); -- cgit v1.2.1 From 5ee6f114f83b68d02e7d5b723090f1dfe8c443ca Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 8 Nov 2012 06:40:35 +0200 Subject: [general] use new GtkScrollable interface http://git.gnome.org/browse/nautilus/commit/?id=d811553a4e74106efdf8bf6c91c6d29944ed6df7 canvas: use GTK_LAYOUT casts instead of going through the parent struct http://git.gnome.org/browse/nautilus/commit/?id=2260005986d8c620669e56c4b9f2fba12e8e0625 --- libcaja-private/caja-icon-dnd.c | 42 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'libcaja-private/caja-icon-dnd.c') diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index 5aa48669..cae6e4ee 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -60,6 +60,12 @@ #include #include +#if !GTK_CHECK_VERSION(3, 0, 0) +#define gtk_scrollable_get_hadjustment gtk_layout_get_hadjustment +#define gtk_scrollable_get_vadjustment gtk_layout_get_vadjustment +#define GTK_SCROLLABLE GTK_LAYOUT +#endif + static const GtkTargetEntry drag_types [] = { { CAJA_ICON_DND_MATE_ICON_LIST_TYPE, 0, CAJA_ICON_DND_MATE_ICON_LIST }, @@ -197,6 +203,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas, EelIRect *widget_rect) { EelDRect window_rect; + GtkAdjustment *hadj, *vadj; + + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)); eel_canvas_world_to_window (canvas, world_rect->x0, world_rect->y0, @@ -204,10 +214,10 @@ canvas_rect_world_to_widget (EelCanvas *canvas, eel_canvas_world_to_window (canvas, world_rect->x1, world_rect->y1, &window_rect.x1, &window_rect.y1); - widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))); - widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))); - widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))); - widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))); + widget_rect->x0 = (int) window_rect.x0 - gtk_adjustment_get_value (hadj); + widget_rect->y0 = (int) window_rect.y0 - gtk_adjustment_get_value (vadj); + widget_rect->x1 = (int) window_rect.x1 - gtk_adjustment_get_value (hadj); + widget_rect->y1 = (int) window_rect.y1 - gtk_adjustment_get_value (vadj); } static void @@ -216,8 +226,8 @@ canvas_widget_to_world (EelCanvas *canvas, double *world_x, double *world_y) { eel_canvas_window_to_world (canvas, - widget_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))), - widget_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))), + widget_x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas))), + widget_y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas))), world_x, world_y); } @@ -1267,8 +1277,8 @@ caja_icon_container_receive_dropped_icons (CajaIconContainer *container, if (real_action > 0) { eel_canvas_window_to_world (EEL_CANVAS (container), - x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))), - y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))), + x + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))), + y + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))), &world_x, &world_y); drop_target = caja_icon_container_find_drop_target (container, @@ -1531,8 +1541,10 @@ drag_begin_callback (GtkWidget *widget, } #endif - start_x = container->details->dnd_info->drag_info.start_x + gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - start_y = container->details->dnd_info->drag_info.start_y + gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + start_x = container->details->dnd_info->drag_info.start_x + + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + start_y = container->details->dnd_info->drag_info.start_y + + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); /* create a pixmap and mask to drag with */ #if GTK_CHECK_VERSION(3,0,0) @@ -1593,8 +1605,10 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container, /* Notice that the event is in bin_window coordinates, because of the way the canvas handles events. */ - dnd_info->drag_info.start_x = start_x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container))); - dnd_info->drag_info.start_y = start_y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container))); + dnd_info->drag_info.start_x = start_x - + gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container))); + dnd_info->drag_info.start_y = start_y - + gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container))); /* start the drag */ context = gtk_drag_begin (GTK_WIDGET (container), @@ -1618,8 +1632,8 @@ drag_highlight_expose (GtkWidget *widget, gint x, y, width, height; GdkWindow *window; - x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (widget))); - y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (widget))); + x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget))); + y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget))); window = gtk_widget_get_window (widget); #if GTK_CHECK_VERSION(3, 0, 0) -- cgit v1.2.1