Dragrow doesn't seems to fire on recent macos

Hi folks,
I have a custom listbox, with many methods in there for many years I added…

on macos 10.13 (and as before as I remember) I have a dragrow event on my custom listbox that fires nicely when I select multiple rows and begin a drag with the mouse, even with a small dragpicture icon that displays the number of selected rows.
this exact same app, on recent macos (I tried 12 and 13) the dragrow event doesn’t seems to fire at all. nothing happens when I try to start a drag.

Capture d’écran 2023-02-03 à 15.21.13

any idea what it can come from ?

thanks.

edit: the app has been compiled with xojo 2019r11.
I tried to run it using xojo 2022r41 and it does the same. no dragrow event occurs.

What may I have missed ?

Yes, I remember having fixed code in a large app during 2020. Vaguely I remember I had to react on some “fixing” done by Xojo, which broke my code. There must be a solution because I fixed it then (I see it in the release notes) but on the short hand I could not find out what exactly it was then… Sorry for not being very helpful here.

I have noticed on latest version of xojo, double click events being raised while clicking on different list rows. So not technically a double click just clicking through the list quickly. Maybe that is being called and blocking the drag row event workflow.

The selected row index got out of sync with the list box and the change event would not fire. Very odd. I think I added code in mouse down to trick it into working.

Mine might be because I am using Listbox and not desktoplistbox. Either way might be something to look into

1 Like

I looked at the listbox drag examples in xojo 2022r41, and the dragrow event is just firing fine, even on macos 13. so I think it’s something in my listbox subclass, but where ?

for the records, I use an “old” listbox, not a desktoplistbox.

edit: well it occured that when I opened my 2019r11 project in 2022r41, some of the classes properties went to default… among whom the canDrag property !..
after re-assigning it, the drag now occurs when compiling with 2022r41

but still strange problem, the drag displays a small red badge counting the number of items in the drag and I don’t want it ! I display my own picture for that ! so I have 2 red badges instead of one.
how do you get rid of this automatically added red badge on the drag ?

You can’t. It’s added by the OS.

it wans’t with earlier xojo like 2019r11 ???
so as you can see the count is wrong because I add 2 more rawdata to the dragitems
I tried privaterawdata and it is the same
is it possible to change this os count ?

I also see that I have work to do with hi-dpi screens !

When the macOS SDK was updated sometime recently, something critical to drag and drop broke when Apple removed some long deprecated code. It was updating that code to use the newer APIs that caused the count to show up and IIRC both Travis and I looked for a solution that would let us make the count optional but not require an entire rewrite of how Xojo does drag and drop. We didn’t find one.

1 Like

Yup. There was an internal macOS crash where I can’t find the issue anymore. There are other problems with drag-and-drop like https://tracker.xojo.com/xojoinc/xojo/-/issues/71322: Hard crash when trying to use rawdata for a listbox drag

You still have to use the MBS plugin to make a HiDPI drag image.

With NSTableView from the MBS plugin I don’t get the (ugly) red dot:

But even there I had to finagle the drag with the help of Thomas Templemann.

2 Likes