[vlc-commits] [Git][videolan/vlc][master] qml: do not accept all drag enter events in MainInterface drop area
    Jean-Baptiste Kempf (@jbk) 
    gitlab at videolan.org
       
    Sat May 18 14:35:04 UTC 2024
    
    
  
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
09736fa6 by Fatih Uzunoglu at 2024-05-18T14:17:16+00:00
qml: do not accept all drag enter events in MainInterface drop area
- - - - -
1 changed file:
- modules/gui/qt/maininterface/qml/MainInterface.qml
Changes:
=====================================
modules/gui/qt/maininterface/qml/MainInterface.qml
=====================================
@@ -203,6 +203,20 @@ Item {
 
         DropArea {
             anchors.fill: parent
+
+            onEntered: (drag) => {
+                // Do not handle internal drag here:
+                if (!drag.source) {
+                    // Foreign drag, check if valid:
+                    if (drop.hasUrls || drop.hasText) {
+                        drag.accepted = true
+                        return
+                    }
+                }
+
+                drag.accepted = false
+            }
+
             onDropped: (drop) => {
                 let urls = []
                 if (drop.hasUrls) {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09736fa6060667b9a86d86c2541447a696a78f82
-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/09736fa6060667b9a86d86c2541447a696a78f82
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