From 3bba8439685024f9fbfd9d1880da95f4cd9ce09f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 15 Jan 1999 15:58:17 +0000 Subject: [PATCH] Make MOD1-drag also do action ask. Thu Jan 14 11:29:53 1999 Owen Taylor * gtk/gtkdnd.c (gtk_drag_get_event_action): Make MOD1-drag also do action ask. * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the button-release event we simulate to get grabs released, with a window of GDK_ROOT_PARENT instead of the actual widget. This is a bad hack in some sense, but seems to work nicely. (It's sort of like what you would if you grabbed on button press, then the user released outside of the widget.) --- gtk/gtkdnd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index cd29c53d53..62af27d5d1 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -435,6 +435,9 @@ gtk_drag_get_event_action (GdkEvent *event, gint button, GdkDragAction actions) } else { + if (state & (GDK_MOD1_MASK)) + return GDK_ACTION_ASK; + if (actions & GDK_ACTION_COPY) return GDK_ACTION_COPY; else if (actions & GDK_ACTION_MOVE) @@ -2475,7 +2478,7 @@ gtk_drag_button_release_cb (GtkWidget *widget, */ send_event.button.type = GDK_BUTTON_RELEASE; - send_event.button.window = source_widget->window; + send_event.button.window = GDK_ROOT_PARENT (); send_event.button.send_event = TRUE; send_event.button.time = event->time; send_event.button.x = 0;