[vlc-commits] [Git][videolan/vlc][master] qml: prevent starting drag before the mime data is set

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Sep 8 13:04:13 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d8d6ce1d by Fatih Uzunoglu at 2024-09-08T12:46:12+00:00
qml: prevent starting drag before the mime data is set

For internal drag operations, it is possible to start the
drag before the input items are resolved because it is
feasible to wait for the input items to be resolved on
drop.

However, for external drag operations, the mime data
needs to be set before drop as we don't have the luxury
to wait for mime data on drop. In fact, even if there
was such a chance we would still need to make sure that
the mime data is set as soon as the drag starts because
the receiver application might do actions based on drag
enter event and the accompanied mime data.

Since it is not possible to know whether a drag operation
is an internal or external operation, we should pre-
emptively set the mime data before the drag operation
starts.

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/DragItem.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/DragItem.qml
=====================================
@@ -222,7 +222,6 @@ Item {
         if (Drag.active) {
             // reject all pending requests
             ++dragItem._grabImageRequest
-            _pendingNativeDragStart = true
 
             fsm.startDrag()
         } else {
@@ -332,6 +331,7 @@ Item {
                         guard: (requestId, data) => requestId === dragItem._currentRequest,
                         action: (requestId, data) => {
                             dragItem._setData(data)
+                            _pendingNativeDragStart = true
                         },
                         target: fsmRequestInputItem
                     },



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d8d6ce1d8bae3f513c408ad44199f7275cda9265

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d8d6ce1d8bae3f513c408ad44199f7275cda9265
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list