[RFC] mac: fix open file from finder and clean ups#18225
Open
Akemi wants to merge 5 commits into
Open
Conversation
expose this function so it can be reused internally without the need of the dnd option handling and as a generic file open function with some special file type handling. similar to the mp_input_drop_files function.
make it reusable so the generic file logic can be reused, but handled by different underlying similar function, like dnd or just open file.
the old dnd open file mechanism was reworked with 81611b4 and isn't ready to handle open file events as early as needed anymore. additionally it also handles dnd options that would prevent loading of files in the case of not dnded files, which doesn't make much sense. sadly the macOS system file event exposes two different cases, open from finder and dnd on the dock icon. this can't be distinguished in any way. hence it was decided that dnd on the dock icon will be handled like a generic file open event now and only dnd on the window will be a proper dnd action. use the newly added open file function to circumvent the dnd option handling in those cases. Fixes mpv-player#17921
the open file menu items aren't dnd events and should not be treated as such.
rename this function to represent better what it does. dnd events should be handled by this one. generic open file events should be handled by the newly introduced function in the apphub, with the same old name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this exposes the handle_dnd function. i am not sure if this is the best way to expose it and it might also cause deadlocks like this(?). @na-na-hi @kasper93 it would be nice to have your input on this, how it should be exposed and where it might reside in the end.
clean up the discrepancies between dnd and file open events. there are 4 cases that open files that use the dnd function:
the latter two can not be distinguished since they are handled by the same internal mechanism without any reference from where the event was started. hence why the dnd on dock icon won't/can't be handled as a dnd event anymore. the menu items where moved to the new open file function and only the dnd on the window is now handled by the internal dnd function.
consequently, all dnd options only influence the dnd on windows case from the future and how it was intended.
Fixes #17921