summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-11-08 06:40:35 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:53 +0200
commit5ee6f114f83b68d02e7d5b723090f1dfe8c443ca (patch)
tree313d87138adedf6e209f650f825bd3a99c5771f0
parentb7f2233c06be6506e6913fcd02ae9c9e2183c9d3 (diff)
downloadcaja-5ee6f114f83b68d02e7d5b723090f1dfe8c443ca.tar.bz2
caja-5ee6f114f83b68d02e7d5b723090f1dfe8c443ca.tar.xz
[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
-rw-r--r--eel/eel-canvas.c54
-rw-r--r--libcaja-private/caja-icon-container.c52
-rw-r--r--libcaja-private/caja-icon-dnd.c42
-rw-r--r--libcaja-private/caja-tree-view-drag-dest.c4
-rw-r--r--src/file-manager/fm-desktop-icon-view.c10
5 files changed, 98 insertions, 64 deletions
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c
index 08793333..b3b4c482 100644
--- a/eel/eel-canvas.c
+++ b/eel/eel-canvas.c
@@ -76,6 +76,14 @@
#include "eel-marshal.h"
+#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_set_hadjustment gtk_layout_set_hadjustment
+#define gtk_scrollable_set_vadjustment gtk_layout_set_vadjustment
+#define GTK_SCROLLABLE GTK_LAYOUT
+#endif
+
static void eel_canvas_request_update (EelCanvas *canvas);
static void group_add (EelCanvasGroup *group,
EelCanvasItem *item);
@@ -1944,11 +1952,11 @@ eel_canvas_accessible_initialize (AtkObject *obj,
ATK_OBJECT_CLASS (accessible_parent_class)->initialize (obj, data);
canvas = EEL_CANVAS (data);
- g_signal_connect (gtk_layout_get_hadjustment (&canvas->layout),
+ g_signal_connect (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)),
"value_changed",
G_CALLBACK (eel_canvas_accessible_adjustment_changed),
obj);
- g_signal_connect (gtk_layout_get_vadjustment (&canvas->layout),
+ g_signal_connect (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)),
"value_changed",
G_CALLBACK (eel_canvas_accessible_adjustment_changed),
obj);
@@ -2218,7 +2226,7 @@ eel_canvas_init (EelCanvas *canvas)
canvas->scroll_x1 = 0.0;
canvas->scroll_y1 = 0.0;
- gtk_layout_get_size (&canvas->layout,
+ gtk_layout_get_size (GTK_LAYOUT (canvas),
&width, &height);
canvas->scroll_x2 = width;
canvas->scroll_y2 = height;
@@ -2229,8 +2237,8 @@ eel_canvas_init (EelCanvas *canvas)
canvas->pick_event.crossing.x = 0;
canvas->pick_event.crossing.y = 0;
- gtk_layout_set_hadjustment (GTK_LAYOUT (canvas), NULL);
- gtk_layout_set_vadjustment (GTK_LAYOUT (canvas), NULL);
+ gtk_scrollable_set_hadjustment (GTK_SCROLLABLE (canvas), NULL);
+ gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (canvas), NULL);
/* Create the root item as a special case */
@@ -2399,8 +2407,8 @@ eel_canvas_realize (GtkWidget *widget)
canvas = EEL_CANVAS (widget);
- gdk_window_set_events (gtk_layout_get_bin_window (&canvas->layout),
- (gdk_window_get_events (gtk_layout_get_bin_window (&canvas->layout))
+ gdk_window_set_events (gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+ (gdk_window_get_events (gtk_layout_get_bin_window (GTK_LAYOUT (canvas)))
| GDK_EXPOSURE_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK
@@ -2529,8 +2537,8 @@ scroll_to (EelCanvas *canvas, int cx, int cy)
gtk_widget_queue_draw (GTK_WIDGET (canvas));
}
- hadjustment = gtk_layout_get_hadjustment (&canvas->layout);
- vadjustment = gtk_layout_get_vadjustment (&canvas->layout);
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
if (((int) gtk_adjustment_get_value (hadjustment)) != cx)
{
@@ -2574,8 +2582,8 @@ eel_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
/* Recenter the view, if appropriate */
- hadjustment = gtk_layout_get_hadjustment (&canvas->layout);
- vadjustment = gtk_layout_get_vadjustment (&canvas->layout);
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
gtk_adjustment_set_page_size (hadjustment, allocation->width);
gtk_adjustment_set_page_increment (hadjustment, allocation->width / 2);
@@ -2908,7 +2916,7 @@ eel_canvas_button (GtkWidget *widget, GdkEventButton *event)
* dispatch normally regardless of the event's window if an item has
* has a pointer grab in effect
*/
- if (!canvas->grabbed_item && event->window != gtk_layout_get_bin_window (&canvas->layout))
+ if (!canvas->grabbed_item && event->window != gtk_layout_get_bin_window (GTK_LAYOUT (canvas)))
return retval;
switch (event->button)
@@ -2976,7 +2984,7 @@ eel_canvas_motion (GtkWidget *widget, GdkEventMotion *event)
canvas = EEL_CANVAS (widget);
- if (event->window != gtk_layout_get_bin_window (&canvas->layout))
+ if (event->window != gtk_layout_get_bin_window (GTK_LAYOUT (canvas)))
return FALSE;
canvas->state = event->state;
@@ -3015,7 +3023,7 @@ eel_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event)
canvas = EEL_CANVAS (widget);
- if (event->window != gtk_layout_get_bin_window (&canvas->layout))
+ if (event->window != gtk_layout_get_bin_window (GTK_LAYOUT (canvas)))
return FALSE;
canvas->state = event->state;
@@ -3333,8 +3341,8 @@ eel_canvas_set_scroll_region (EelCanvas *canvas, double x1, double y1, double x2
* Set the new scrolling region. If possible, do not move the visible contents of the
* canvas.
*/
- hadjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas));
- vadjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas));
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
eel_canvas_c2w (canvas,
gtk_adjustment_get_value (hadjustment) + canvas->zoom_xofs,
@@ -3400,8 +3408,8 @@ eel_canvas_set_center_scroll_region (EelCanvas *canvas,
canvas->center_scroll_region = center_scroll_region != 0;
- hadjustment = gtk_layout_get_hadjustment (&canvas->layout);
- vadjustment = gtk_layout_get_vadjustment (&canvas->layout);
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (&canvas->layout));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (&canvas->layout));
scroll_to (canvas,
gtk_adjustment_get_value (hadjustment),
@@ -3440,8 +3448,8 @@ eel_canvas_set_pixels_per_unit (EelCanvas *canvas, double n)
center_y = allocation.height / 2;
/* Find the coordinates of the screen center in units. */
- hadjustment = gtk_layout_get_hadjustment (&canvas->layout);
- vadjustment = gtk_layout_get_vadjustment (&canvas->layout);
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
cx = (gtk_adjustment_get_value (hadjustment) + center_x) / canvas->pixels_per_unit + canvas->scroll_x1 + canvas->zoom_xofs;
cy = (gtk_adjustment_get_value (vadjustment) + center_y) / canvas->pixels_per_unit + canvas->scroll_y1 + canvas->zoom_yofs;
@@ -3545,8 +3553,8 @@ eel_canvas_get_scroll_offsets (EelCanvas *canvas, int *cx, int *cy)
g_return_if_fail (EEL_IS_CANVAS (canvas));
- hadjustment = gtk_layout_get_hadjustment (&canvas->layout);
- vadjustment = gtk_layout_get_vadjustment (&canvas->layout);
+ hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
if (cx)
*cx = gtk_adjustment_get_value (hadjustment);
@@ -3646,7 +3654,7 @@ eel_canvas_request_redraw (EelCanvas *canvas, int x1, int y1, int x2, int y2)
bbox.width = x2 - x1;
bbox.height = y2 - y1;
- gdk_window_invalidate_rect (gtk_layout_get_bin_window (&canvas->layout),
+ gdk_window_invalidate_rect (gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
&bbox, FALSE);
}
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index 583b6c85..e88cac74 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -52,6 +52,12 @@
#include <stdio.h>
#include <string.h>
+#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
+
#define TAB_NAVIGATION_DISABLED
/* Interval for updating the rubberband selection, in milliseconds. */
@@ -591,8 +597,8 @@ caja_icon_container_scroll (CajaIconContainer *container,
GtkAdjustment *hadj, *vadj;
int old_h_value, old_v_value;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
/* Store the old ajustment values so we can tell if we
* ended up actually scrolling. We may not have in a case
@@ -754,8 +760,8 @@ reveal_icon (CajaIconContainer *container,
details = container->details;
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
if (caja_icon_container_is_auto_layout (container))
{
@@ -1087,8 +1093,8 @@ canvas_set_scroll_region_include_visible_area (EelCanvas *canvas,
width = (allocation.width) / canvas->pixels_per_unit;
height = (allocation.height) / canvas->pixels_per_unit;
- old_scroll_x = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_hadjustment (GTK_LAYOUT (canvas))));
- old_scroll_y = gtk_adjustment_get_value (GTK_ADJUSTMENT (gtk_layout_get_vadjustment (GTK_LAYOUT (canvas))));
+ old_scroll_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)));
+ old_scroll_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)));
x1 = MIN (x1, old_x1 + old_scroll_x);
y1 = MIN (y1, old_y1 + old_scroll_y);
@@ -1212,8 +1218,8 @@ caja_icon_container_update_scroll_region (CajaIconContainer *container)
x1, y1, x2, y2);
}
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
/* Scroll by 1/4 icon each time you click. */
step_increment = caja_get_icon_size_for_zoom_level
@@ -2775,14 +2781,14 @@ rubberband_timeout_callback (gpointer data)
adj_changed = FALSE;
gtk_widget_get_allocation (widget, &allocation);
- adj_x = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
+ adj_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
if (adj_x != band_info->last_adj_x)
{
band_info->last_adj_x = adj_x;
adj_changed = TRUE;
}
- adj_y = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ adj_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
if (adj_y != band_info->last_adj_y)
{
band_info->last_adj_y = adj_y;
@@ -2831,8 +2837,8 @@ rubberband_timeout_callback (gpointer data)
/* Remember to convert from widget to scrolled window coords */
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);
if (world_x < band_info->start_x)
@@ -2953,8 +2959,8 @@ start_rubberbanding (CajaIconContainer *container,
atk_object_set_name (accessible, "selection");
atk_object_set_description (accessible, _("The selection rectangle"));
- band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
+ band_info->prev_x = event->x - gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ band_info->prev_y = event->y - gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
band_info->active = TRUE;
@@ -4588,11 +4594,11 @@ realize (GtkWidget *widget)
setup_label_gcs (container);
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (widget));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
g_signal_connect (hadj, "value_changed",
G_CALLBACK (handle_hadjustment_changed), widget);
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
g_signal_connect (vadj, "value_changed",
G_CALLBACK (handle_vadjustment_changed), widget);
@@ -7192,9 +7198,9 @@ caja_icon_container_get_first_visible_icon (CajaIconContainer *container)
gboolean better_icon;
gboolean compare_lt;
- hadj_v = gtk_adjustment_get_value (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
- vadj_v = gtk_adjustment_get_value (gtk_layout_get_vadjustment (GTK_LAYOUT (container)));
- h_page_size = gtk_adjustment_get_page_size (gtk_layout_get_hadjustment (GTK_LAYOUT (container)));
+ hadj_v = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
+ vadj_v = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
+ h_page_size = gtk_adjustment_get_page_size (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container)));
if (caja_icon_container_is_layout_rtl (container))
{
@@ -7283,8 +7289,8 @@ caja_icon_container_scroll_to_icon (CajaIconContainer *container,
EelIRect bounds;
GtkAllocation allocation;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
/* We need to force a relayout now if there are updates queued
@@ -7616,8 +7622,8 @@ caja_icon_container_update_visible_icons (CajaIconContainer *container)
gboolean visible;
GtkAllocation allocation;
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
min_x = gtk_adjustment_get_value (hadj);
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 <stdio.h>
#include <string.h>
+#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)
diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c
index d7a8d2b6..56e9a1cd 100644
--- a/libcaja-private/caja-tree-view-drag-dest.c
+++ b/libcaja-private/caja-tree-view-drag-dest.c
@@ -110,9 +110,9 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
window = gtk_tree_view_get_bin_window (tree_view);
#if GTK_CHECK_VERSION(3, 0, 0)
- vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(tree_view));
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
#else
- vadjustment = gtk_tree_view_get_vadjustment(tree_view);
+ vadjustment = gtk_tree_view_get_vadjustment (tree_view);
#endif
gdk_window_get_pointer (window, NULL, &y, NULL);
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 232b198a..3885ca13 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -59,6 +59,12 @@
#include <sys/types.h>
#include <unistd.h>
+#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
+
/* Timeout to check the desktop directory for updates */
#define RESCAN_TIMEOUT 4
@@ -566,8 +572,8 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
gtk_widget_queue_resize (GTK_WIDGET (icon_container));
- hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (icon_container));
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (icon_container));
+ hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (icon_container));
+ vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (icon_container));
eel_gtk_adjustment_set_value (hadj, 0);
eel_gtk_adjustment_set_value (vadj, 0);