Skip to content

Commit

Permalink
CatalogueUI : Don't "steal" irrelevant drags
Browse files Browse the repository at this point in the history
We were accepting any drag which provided StringVectorData, when we should only have been accepting those which originated in the image listing (because we are using the drag to reorder images). This meant we were accepting drags of paths from the HierarchyView, and then clobbering the custom pointer in `__pathListingDragLeave`. This gave people the impression that the drag was broken, when in fact you could still continue and drop elsewhere (despite the pointer indicating otherwise).

Also tweaked the drag move logic so we use exactly the same checks in both enter and move.
  • Loading branch information
johnhaddon committed Nov 29, 2024
1 parent 4a8b9fe commit 67d8f31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
1.4.15.x (relative to 1.4.15.2)
========

Fixes
-----

- Catalogue : Fixed bug which "stole" drags that crossed the image listing but which were destined elsewhere, for instance a drag from the HierarchyView to a PathFilter in the GraphEditor.

1.4.15.2 (relative to 1.4.15.1)
========
Expand Down
4 changes: 2 additions & 2 deletions python/GafferImageUI/CatalogueUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def __dropImage( self, eventData ) :

def __pathListingDragEnter( self, widget, event ) :

if isinstance( event.data, IECore.StringVectorData ) :
if event.sourceWidget is widget and isinstance( event.data, IECore.StringVectorData ) and event.data :
# Allow reordering of images
self.__moveToPath = None
self.__mergeGroupId += 1
Expand All @@ -1101,7 +1101,7 @@ def __pathListingDragLeave( self, widget, event ) :

def __pathListingDragMove( self, listing, event ) :

if not event.data or not isinstance( event.data, IECore.StringVectorData ) :
if not ( event.sourceWidget is listing and isinstance( event.data, IECore.StringVectorData ) and event.data ) :
return

targetPath = self.__pathListing.pathAt( event.line.p0 )
Expand Down

0 comments on commit 67d8f31

Please sign in to comment.