De-couple `file-open` from `active-leaf-change`
Currently, the file-open event has a callback for the TFile opened. However, it provides no information as to the containing leaf of said TFile. I tried iterating through all open leaves, but found out that apparently they all contain the same TFile by reference, so... Is there not an actual way to find out the leaf for a file-open event?
The file-open is always triggered for the Workspace.activeLeaf. Just to be certain, however, I still suggest running a null check and comparing the TFile, but it should only fire for the active leaf.
Ah, thank you for the pointer!
I discovered that file-open events fire for active-leaf-change as well, which is not quite the expected behavior with two events named as such. I was more hoping that file-open would only fire for either a new leaf or a leaf getting a new file opened in it.
So maybe I can retitle the request to be "de-couple file-open from active-leaf-change"?
I would say that I don't want to change its behavior for backwards compatibility reasons, but we could look into adding a proper event for "file was just opened". Let's leave this issue open until that's available.
Sounds good! Yeah I agree, the breakages would be very unfunny.