diff --git a/Makefile b/Makefile index 278345f..90e7449 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,7 @@ prepare: clean install_build_deps @echo "11 - Hide Application is offline banner (https://github.com/aunetx/deezer-linux/pull/124)" @echo "12 - Disable animations (https://github.com/aunetx/deezer-linux/pull/133)" @echo "13 - Disable notifications (https://github.com/aunetx/deezer-linux/pull/151)" + @echo "14 - Make thumbar actions work (https://github.com/aunetx/deezer-linux/pull/153)" @$(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);) diff --git a/patches/14-thumbar-actions.patch b/patches/14-thumbar-actions.patch new file mode 100644 index 0000000..b37d95b --- /dev/null +++ b/patches/14-thumbar-actions.patch @@ -0,0 +1,75 @@ +From 7eb249657ab10516c7dff5d3f3be93b262a8d749 Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Fri, 15 Aug 2025 01:13:08 +0200 +Subject: [PATCH] feat: make thumbar actions actually work + +--- + build/main.js | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/build/main.js b/build/main.js +index 315cab4..241dd72 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -1598,6 +1598,8 @@ + return this.getPasteOptions(); + case MenuItemType.PlayerPlay: + return this.getPlayerPlayOptions(); ++ case MenuItemType.PlayerPlayThumbar: ++ return this.getPlayerPlayOptionsThumbar(); + case MenuItemType.PlayerNext: + return this.getPlayerNextOptions(); + case MenuItemType.PlayerPrev: +@@ -1738,15 +1740,26 @@ + }), + }; + } ++ getPlayerPlayOptionsThumbar() { ++ const { state } = this.media.getPlayerInfo(), ++ isPlaying = state === MediaPlayerState.Playing; ++ return { ++ label: i18n_t(isPlaying ? "menu_pause_label" : "menu_play_label"), ++ enabled: this.user.isLoggedIn(), ++ click: () => { ++ isPlaying ? this.media.pause() : this.media.play(); ++ }, ++ }; ++ } + getPlayerNextOptions() { + const { canNext } = this.media.getPlayerInfo(); + return { + label: i18n_t("menu_next_label"), + enabled: this.user.isLoggedIn() && canNext, + accelerator: "Shift+Right", +- click: noAcceleratorTrigger(() => { ++ click: () => { + this.media.next(); +- }), ++ }, + }; + } + getPlayerPrevOptions() { +@@ -1755,9 +1768,9 @@ + label: i18n_t("menu_previous_label"), + enabled: this.user.isLoggedIn() && canPrev, + accelerator: "Shift+Left", +- click: noAcceleratorTrigger(() => { ++ click: () => { + this.media.prev(); +- }), ++ }, + }; + } + getPlayerShuffleOptions() { +@@ -2410,7 +2423,7 @@ + external_electron_namespaceObject.Menu.buildFromTemplate([ + this.menu.getItem(MenuItemType.Open), + this.menu.getItem(MenuItemType.Separator), +- this.menu.getItem(MenuItemType.PlayerPlay), ++ this.menu.getItem(MenuItemType.PlayerPlayThumbar), + this.menu.getItem(MenuItemType.PlayerNext), + this.menu.getItem(MenuItemType.PlayerPrev), + this.menu.getItem(MenuItemType.Separator), +-- +2.48.1 +