mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
Bump eel version required.
* configure.in: Bump eel version required. * libnautilus-private/nautilus-icon-container.c: (rubberband_timeout_callback), (start_rubberbanding), (update_stretch_at_idle), (motion_notify_event): * libnautilus-private/nautilus-icon-dnd.c: (icon_get_data_binder), (nautilus_icon_container_position_shadow), (receive_dropped_keyword), (nautilus_icon_container_find_drop_target), (nautilus_icon_container_receive_dropped_icons), (nautilus_icon_container_get_drop_action), (nautilus_icon_dnd_update_drop_target), (nautilus_icon_dnd_init), (nautilus_icon_dnd_begin_drag): Use new eel functions that eliminate the funky interaction between the new GtkLayout and GnomeCanvas. Basically, all the functions that deal with window coordinates are getting bin_window coordinates instead. This should really be fixed in GnomeCanvas.
This commit is contained in:
parent
87b5490eb1
commit
68c54c317e
4 changed files with 61 additions and 46 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2002-01-30 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* configure.in: Bump eel version required.
|
||||
|
||||
* libnautilus-private/nautilus-icon-container.c:
|
||||
(rubberband_timeout_callback), (start_rubberbanding),
|
||||
(update_stretch_at_idle), (motion_notify_event):
|
||||
* libnautilus-private/nautilus-icon-dnd.c: (icon_get_data_binder),
|
||||
(nautilus_icon_container_position_shadow),
|
||||
(receive_dropped_keyword),
|
||||
(nautilus_icon_container_find_drop_target),
|
||||
(nautilus_icon_container_receive_dropped_icons),
|
||||
(nautilus_icon_container_get_drop_action),
|
||||
(nautilus_icon_dnd_update_drop_target), (nautilus_icon_dnd_init),
|
||||
(nautilus_icon_dnd_begin_drag):
|
||||
Use new eel functions that eliminate the funky interaction between
|
||||
the new GtkLayout and GnomeCanvas. Basically, all the functions
|
||||
that deal with window coordinates are getting bin_window
|
||||
coordinates instead. This should really be fixed in GnomeCanvas.
|
||||
|
||||
2002-01-30 Zbigniew Chyla <cyba@gnome.pl>
|
||||
|
||||
* libnautilus-private/nautilus-authn-manager.c
|
||||
|
|
|
@ -6,7 +6,7 @@ ART_REQUIRED=2.3.6
|
|||
BONOBO_ACTIVATION_REQUIRED=0.9.3
|
||||
BONOBO_REQUIRED=1.108
|
||||
BONOBO_UI_REQUIRED=1.108.1
|
||||
EEL_REQUIRED=1.1.2
|
||||
EEL_REQUIRED=1.1.3
|
||||
ESOUND_REQUIRED=0.2.23
|
||||
GLIB_REQUIRED=1.3.10
|
||||
GNOME_CANVAS_REQUIRED=1.105
|
||||
|
|
|
@ -1424,7 +1424,6 @@ rubberband_timeout_callback (gpointer data)
|
|||
GtkWidget *widget;
|
||||
NautilusIconRubberbandInfo *band_info;
|
||||
int x, y;
|
||||
int bin_x, bin_y;
|
||||
double x1, y1, x2, y2;
|
||||
double world_x, world_y;
|
||||
int x_scroll, y_scroll;
|
||||
|
@ -1439,7 +1438,6 @@ rubberband_timeout_callback (gpointer data)
|
|||
EEL_IS_CANVAS_RECT (band_info->selection_rectangle));
|
||||
|
||||
gdk_window_get_pointer (widget->window, &x, &y, NULL);
|
||||
gdk_window_get_pointer (GTK_LAYOUT (widget)->bin_window, &bin_x, &bin_y, NULL);
|
||||
|
||||
if (x < 0) {
|
||||
x_scroll = x;
|
||||
|
@ -1468,8 +1466,8 @@ rubberband_timeout_callback (gpointer data)
|
|||
|
||||
nautilus_icon_container_scroll (container, x_scroll, y_scroll);
|
||||
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
bin_x, bin_y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
if (world_x < band_info->start_x) {
|
||||
x1 = world_x;
|
||||
|
@ -1541,7 +1539,7 @@ start_rubberbanding (NautilusIconContainer *container,
|
|||
icon->was_selected_before_rubberband = icon->is_selected;
|
||||
}
|
||||
|
||||
gnome_canvas_window_to_world
|
||||
eel_gnome_canvas_canvas_window_to_world
|
||||
(GNOME_CANVAS (container),
|
||||
event->x, event->y,
|
||||
&band_info->start_x, &band_info->start_y);
|
||||
|
@ -2378,7 +2376,7 @@ realize (GtkWidget *widget)
|
|||
|
||||
gdk_window_set_background
|
||||
(GTK_LAYOUT (widget)->bin_window,
|
||||
&widget->style->bg[GTK_STATE_NORMAL]);
|
||||
&widget->style->bg[GTK_STATE_NORMAL]);
|
||||
|
||||
/* reduce flicker when scrolling by setting the back pixmap to NULL */
|
||||
gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window,
|
||||
|
@ -2617,9 +2615,9 @@ update_stretch_at_idle (NautilusIconContainer *container)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
details->window_x, details->window_y,
|
||||
&world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
details->window_x, details->window_y,
|
||||
&world_x, &world_y);
|
||||
gnome_canvas_w2c (GNOME_CANVAS (container),
|
||||
world_x, world_y,
|
||||
&stretch_state.pointer_x, &stretch_state.pointer_y);
|
||||
|
@ -2795,10 +2793,9 @@ motion_notify_event (GtkWidget *widget,
|
|||
break;
|
||||
}
|
||||
|
||||
gnome_canvas_window_to_world
|
||||
(GNOME_CANVAS (container),
|
||||
event->x, event->y,
|
||||
&world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
event->x, event->y,
|
||||
&world_x, &world_y);
|
||||
|
||||
if (abs (details->drag_x - world_x) >= SNAP_RESISTANCE
|
||||
|| abs (details->drag_y - world_y) >= SNAP_RESISTANCE) {
|
||||
|
|
|
@ -235,7 +235,7 @@ icon_get_data_binder (NautilusIcon *icon, gpointer data)
|
|||
container = NAUTILUS_ICON_CONTAINER (context->iterator_context);
|
||||
|
||||
world_rect = nautilus_icon_canvas_item_get_icon_rectangle (icon->item);
|
||||
window_rect = eel_gnome_canvas_world_to_window_rectangle
|
||||
window_rect = eel_gnome_canvas_world_to_canvas_window_rectangle
|
||||
(GNOME_CANVAS (container), world_rect);
|
||||
|
||||
uri = nautilus_icon_container_get_icon_uri (container, icon);
|
||||
|
@ -340,8 +340,8 @@ nautilus_icon_container_position_shadow (NautilusIconContainer *container,
|
|||
if (shadow == NULL) {
|
||||
return;
|
||||
}
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
set_shadow_position (shadow, world_x, world_y);
|
||||
gnome_canvas_item_show (shadow);
|
||||
|
@ -637,7 +637,7 @@ receive_dropped_keyword (NautilusIconContainer *container, char* keyword, int x,
|
|||
g_assert (keyword != NULL);
|
||||
|
||||
/* find the item we hit with our drop, if any */
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container), x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container), x, y, &world_x, &world_y);
|
||||
drop_target_icon = nautilus_icon_container_item_at (container, world_x, world_y);
|
||||
if (drop_target_icon == NULL) {
|
||||
return;
|
||||
|
@ -905,8 +905,8 @@ nautilus_icon_container_find_drop_target (NautilusIconContainer *container,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
/* FIXME bugzilla.gnome.org 42485:
|
||||
* These "can_accept_items" tests need to be done by
|
||||
|
@ -1001,8 +1001,8 @@ nautilus_icon_container_receive_dropped_icons (NautilusIconContainer *container,
|
|||
}
|
||||
|
||||
if (context->action > 0) {
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
drop_target = nautilus_icon_container_find_drop_target (container,
|
||||
context, x, y, &icon_hit);
|
||||
|
@ -1047,8 +1047,8 @@ nautilus_icon_container_get_drop_action (NautilusIconContainer *container,
|
|||
}
|
||||
|
||||
/* find out if we're over an icon */
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
icon = nautilus_icon_container_item_at (container, world_x, world_y);
|
||||
|
||||
|
@ -1145,8 +1145,8 @@ nautilus_icon_dnd_update_drop_target (NautilusIconContainer *container,
|
|||
return;
|
||||
}
|
||||
|
||||
gnome_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
eel_gnome_canvas_canvas_window_to_world (GNOME_CANVAS (container),
|
||||
x, y, &world_x, &world_y);
|
||||
|
||||
/* Find the item we hit with our drop, if any. */
|
||||
icon = nautilus_icon_container_item_at (container, world_x, world_y);
|
||||
|
@ -1225,27 +1225,26 @@ nautilus_icon_dnd_init (NautilusIconContainer *container,
|
|||
* (But not a source, as drags starting from this widget will be
|
||||
* implemented by dealing with events manually.)
|
||||
*/
|
||||
gtk_drag_dest_set (GTK_WIDGET (container),
|
||||
0,
|
||||
drop_types, G_N_ELEMENTS (drop_types),
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK
|
||||
| GDK_ACTION_ASK);
|
||||
gtk_drag_dest_set (GTK_WIDGET (container),
|
||||
0,
|
||||
drop_types, G_N_ELEMENTS (drop_types),
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
|
||||
|
||||
/* Messages for outgoing drag. */
|
||||
g_signal_connect (container, "drag_data_get",
|
||||
G_CALLBACK (drag_data_get_callback), NULL);
|
||||
G_CALLBACK (drag_data_get_callback), NULL);
|
||||
g_signal_connect (container, "drag_end",
|
||||
G_CALLBACK (drag_end_callback), NULL);
|
||||
|
||||
G_CALLBACK (drag_end_callback), NULL);
|
||||
|
||||
/* Messages for incoming drag. */
|
||||
g_signal_connect (container, "drag_data_received",
|
||||
G_CALLBACK (drag_data_received_callback), NULL);
|
||||
G_CALLBACK (drag_data_received_callback), NULL);
|
||||
g_signal_connect (container, "drag_motion",
|
||||
G_CALLBACK (drag_motion_callback), NULL);
|
||||
G_CALLBACK (drag_motion_callback), NULL);
|
||||
g_signal_connect (container, "drag_drop",
|
||||
G_CALLBACK (drag_drop_callback), NULL);
|
||||
G_CALLBACK (drag_drop_callback), NULL);
|
||||
g_signal_connect (container, "drag_leave",
|
||||
G_CALLBACK (drag_leave_callback), NULL);
|
||||
G_CALLBACK (drag_leave_callback), NULL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1286,9 +1285,10 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
|
|||
the way the canvas handles events.
|
||||
*/
|
||||
canvas = GNOME_CANVAS (container);
|
||||
gnome_canvas_world_to_window (canvas,
|
||||
event->x, event->y,
|
||||
&dnd_info->drag_info.start_x, &dnd_info->drag_info.start_y);
|
||||
eel_gnome_canvas_world_to_canvas_window (canvas,
|
||||
event->x, event->y,
|
||||
&dnd_info->drag_info.start_x,
|
||||
&dnd_info->drag_info.start_y);
|
||||
|
||||
/* start the drag */
|
||||
context = gtk_drag_begin (GTK_WIDGET (container),
|
||||
|
@ -1297,7 +1297,6 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
|
|||
button,
|
||||
(GdkEvent *) event);
|
||||
|
||||
|
||||
/* create a pixmap and mask to drag with */
|
||||
pixbuf = nautilus_icon_canvas_item_get_image (container->details->drag_icon->item);
|
||||
|
||||
|
@ -1306,10 +1305,9 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
|
|||
to it, with the hope that we get it back someday as X Windows improves */
|
||||
|
||||
/* compute the image's offset */
|
||||
world_rect = nautilus_icon_canvas_item_get_icon_rectangle (
|
||||
container->details->drag_icon->item);
|
||||
window_rect = eel_gnome_canvas_world_to_window_rectangle
|
||||
(canvas, world_rect);
|
||||
world_rect = nautilus_icon_canvas_item_get_icon_rectangle
|
||||
(container->details->drag_icon->item);
|
||||
window_rect = eel_gnome_canvas_world_to_canvas_window_rectangle (canvas, world_rect);
|
||||
x_offset = dnd_info->drag_info.start_x - window_rect.x0;
|
||||
y_offset = dnd_info->drag_info.start_y - window_rect.y0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue