Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and drop playlist append #2261

Closed
wants to merge 3 commits into from
Closed

Conversation

kevmitch
Copy link
Member

As per #2166, this adds append to playlist functionality through a modified drag and drop.

I have started with just x11. In this PR all other platforms preserve the existing "replace" behaviour for now.

The only way I could find to achieve this is to use the Action member in the XdndPosition client message. This is typically XdndActionCopy, however Thunar, Nautilus and Dolphin change this to XdndActionMove if you press the shift key. Dolphin will additionally send XdndActionLink if you press alt. Therefore, XdndActionCopy corresponds to the existing "replace" behaviour, while anything else is considered "append".

This seems kind of hackish to me, but I can't figure out any way to determine the modifier keys at drop time directly since the mpv window does not have focus and none of the above file managers appear to send this information along in the XdndPosition as they are supposed to according to http://jjlindal.net/jafl/xdnd/.

This takes care of the corner case where the player is started with a
single playlist entry so that the next/prev arrows are greyed out, but
remain that way even after new elements are added to the playlist.
This puts in place the machinery to merely append dropped file to the playlist
instead of replacing the existing playlist. In this commit, all front-ends
set this to false preserving the existing behaviour.
If the drag and drop action is anything other than
XdndActionCopy, append the dropped files rather than
replacing the existing playlist. With most file managers,
this will mean at least pressing shift while dropping.
@kevmitch
Copy link
Member Author

So is this mergeable with that modification?

@ghost
Copy link

ghost commented Aug 30, 2015

Sounds ok. If you want to bother, replace the bool parameter with an enum.

@kevmitch
Copy link
Member Author

merged with discussed revisions

@kevmitch kevmitch closed this Aug 30, 2015
@ghost
Copy link

ghost commented Aug 30, 2015

I see no merge, though.

@kevmitch
Copy link
Member Author

oops i just pushed the branch. fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant