diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-21 20:50:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-24 21:38:33 +0200 |
commit | 8c276412c9cd8e12d88f4349f5fba19651161886 (patch) | |
tree | d1bfdde1b9400601a3e570aaa0bd41397bd6e231 /vcl/inc | |
parent | 6ccc85290ea66ac69a609ef2345aea48605cefba (diff) |
gtk4: get dnd drop into LibreOffice from another app working
Change-Id: I9519af009b479e51a3da556f26f3950c4930d618
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117611
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 18 |
2 files changed, 18 insertions, 6 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 248b841dc07e..7d612f077d3f 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -260,7 +260,11 @@ class GtkSalFrame final : public SalFrame static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer frame); -#if !GTK_CHECK_VERSION(4, 0, 0) +#if GTK_CHECK_VERSION(4, 0, 0) + static GdkDragAction signalDragMotion(GtkDropTargetAsync *dest, GdkDrop *drop, double x, double y, gpointer frame); + static void signalDragLeave(GtkDropTargetAsync *dest, GdkDrop *drop, gpointer frame); + static gboolean signalDragDrop(GtkDropTargetAsync* context, GdkDrop* drop, double x, double y, gpointer frame); +#else static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame); static gboolean signalDragDrop(GtkWidget* widget, GdkDragContext *context, gint x, gint y, diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index e13524d8c54e..141a2a209ab0 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -64,8 +64,11 @@ struct text_transfer_result struct read_transfer_result { - css::uno::Sequence<sal_Int8> aSeq; + enum { BlockSize = 8192 }; + size_t nRead = 0; bool bDone = false; + + std::vector<sal_Int8> aVector; }; #endif @@ -131,9 +134,7 @@ class GtkInstDropTarget final : public cppu::WeakComponentImplHelper<css::datatr GtkSalFrame* m_pFrame; GtkDnDTransferable* m_pFormatConversionRequest; bool m_bActive; -#if !GTK_CHECK_VERSION(4, 0, 0) bool m_bInDrag; -#endif sal_Int8 m_nDefaultActions; std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners; public: @@ -169,10 +170,17 @@ public: } #if !GTK_CHECK_VERSION(4, 0, 0) - gboolean signalDragDrop(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time); gboolean signalDragMotion(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time); + gboolean signalDragDrop(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time); +#else + GdkDragAction signalDragMotion(GtkWidget *pWidget, GtkDropTargetAsync *context, GdkDrop *drop, double x, double y); + gboolean signalDragDrop(GtkDropTargetAsync *context, GdkDrop *drop, double x, double y); +#endif + + void signalDragLeave(GtkWidget* pWidget); + +#if !GTK_CHECK_VERSION(4, 0, 0) void signalDragDropReceived(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint ttype, guint time); - void signalDragLeave(GtkWidget* pWidget, GdkDragContext* context, guint time); #endif }; |