Multiple BluetoothMidiDevicePairingDialogue opened

Hi,

In the midi demo, and in our own app, clicking the button to get the list of available midi bluetooth devices opens a new dialog every time (by calling BluetoothMidiDevicePairingDialogue::open()) , even if one was already open. I see that I can supply a callback in the open() call, so I could prevent opening a new window if one is already opened (e.g., by tracking whether it was closed with a bool), but I don’t see an easy way to get a reference to the opened window to get it to the front or close it if the button is clicked again. Has anyone found a solution to this that doesn’t involve re-writing the native code for this (e.g., BluetoothMidiSelectorWindowHelper)?

Welp, I ended up copying this code and implementing the feature. Basically if you call open() several times in a row, the existing BT dialog will be brought to the front.

1 Like