Kaydet (Commit) d9b746c6 authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst acf49090
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment