From 74aa23072887ddb7544819e80c45a4f39c169893 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 23 Feb 2003 14:51:09 +0000 Subject: [PATCH] r2452: Bugfix: Drag-and-drop raising on the panel didn't quite work (Daniele Peri). --- ROX-Filer/Help/Changes | 1 + ROX-Filer/src/panel.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index d44ba0bd..89f241fa 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -12,6 +12,7 @@ Bugfix: Test for valid sort-type in SOAP call was reserved, so you couldn't set the sort type (reported by Damjan Bole). Bugfix: Using a SOAP call to open a non-existant directory made the filer crash. +Bugfix: Drag-and-drop raising on the panel didn't quite work (Daniele Peri). 22-Feb-2003 ~~~~~~~~~~~ diff --git a/ROX-Filer/src/panel.c b/ROX-Filer/src/panel.c index 4e5cba53..952ad83c 100644 --- a/ROX-Filer/src/panel.c +++ b/ROX-Filer/src/panel.c @@ -133,6 +133,12 @@ static gboolean panel_drag_motion(GtkWidget *widget, gint y, guint time, Panel *panel); +static gboolean insert_drag_motion(GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + Panel *panel); static gboolean drag_motion(GtkWidget *widget, GdkDragContext *context, gint x, @@ -180,6 +186,7 @@ static GType panel_icon_get_type(void); static gboolean panel_want_show_text(PanelIcon *pi); static void panel_show_menu(GdkEventButton *event, PanelIcon *pi, Panel *panel); static void panel_style_changed(void); +static void motion_may_raise(Panel *panel, int x, int y); static GtkWidget *dnd_highlight = NULL; /* (stops flickering) */ @@ -946,8 +953,11 @@ static gboolean drag_motion(GtkWidget *widget, const char *type = NULL; Icon *icon = (Icon *) pi; DirItem *item = icon->item; + int panel_x, panel_y; - panel_drag_motion(widget, context, x, y, time, pi->panel); + gdk_window_get_pointer(pi->panel->window->window, + &panel_x, &panel_y, NULL); + motion_may_raise(pi->panel, panel_x, panel_y); if (icon->selected) goto out; /* Can't drag a selection to itself */ @@ -1147,7 +1157,7 @@ static GtkWidget *make_insert_frame(Panel *panel) gtk_widget_set_size_request(frame, 16, 16); g_signal_connect(frame, "drag-motion", - G_CALLBACK(panel_drag_motion), panel); + G_CALLBACK(insert_drag_motion), panel); g_signal_connect(frame, "drag-leave", G_CALLBACK(panel_drag_leave), panel); @@ -1835,9 +1845,25 @@ static gboolean panel_drag_motion(GtkWidget *widget, motion_may_raise(panel, panel_x, panel_y); gdk_drag_status(context, 0, time); + return TRUE; } +static gboolean insert_drag_motion(GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time, + Panel *panel) +{ + int panel_x, panel_y; + + gdk_window_get_pointer(panel->window->window, &panel_x, &panel_y, NULL); + motion_may_raise(panel, panel_x, panel_y); + + return FALSE; +} + /* Note: also called from icon handler */ static void panel_drag_leave(GtkWidget *widget, GdkDragContext *context, -- 2.11.4.GIT