From 3dab4659bfb9590992eac8f6f77d08c36b6cd8b8 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 15 Mar 2004 16:13:52 +0000 Subject: [PATCH] Move two functions used only with OLE2_DND inside its ifdef. 2004-03-15 Tor Lillqvist * gdk/win32/gdkdnd-win32.c: Move two functions used only with OLE2_DND inside its ifdef. Merge from HEAD: * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, local_send_drop): Set current_dest_drag to NULL when destroying the context, or when dropping. Fixes #120007. Thanks to Hans Breuer for fix. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gdk/win32/gdkdnd-win32.c | 17 ++++++++++++----- 6 files changed, 72 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0cbdd9866..8d381f9db3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-03-15 Tor Lillqvist + + * gdk/win32/gdkdnd-win32.c: Move two functions used only with + OLE2_DND inside its ifdef. + + Merge from HEAD: + + * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, + local_send_drop): Set current_dest_drag to NULL when destroying + the context, or when dropping. Fixes #120007. Thanks to Hans + Breuer for fix. + 2003-07-17 Tor Lillqvist Thanks to Gabriele Greco: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b0cbdd9866..8d381f9db3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2004-03-15 Tor Lillqvist + + * gdk/win32/gdkdnd-win32.c: Move two functions used only with + OLE2_DND inside its ifdef. + + Merge from HEAD: + + * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, + local_send_drop): Set current_dest_drag to NULL when destroying + the context, or when dropping. Fixes #120007. Thanks to Hans + Breuer for fix. + 2003-07-17 Tor Lillqvist Thanks to Gabriele Greco: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b0cbdd9866..8d381f9db3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +2004-03-15 Tor Lillqvist + + * gdk/win32/gdkdnd-win32.c: Move two functions used only with + OLE2_DND inside its ifdef. + + Merge from HEAD: + + * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, + local_send_drop): Set current_dest_drag to NULL when destroying + the context, or when dropping. Fixes #120007. Thanks to Hans + Breuer for fix. + 2003-07-17 Tor Lillqvist Thanks to Gabriele Greco: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b0cbdd9866..8d381f9db3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +2004-03-15 Tor Lillqvist + + * gdk/win32/gdkdnd-win32.c: Move two functions used only with + OLE2_DND inside its ifdef. + + Merge from HEAD: + + * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, + local_send_drop): Set current_dest_drag to NULL when destroying + the context, or when dropping. Fixes #120007. Thanks to Hans + Breuer for fix. + 2003-07-17 Tor Lillqvist Thanks to Gabriele Greco: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b0cbdd9866..8d381f9db3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2004-03-15 Tor Lillqvist + + * gdk/win32/gdkdnd-win32.c: Move two functions used only with + OLE2_DND inside its ifdef. + + Merge from HEAD: + + * gdk/win32/gdkdnd-win32.c (gdk_drag_context_unref, + local_send_drop): Set current_dest_drag to NULL when destroying + the context, or when dropping. Fixes #120007. Thanks to Hans + Breuer for fix. + 2003-07-17 Tor Lillqvist Thanks to Gabriele Greco: diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index 89c2786a1b..f2f0671971 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -156,6 +156,10 @@ gdk_drag_context_unref (GdkDragContext *context) gdk_window_unref (context->dest_window); contexts = g_list_remove (contexts, private); + + if (context == current_dest_drag) + current_dest_drag = NULL; + g_free (private); } } @@ -503,7 +507,6 @@ static IDataObjectVtbl ido_vtbl = { m_enum_d_advise }; -#endif /* OLE2_DND */ static target_drag_context * target_context_new (void) @@ -512,15 +515,15 @@ target_context_new (void) result = g_new0 (target_drag_context, 1); -#ifdef OLE2_DND result->idt.lpVtbl = &idt_vtbl; -#endif result->context = gdk_drag_context_new (); return result; } +#endif /* OLE2_DND */ + static source_drag_context * source_context_new (void) { @@ -869,6 +872,8 @@ local_send_drop (GdkDragContext *context, guint32 time) tmp_event.dnd.x_root = private->last_x; tmp_event.dnd.y_root = private->last_y; + + current_dest_drag = NULL; gdk_event_put (&tmp_event); } @@ -1205,12 +1210,13 @@ gdk_drop_finish (GdkDragContext *context, } } +#ifdef OLE2_DND + static GdkFilterReturn gdk_destroy_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) { -#ifdef OLE2_DND MSG *msg = (MSG *) xev; if (msg->message == WM_DESTROY) @@ -1221,10 +1227,11 @@ gdk_destroy_filter (GdkXEvent *xev, RevokeDragDrop (msg->hwnd); CoLockObjectExternal (idtp, FALSE, TRUE); } -#endif return GDK_FILTER_CONTINUE; } +#endif + void gdk_window_register_dnd (GdkWindow *window) {