summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-01 13:49:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-01 16:31:56 +0200
commitd9b746c6393a7c39591ad2334fd6313a988050e6 (patch)
tree6660ee4a6a25334db955dceafa0077de85c1fde0 /vcl
parentacf49090ad43573e12af82a527cff24c688263fd (diff)
Resolves: tdf#124411 default dnd to MOVE for internal and COPY for external
which what the macosx version appears to also do Change-Id: Icff9cada2c821544d0130e28cc3e3862154a57dc Reviewed-on: https://gerrit.libreoffice.org/70063 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index ed9895dabdd2..a1334a1bbfeb 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3520,10 +3520,16 @@ gboolean GtkDropTarget::signalDragMotion(GtkWidget *pWidget, GdkDragContext *con
GdkModifierType mask;
gdk_window_get_pointer(widget_get_window(pWidget), nullptr, nullptr, &mask);
+ // tdf#124411 default to move if drag originates within LO itself, default
+ // to copy if it comes from outside, this is similar to srcAndDestEqual
+ // in macosx DropTarget::determineDropAction equivalent
+ sal_Int8 nNewDropAction = GtkDragSource::g_ActiveDragSource ?
+ css::datatransfer::dnd::DNDConstants::ACTION_MOVE :
+ css::datatransfer::dnd::DNDConstants::ACTION_COPY;
+
// tdf#109227 if a modifier is held down, default to the matching
// action for that modifier combo, otherwise pick the preferred
// default from the possible source actions
- sal_Int8 nNewDropAction = css::datatransfer::dnd::DNDConstants::ACTION_MOVE;
if ((mask & GDK_SHIFT_MASK) && !(mask & GDK_CONTROL_MASK))
nNewDropAction = css::datatransfer::dnd::DNDConstants::ACTION_MOVE;
else if ((mask & GDK_CONTROL_MASK) && !(mask & GDK_SHIFT_MASK))