X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2dea2ab4d0dc237a236414946433856fa854dc0..4e5a4c69c540b430fba8efe5dae1bc1ffd5caeca:/src/gtk/dnd.cpp diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index fdfeb4fade..7c1834bf87 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -21,8 +21,8 @@ #include "wx/intl.h" #include "wx/utils.h" -#include -#include +#include "wx/gtk/private.h" + #include #include @@ -40,8 +40,6 @@ extern bool g_isIdle; //----------------------------------------------------------------------------- #if wxUSE_THREADS -extern void wxapp_install_thread_wakeup(); -extern void wxapp_uninstall_thread_wakeup(); #endif //---------------------------------------------------------------------------- @@ -60,7 +58,7 @@ static const wxChar *TRACE_DND = _T("dnd"); //---------------------------------------------------------------------------- /* XPM */ -static char * page_xpm[] = { +static const char * page_xpm[] = { /* width height ncolors chars_per_pixel */ "32 32 5 1", /* colors */ @@ -155,6 +153,8 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), wxDragResult result; if ( context->suggested_action == GDK_ACTION_COPY ) result = wxDragCopy; + else if ( context->suggested_action == GDK_ACTION_LINK ) + result = wxDragLink; else result = wxDragMove; @@ -175,6 +175,8 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), GdkDragAction action; if (result == wxDragCopy) action = GDK_ACTION_COPY; + else if (result == wxDragLink) + action = GDK_ACTION_LINK; else action = GDK_ACTION_MOVE; @@ -254,7 +256,6 @@ static gboolean target_drag_drop( GtkWidget *widget, #if wxUSE_THREADS /* disable GUI threads */ - wxapp_uninstall_thread_wakeup(); #endif GdkAtom format = drop_target->GetMatchingPair(); @@ -273,7 +274,6 @@ static gboolean target_drag_drop( GtkWidget *widget, #if wxUSE_THREADS /* re-enable GUI threads */ - wxapp_install_thread_wakeup(); #endif } @@ -325,6 +325,8 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), wxDragResult result; if ( context->suggested_action == GDK_ACTION_COPY ) result = wxDragCopy; + else if ( context->suggested_action == GDK_ACTION_LINK ) + result = wxDragLink; else result = wxDragMove; @@ -549,7 +551,6 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), #if wxUSE_THREADS /* disable GUI threads */ - wxapp_uninstall_thread_wakeup(); #endif gtk_selection_data_set( selection_data, @@ -560,7 +561,6 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), #if wxUSE_THREADS /* enable GUI threads */ - wxapp_install_thread_wakeup(); #endif delete[] d; @@ -570,9 +570,9 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), // "drag_data_delete" //---------------------------------------------------------------------------- -static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), - GdkDragContext *WXUNUSED(context), - wxDropSource *WXUNUSED(drop_source) ) +static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), + GdkDragContext *context, + wxDropSource *WXUNUSED(drop_source) ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -621,6 +621,7 @@ gtk_dnd_window_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigur wxDragResult action = wxDragNone; if (source->m_dragContext->action == GDK_ACTION_COPY) action = wxDragCopy; + if (source->m_dragContext->action == GDK_ACTION_LINK) action = wxDragLink; if (source->m_dragContext->action == GDK_ACTION_MOVE) action = wxDragMove; source->GiveFeedback( action ); @@ -794,17 +795,17 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) #if wxUSE_THREADS /* disable GUI threads */ - wxapp_uninstall_thread_wakeup(); #endif /* don't start dragging if no button is down */ if (button_number) { - GdkDragAction action = GDK_ACTION_COPY; - if (allowMove) action = (GdkDragAction)(GDK_ACTION_MOVE|GDK_ACTION_COPY); + int action = GDK_ACTION_COPY; + if ( allowMove ) + action |= GDK_ACTION_MOVE; GdkDragContext *context = gtk_drag_begin( m_widget, target_list, - action, + (GdkDragAction)action, button_number, /* number of mouse button which started drag */ (GdkEvent*) &event ); @@ -816,13 +817,14 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) if (context->action == GDK_ACTION_COPY) m_retValue = wxDragCopy; + if (context->action == GDK_ACTION_LINK) + m_retValue = wxDragLink; if (context->action == GDK_ACTION_MOVE) m_retValue = wxDragMove; } #if wxUSE_THREADS /* re-enable GUI threads */ - wxapp_install_thread_wakeup(); #endif g_blockEventsOnDrag = FALSE;