X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdccdfabb29bd51aded9aac141e1f7bbd6c85443..5f77e766a3d9d90d2295612532a28fce7dbd2542:/src/gtk/dnd.cpp diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index ffd858bc76..6ef44f891a 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -20,10 +20,9 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/window.h" + #include "wx/gdicmn.h" #endif -#include "wx/gdicmn.h" - #include "wx/gtk/private.h" #include @@ -656,7 +655,7 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), extern "C" { static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), - GdkDragContext *context, + GdkDragContext *WXUNUSED(context), wxDropSource *WXUNUSED(drop_source) ) { if (g_isIdle) @@ -707,8 +706,7 @@ extern "C" { static gint gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDropSource *source ) { - if (g_isIdle) - wxapp_install_idle_handler(); + // don't need to install idle handler, its done from "event" signal source->GiveFeedback( ConvertFromGTK(source->m_dragContext->action) ); @@ -912,6 +910,14 @@ wxDragResult wxDropSource::DoDragDrop(int flags) UnregisterWindow(); + // this shouldn't be needed but somehow, sometimes, without this the cursor + // stays grabbed even when the DND operation ends and the application + // becomes unresponsive and has to be killed resulting in loss of all + // unsaved data, so while this fix is ugly it's still better than + // alternative + if ( gdk_pointer_is_grabbed() ) + gdk_pointer_ungrab(GDK_CURRENT_TIME); + return m_retValue; }