nurupo / vlc-pause-click-plugin

Plugin for VLC that pauses/plays video on mouse click
GNU Lesser General Public License v2.1
928 stars 63 forks source link

Add option to not pause when the click brings the VLC window to Active #77

Open cochetti opened 3 years ago

cochetti commented 3 years ago

Is your feature request related to a problem? Please describe

If I'm working in another window or on something that opens on top of VLC, when I click back to VLC it pauses the video (as expected). However, it is hard to avoid doing unless you specifically target the window top bar, the menu bar, or the bottom icon bar.

Describe the solution you'd like

I would rather my initial click which brings that window into focus from pausing the playback. Basically, I would prefer an option to restrict the "pause" behavior to only when VLC is already the active window.

Describe alternatives you've considered

I think this as an optional feature so that people can use this or not as they prefer as this behavior may not upset others.

Additional context

When in full screen on a secondary window, things can pop up over the VLC. If I use "WIn + Direction Key" I can shift that window back to my work screen. However if there are other items on that screen the VLC will still be under those full screen. So it would be nice to be able to just click over without the pause behavior. That's part of the problem.

Also when "casting" to my Chromecast, switching to my VLC window which is showing the "cone", I don't always expect that that first click over will stop the video. It would be nice if the switch to VLC didn't pause, and then I could just "re-click" to click in the pause.

nurupo commented 3 years ago

While I understand the need for this, I'm trying to stay within the limits of the functionality provided by the VLC plugin API, and as far as I see it doesn't provide any information on whether a click has made the window active or if the window was already active before the click was made, without having to resort to using Windows API, which I try to avoid. I am not very interested in writing platform-specific code, nor can I test Windows/macOS specific code on Linux (well, aside from maybe trying to run Windows code under WINE). However, this feature is something I'd be interested in merging, so feel free to create a PR adding it if you do get it to work using Windows API. If you do so, try not to change plugin's logic too much, e.g. the click events should still come from the VLC side instead of the Windows event loop directly, etc.

I will keep this issue open.

nurupo commented 3 years ago

Oh, you didn't say what OS you were using, so it might not even be Windows.

Well, the above applies to any platform, not just Windows, so replace "Windows API" with whatever is the platform API on that platform.