Drag and Drop Changed in Big Sur?

Hey all,

Has drag and drop (DragObjects) changed in Big Sur? I have a window where prior to Big Sur I could drag items between two list boxes. This is now broken. The drag item is being properly identified and added in the DragRow event but after that things break down. Seems like something has changed…

??

You’re talking about PrivateData or something else?
What are you seeing? A crash, code that won’t execute, empty string values, kernel panic, Earth exploding?
I don’t use Big Sur that much, but the actual behaviour may be examined, I guess.

Has nothing to do with the data being public of private. It is say:

Dog
Cat
Pickle

All in a list box. There is nothing but the drag doesn’t happen. It simply doesn’t work.

And it’s definitely not Xojo. I just tried running my app under 2019R3.2 and No drag and drop between list boxes.

I was referring to the call you use. Is it PrivateRawData or just Text?

Ah, so you don’t have a valid drag object that the receiver doesn’t get; rather, the drag doesn’t even start from the source.

You’re testing in 2019, which makes the same result, and deduce it’s not a Xojo issue because of that…
But drag&drop works in other, non-Xojo, apps, right?

Have you tried dragging text to another app (e.g. TextEdit) to begin with? If that works, perhaps PrivateRawData is the only broken call. Or maybe there’s something you do specifically that is broken.

As always: make us an example for testing. I only use drag-and-drop between NSTableView with private data to a listbox which works fine under BS.

So first to answer @Arnaud_N - this is code that has worked great for the last couple of years until now. The drag object never leaves the first listbox. It exists as I see it being created when I step through the code. So dragging it elsewhere doesn’t do anything. I tried. I

And @Beatrix_Willius, I haven’t had the time yet to prepare an example. That is my plan.

It is possible that I could have inadvertently done something to break this functionality which as I say was working. I know that Big Sur has broken or causes issues in multiple apps I use with regard to the UI. I have one app where a slider control doesn’t work properly. I have no idea what that app is written in. And just yesterday I found an issue with Microsoft Teams when filtering a spreadsheet inside teams, the checkboxes don’t work properly. So there are UI issues with Big Sur.

:grinning: The number of bugs never gets smaller.

1 Like

Well, the plot thickens. I just tried Xojo’s Listbox to Listbox drag and drop example and it works fine. But looking at all of my code, it’s pretty much the same as Xojo’s but maybe something has changed with API2 that is breaking code that once worked. I’m going to try running my existing build on a Windows machine and see what happens there…

It is absolutely, positively 100% OS X related. I just ran my current build in Windows 10 and the drag and drop work perfectly.

I found out where it is broken. It’s in Drag.AddItem. This code does not work:

Dim nRows, i As Integer
nRows=Me.ListCount-1
For i=0 To nRows
  If Me.RowIsFolder(i) Then
    Continue
  End If
  
  If Me.Selected(i) Then
    Drag.AddItem(0,0,0,0)
    Drag.Text=Me.List(i) //get text
  End If
  
Next
Return True //allow the drag

This code does work:

drag.Text = Me.List(row)

Return True

However, if you want to drag multiple items twos way, you can’t.

I will be filing a bug report.

feedback://showreport?report_id=63255

Includes an example project.

Had a look at your test project and the drag fails. But why does my code work:

Dim theDragItem As DragItem
theDragItem = New DragItem(Self.TrueWindow, OffsetX, OffsetY, finalDragPicture.Width, finalDragPicture.Height)
theDragItem.FolderItem = theAttachments(0)
for currentRecid as Integer = 1 to theAttachments.LastIndex
  theDragItem.AddItem(x, y, finalDragPicture.Width, finalDragPicture.Height)
  theDragItem.FolderItem = theAttachments(currentRecid)
next
theDragItem.DragPicture = finalDragPicture

? The drag comes as DragItemTV from a NSTableView and is re-created. Does this make a difference?

First of all, you are creating the DragItem in your code. I am relying on the DragItem that is passed in by Xojo in the event.

I would guess that has something to do with it.

I am also assuming you must be using Declares since you are dealing with an NSTableView. Maybe Xojo has something broken in their listbox for BigSur.

Another difference is that you’re passing 0,0,0,0 as the parameters of AddItem while Beatrix has valid values. Perhaps that’s what BS doesn’t like.

1 Like

Yeah, I tried altering those values. No difference.

1 Like

What if you try that way too? Put your code in the MouseDown event and create your own DragItem.
If it works, you can report the DragRow event is broken (a framework issue). If it doesn’t, it’s still a bug within your code.

It’s not a bug within my code. It works fine on everything Pre-Big Sure AND it works fine in Windows. I’m pretty sure I followed a Xojo example when writing it.

You do have an interesting idea that could be a workaround regarding creating my own DragItem.

I’m not saying it’s a bug “only” in your code. My guess is you are using something that pre-BS and Windows are tolerating (but are probably “undefined”) while BS finally became more strict and won’t allow something bad (like when Xojo introduced the ThreadUIException; it was, before, tolerated but as a risk and has became enforced later).
And you think it’s something BS has broken while it’s just that other systems are still tolerating something that shouldn’t be.

But that’s an assumption, still.

1 Like

It’s a huge assumption because I’m using what the Xojo framework is providing. So therefore if there’s an issue it’s their bug and not mine.