Closed kuba160 closed 2 years ago
This codepath is just an attempt to circumvent the focus stealing prevention in Gnome shell and possible KDE. If you can call an action in Deadbeef that shows the main window successfully without Gnome shell intercepting it and presenting the notification "click to show deadbeef" then you can just use a single codepath without this build time option. I believe this is irrelevant on Windows as there is no such behavior there.
Through trial and error I found out you could launch the .desktop file and this seemed to work for me when I added the code and the dependency on gio-unix.
There is also another way that involves using g_monotonic_time()
on gtk_window_present_with_time()
. See: https://github.com/DeaDBeeF-Player/deadbeef/commit/95ca904a1e0d54706cebb5f386ec525761f20afe
Using action_show_mainwin
does indeed have focus stealing issues, including Windows, but I guess it is better than nothing. Unless there is a simple solution that works well with focus stealing without gio-unix, using action_show_mainwin
as fallback is a good compromise in my opinion.
The MPRIS spec is ridiculous as it is and some servers don't even implement the Raise method and some MPRIS clients actually handle the raising of apps themselves by invoking the .desktop file based on the app id provided by the MPRIS server in case the Raise method isn't implemented. I think the MPRIS spec should be revised and they should just get rid of the Raise method since there are standardized ways to deal with this in desktop shells.
I'm just saying that if you can find a way that works universally feel free to just permanently get rid of the gio-unix dependency and implement the universal solution. Otherwise this PR is probably fine. I have no objections to it. Just giving my 2 cents.
Closing as this pull request source branch contains unrelated changes.
This will allow plugin to compile plugin on non-unix platforms such as Windows (and maybe macos). The plugin behavior on linux is unchanged.