vcl/inc/unx/gtk/gtkinst.hxx | 4 ++-- vcl/unx/gtk3/gtkframe.cxx | 28 ++++++++++++++-------------- vcl/unx/gtk3/gtkinst.cxx | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-)
New commits: commit a73ace0a50ac497de8d5a9559aafd7e77df6af8a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Jun 24 10:24:12 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Jun 24 21:42:09 2021 +0200 gtk[3|4] set what widget to highlight during dnd Change-Id: Iba808b2f11615a25463c2739e6347f3cc2a91bc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117770 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 7203d4a0b131..56da7a6885f3 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -172,11 +172,11 @@ public: 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); + GdkDragAction signalDragMotion(GtkDropTargetAsync *context, GdkDrop *drop, double x, double y); gboolean signalDragDrop(GtkDropTargetAsync *context, GdkDrop *drop, double x, double y); #endif - void signalDragLeave(GtkWidget* pWidget); + void signalDragLeave(); #if !GTK_CHECK_VERSION(4, 0, 0) void signalDragDropReceived(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint ttype, guint time); diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index 529c39e7f0dc..4a4f5236a19e 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -4617,8 +4617,7 @@ GdkDragAction GtkSalFrame::signalDragMotion(GtkDropTargetAsync *dest, GdkDrop *d GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); if (!pThis->m_pDropTarget) return GdkDragAction(0); - GtkWidget *pEventWidget = pThis->getMouseEventWidget(); - return pThis->m_pDropTarget->signalDragMotion(pEventWidget, dest, drop, x, y); + return pThis->m_pDropTarget->signalDragMotion(dest, drop, x, y); } #else gboolean GtkSalFrame::signalDragMotion(GtkWidget *pWidget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame) @@ -4633,15 +4632,16 @@ gboolean GtkSalFrame::signalDragMotion(GtkWidget *pWidget, GdkDragContext *conte #if !GTK_CHECK_VERSION(4,0,0) gboolean GtkInstDropTarget::signalDragMotion(GtkWidget *pWidget, GdkDragContext *context, gint x, gint y, guint time) #else -GdkDragAction GtkInstDropTarget::signalDragMotion(GtkWidget *pWidget, GtkDropTargetAsync *context, GdkDrop *drop, double x, double y) +GdkDragAction GtkInstDropTarget::signalDragMotion(GtkDropTargetAsync *context, GdkDrop *pDrop, double x, double y) #endif { if (!m_bInDrag) { + GtkWidget* pHighlightWidget = GTK_WIDGET(m_pFrame->getFixedContainer()); #if !GTK_CHECK_VERSION(4,0,0) - gtk_drag_highlight(pWidget); + gtk_drag_highlight(pHighlightWidget); #else - gtk_widget_set_state_flags(pWidget, GTK_STATE_FLAG_DROP_ACTIVE, false); + gtk_widget_set_state_flags(pHighlightWidget, GTK_STATE_FLAG_DROP_ACTIVE, false); #endif } @@ -4650,7 +4650,7 @@ GdkDragAction GtkInstDropTarget::signalDragMotion(GtkWidget *pWidget, GtkDropTar #if !GTK_CHECK_VERSION(4,0,0) rtl::Reference<GtkDropTargetDragContext> pContext = new GtkDropTargetDragContext(context, time); #else - rtl::Reference<GtkDropTargetDragContext> pContext = new GtkDropTargetDragContext(context, drop); + rtl::Reference<GtkDropTargetDragContext> pContext = new GtkDropTargetDragContext(context, pDrop); #endif //preliminary accept the Drag and select the preferred action, the fire_* will //inform the original caller of our choice and the callsite can decide @@ -4713,7 +4713,7 @@ GdkDragAction GtkInstDropTarget::signalDragMotion(GtkWidget *pWidget, GtkDropTar #if !GTK_CHECK_VERSION(4,0,0) xTransferable = new GtkDnDTransferable(context, time, pWidget, this); #else - xTransferable = new GtkDnDTransferable(drop); + xTransferable = new GtkDnDTransferable(pDrop); #endif } css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = xTransferable->getTransferDataFlavors(); @@ -4739,16 +4739,15 @@ void GtkSalFrame::signalDragLeave(GtkDropTargetAsync* /*dest*/, GdkDrop* /*drop* GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); if (!pThis->m_pDropTarget) return; - GtkWidget *pEventWidget = pThis->getMouseEventWidget(); - pThis->m_pDropTarget->signalDragLeave(pEventWidget); + pThis->m_pDropTarget->signalDragLeave(); } #else -void GtkSalFrame::signalDragLeave(GtkWidget *pWidget, GdkDragContext* /*context*/, guint /*time*/, gpointer frame) +void GtkSalFrame::signalDragLeave(GtkWidget*, GdkDragContext* /*context*/, guint /*time*/, gpointer frame) { GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); if (!pThis->m_pDropTarget) return; - pThis->m_pDropTarget->signalDragLeave(pWidget); + pThis->m_pDropTarget->signalDragLeave(); } #endif @@ -4761,14 +4760,15 @@ static gboolean lcl_deferred_dragExit(gpointer user_data) return false; } -void GtkInstDropTarget::signalDragLeave(GtkWidget* pWidget) +void GtkInstDropTarget::signalDragLeave() { m_bInDrag = false; + GtkWidget* pHighlightWidget = GTK_WIDGET(m_pFrame->getFixedContainer()); #if !GTK_CHECK_VERSION(4,0,0) - gtk_drag_unhighlight(pWidget); + gtk_drag_unhighlight(pHighlightWidget); #else - gtk_widget_unset_state_flags(pWidget, GTK_STATE_FLAG_DROP_ACTIVE); + gtk_widget_unset_state_flags(pHighlightWidget, GTK_STATE_FLAG_DROP_ACTIVE); #endif // defer fire_dragExit, since gtk also sends a drag-leave before the drop, while diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f062dc5c13a4..5dc65ef79c3c 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -3086,10 +3086,10 @@ private: } #if !GTK_CHECK_VERSION(4, 0, 0) - static void signalDragLeave(GtkWidget *pWidget, GdkDragContext* /*context*/, guint /*time*/, gpointer widget) + static void signalDragLeave(GtkWidget*, GdkDragContext*, guint /*time*/, gpointer widget) { GtkInstanceWidget* pThis = static_cast<GtkInstanceWidget*>(widget); - pThis->m_xDropTarget->signalDragLeave(pWidget); + pThis->m_xDropTarget->signalDragLeave(); if (pThis->m_bDraggedOver) { pThis->m_bDraggedOver = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits