From af026cfe6689472b1edde1d16363b213d277881f Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 12 Apr 2025 22:41:31 +0200 Subject: [PATCH 01/10] Improved signing strategy for windows by including files inside the installer (https://github.com/zen-browser/desktop/issues/37) --- .../workflows/twilight-release-schedule.yml | 2 +- .github/workflows/windows-release-build.yml | 19 +++---- build/winsign/sign.ps1 | 49 +++++++++---------- scripts/download-language-packs.sh | 4 ++ 4 files changed, 34 insertions(+), 40 deletions(-) diff --git a/.github/workflows/twilight-release-schedule.yml b/.github/workflows/twilight-release-schedule.yml index c3fb8d8c..f0163ab7 100644 --- a/.github/workflows/twilight-release-schedule.yml +++ b/.github/workflows/twilight-release-schedule.yml @@ -14,7 +14,7 @@ on: description: 'Use sccache' required: false type: boolean - default: true + default: false jobs: twilight-release-schedule: diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 6ed9881b..08c2f729 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -277,24 +277,19 @@ jobs: path: ./zen.win64-pgo-stage-1.zip - name: Remove unnecessary files from obj - if: ${{ !inputs.generate-gpo }} + if: ${{ !inputs.generate-gpo && inputs.release-branch == 'stable' }} run: | set -x - if test "${{ matrix.arch }}" = "aarch64"; then - find engine/obj-aarch64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type d -not -name 'dist' -exec rm -rf {} \; - find engine/obj-aarch64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type f -not -name 'dist' -exec rm -f {} \; - else - find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type d -not -name 'dist' -exec rm -rf {} \; - find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type f -not -name 'dist' -exec rm -f {} \; - fi - + mkdir obj-${{ matrix.arch }}-pc-windows-msvc/ + cp -r --no-dereference engine/obj-${{ matrix.arch }}-pc-windows-msvc/* obj-${{ matrix.arch }}-pc-windows-msvc/ || true + - name: Upload dist object - if: ${{ !inputs.generate-gpo }} + if: ${{ !inputs.generate-gpo && inputs.release-branch == 'stable' }} uses: actions/upload-artifact@v4 with: - retention-days: 5 + retention-days: 2 name: windows-x64-obj-${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }} - path: engine/obj-${{ matrix.arch == 'aarch64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/ + path: obj-${{ matrix.arch }}-pc-windows-msvc - name: Upload artifact (if Twilight branch, binary) if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} diff --git a/build/winsign/sign.ps1 b/build/winsign/sign.ps1 index e3a96cb7..cb3d0b83 100644 --- a/build/winsign/sign.ps1 +++ b/build/winsign/sign.ps1 @@ -6,6 +6,7 @@ param( $ErrorActionPreference = "Stop" echo "Preparing environment" +git pull --recurse mkdir windsign-temp -ErrorAction SilentlyContinue # Download in parallel @@ -18,18 +19,34 @@ mkdir windsign-temp -ErrorAction SilentlyContinue # echo "Downloaded git objects repo to" #} -Verbose -ArgumentList $PWD -Debug +Start-Job -Name "DownloadGitl10n" -ScriptBlock { + param($PWD) + cd $PWD + $env:ZEN_L10N_CURR_DIR=[regex]::replace($PWD, "^([A-Z]):", { "/" + $args.value.Substring(0, 1).toLower() }) -replace "\\", "/" + C:\mozilla-build\start-shell.bat $PWD\scripts\download-language-packs.sh + echo "Fetched l10n and firefox's one" +} -Verbose -ArgumentList $PWD -Debug + gh run download $GithubRunId --name windows-x64-obj-arm64 -D windsign-temp\windows-x64-obj-arm64 echo "Downloaded arm64 artifacts" gh run download $GithubRunId --name windows-x64-obj-x86_64 -D windsign-temp\windows-x64-obj-x86_64 echo "Downloaded x86_64 artifacts" - -#Wait-Job -Name "DownloadGitObjectsRepo" +Wait-Job -Name "DownloadGitl10n" mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue surfer -- ci --brand release +# Collect all .exe and .dll files into a list +$files = Get-ChildItem windsign-temp\windows-x64-obj-x86_64\ -Recurse -Include *.exe +$files += Get-ChildItem windsign-temp\windows-x64-obj-x86_64\ -Recurse -Include *.dll + +$files = Get-ChildItem windsign-temp\windows-x64-obj-arm64\ -Recurse -Include *.exe +$files += Get-ChildItem windsign-temp\windows-x64-obj-arm64\ -Recurse -Include *.dll + +signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files + function SignAndPackage($name) { echo "Executing on $name" rmdir .\dist -Recurse -ErrorAction SilentlyContinue @@ -37,13 +54,7 @@ function SignAndPackage($name) { cp windsign-temp\windows-x64-obj-$name engine\obj-x86_64-pc-windows-msvc\ -Recurse echo "Signing $name" - # Collect all .exe and .dll files into a list - $files = Get-ChildItem engine\obj-x86_64-pc-windows-msvc\ -Recurse -Include *.exe - $files += Get-ChildItem engine\obj-x86_64-pc-windows-msvc\ -Recurse -Include *.dll - - signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files echo "Packaging $name" - $env:SURFER_SIGNING_MODE="sign" $env:MAR="..\\build\\winsign\\mar.exe" if ($name -eq "arm64") { $env:SURFER_COMPAT="aarch64" @@ -61,7 +72,6 @@ function SignAndPackage($name) { # - update_manifest/* # - windows.mar # - zen.installer.exe - # - zen.win-x86_64.zip echo "Creating tar for $name" rm .\windsign-temp\windows-x64-signed-$name -Recurse -ErrorAction SilentlyContinue mkdir windsign-temp\windows-x64-signed-$name @@ -82,27 +92,9 @@ function SignAndPackage($name) { mv .\dist\zen.installer.exe windsign-temp\windows-x64-signed-$name\zen.installer.exe } - # Move the zip - echo "Moving zip for $name" - if ($name -eq "arm64") { - mv (Get-Item .\dist\*.en-US.win64-aarch64.zip) windsign-temp\windows-x64-signed-$name\zen.win-arm64.zip - } else { - mv (Get-Item .\dist\*.en-US.win64.zip) windsign-temp\windows-x64-signed-$name\zen.win-$name.zip - } - - # Extract the zip, sign everything inside, and repackage it - #Expand-Archive -Path windsign-temp\windows-x64-signed-$name\zen.win-$name.zip -DestinationPath windsign-temp\windows-x64-signed-$name\zen.win-$name - #rm windsign-temp\windows-x64-signed-$name\zen.win-$name.zip - #$files = Get-ChildItem windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -Include *.exe - #$files += Get-ChildItem windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -Include *.dll - #signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files - #Compress-Archive -Path windsign-temp\windows-x64-signed-$name\zen.win-$name -DestinationPath windsign-temp\windows-x64-signed-$name\zen.win-$name.zip - rmdir windsign-temp\windows-x64-signed-$name\zen.win-$name -Recurse -ErrorAction SilentlyContinue - # Move the manifest mv .\dist\update\. windsign-temp\windows-x64-signed-$name\update_manifest - echo "Invoking tar for $name" # note: We need to sign it into a parent folder, called windows-x64-signed-$name rmdir .\windsign-temp\windows-binaries\windows-x64-signed-$name -Recurse -ErrorAction SilentlyContinue mv windsign-temp\windows-x64-signed-$name .\windsign-temp\windows-binaries -Force @@ -113,6 +105,9 @@ function SignAndPackage($name) { SignAndPackage arm64 SignAndPackage x86_64 +$files = Get-ChildItem .\windsign-temp\windows-binaries -Recurse -Include *.exe +signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files + echo "All artifacts signed and packaged, ready for release!" echo "Commiting the changes to the repository" cd windsign-temp\windows-binaries diff --git a/scripts/download-language-packs.sh b/scripts/download-language-packs.sh index 2c4b929d..869d8882 100644 --- a/scripts/download-language-packs.sh +++ b/scripts/download-language-packs.sh @@ -1,5 +1,9 @@ set -ex +if ! [ -z "$ZEN_L10N_CURR_DIR" ]; then + cd $ZEN_L10N_CURR_DIR +fi + CURRENT_DIR=$(pwd) git config --global init.defaultBranch main From a0330465dd7b9510c22b96616ec91c9acf3878c0 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 12 Apr 2025 22:44:57 +0200 Subject: [PATCH 02/10] Formatted before release --- .github/workflows/windows-release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 08c2f729..8c760ce3 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -282,7 +282,7 @@ jobs: set -x mkdir obj-${{ matrix.arch }}-pc-windows-msvc/ cp -r --no-dereference engine/obj-${{ matrix.arch }}-pc-windows-msvc/* obj-${{ matrix.arch }}-pc-windows-msvc/ || true - + - name: Upload dist object if: ${{ !inputs.generate-gpo && inputs.release-branch == 'stable' }} uses: actions/upload-artifact@v4 From 54d716e4b614b8cf2d93eb1fb36b4e9ca9f0f19b Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sun, 13 Apr 2025 07:55:46 +0200 Subject: [PATCH 03/10] Refactor conditions for removing unnecessary files and uploading dist object in Windows release build --- .github/workflows/windows-release-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 8c760ce3..e57320e5 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -277,14 +277,14 @@ jobs: path: ./zen.win64-pgo-stage-1.zip - name: Remove unnecessary files from obj - if: ${{ !inputs.generate-gpo && inputs.release-branch == 'stable' }} + if: ${{ !inputs.generate-gpo }} run: | set -x mkdir obj-${{ matrix.arch }}-pc-windows-msvc/ cp -r --no-dereference engine/obj-${{ matrix.arch }}-pc-windows-msvc/* obj-${{ matrix.arch }}-pc-windows-msvc/ || true - name: Upload dist object - if: ${{ !inputs.generate-gpo && inputs.release-branch == 'stable' }} + if: ${{ !inputs.generate-gpo }} uses: actions/upload-artifact@v4 with: retention-days: 2 From 82b94db4088667c54e9733ab13e231bc19f63311 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Sun, 13 Apr 2025 14:47:56 +0700 Subject: [PATCH 04/10] feat(MediaController): controls for media devices --- ...inc.xhtml => zen-media-controls.inc.xhtml} | 6 + .../base/content/zen-sidebar-icons.inc.xhtml | 2 +- .../content/zen-styles/zen-media-controls.css | 18 +- .../zen-components/ZenMediaController.mjs | 195 +++++++++++++++--- src/browser/themes/shared/zen-icons/icons.css | 18 ++ .../themes/shared/zen-icons/jar.inc.mn | 12 ++ .../zen-icons/lin/microphone-blocked.fill.svg | 7 + .../shared/zen-icons/lin/microphone.fill.svg | 6 + .../zen-icons/lin/video-blocked.fill.svg | 1 + .../shared/zen-icons/lin/video.fill.svg | 3 + 10 files changed, 236 insertions(+), 32 deletions(-) rename src/browser/base/content/{zen-media-player.inc.xhtml => zen-media-controls.inc.xhtml} (86%) create mode 100644 src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/microphone.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/video.fill.svg diff --git a/src/browser/base/content/zen-media-player.inc.xhtml b/src/browser/base/content/zen-media-controls.inc.xhtml similarity index 86% rename from src/browser/base/content/zen-media-player.inc.xhtml rename to src/browser/base/content/zen-media-controls.inc.xhtml index 1e53438c..6bb12354 100644 --- a/src/browser/base/content/zen-media-player.inc.xhtml +++ b/src/browser/base/content/zen-media-controls.inc.xhtml @@ -36,6 +36,12 @@ class="toolbarbutton-1" /> + + + + diff --git a/src/browser/base/content/zen-sidebar-icons.inc.xhtml b/src/browser/base/content/zen-sidebar-icons.inc.xhtml index 2d26c0a9..2bfe8caf 100644 --- a/src/browser/base/content/zen-sidebar-icons.inc.xhtml +++ b/src/browser/base/content/zen-sidebar-icons.inc.xhtml @@ -1,4 +1,4 @@ -#include zen-media-player.inc.xhtml +#include zen-media-controls.inc.xhtml toolbarbutton:not(:first-child) { + display: none; + + #media-device-buttons { + display: flex; + } + } + &:not([can-pip]) { #zen-media-info-vbox { width: calc(100% - 26px); @@ -206,7 +220,7 @@ } #zen-media-info-vbox { - #zen-media-controls-toolbar:not([media-position-hidden='true']) & { + #zen-media-controls-toolbar:not([media-position-hidden]) & { transition-delay: 0.01s !important; } overflow-x: hidden; @@ -251,7 +265,7 @@ align-items: center; padding-top: 0px !important; - #zen-media-controls-toolbar[media-position-hidden='true'] & { + #zen-media-controls-toolbar[media-position-hidden] & { display: none; } } diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index 8e839b1b..c77b38a7 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -27,6 +27,8 @@ _tabTimeout = null; _controllerSwitchTimeout = null; + #isSeeking = false; + init() { if (!Services.prefs.getBoolPref('zen.mediacontrols.enabled', true)) return; @@ -50,6 +52,11 @@ } #initEventListeners() { + this.mediaControlBar.addEventListener('mousedown', (event) => { + if (event.target.closest(':is(toolbarbutton,#zen-media-progress-hbox)')) return; + else this.onMediaFocus(); + }); + this.mediaControlBar.addEventListener('command', (event) => { const button = event.target.closest('toolbarbutton'); if (!button) return; @@ -75,6 +82,12 @@ case 'zen-media-playpause-button': this.onMediaToggle(); break; + case 'zen-media-mute-mic-button': + this.onMicrophoneMuteToggle(); + break; + case 'zen-media-mute-camera-button': + this.onCameraMuteToggle(); + break; } }); @@ -123,25 +136,29 @@ }); window.addEventListener('DOMAudioPlaybackStopped', () => this.updateMuteState()); + window.webrtcUI.on('peer-request-allowed', this._onMediaShareStart.bind(this)); } onTabDiscardedOrClosed(event) { - const linkedBrowser = event.target.linkedBrowser; - if (!linkedBrowser?.browsingContext?.mediaController) return; - this.deinitMediaController( - linkedBrowser.browsingContext.mediaController, - true, - linkedBrowser.browserId === this._currentBrowser?.browserId, - true - ); + const { linkedBrowser } = event.target; + + if (linkedBrowser?.browserId === this._currentBrowser?.browserId) { + this.deinitMediaSharingControls(linkedBrowser); + this.hideMediaControls(); + } + + if (linkedBrowser?.browsingContext.mediaController) { + this.deinitMediaController( + linkedBrowser.browsingContext.mediaController, + true, + linkedBrowser.browserId === this._currentBrowser?.browserId, + true + ); + } } async deinitMediaController(mediaController, shouldForget = true, shouldOverride = true, shouldHide = true) { - if (!mediaController) return; - - const retrievedMediaController = this.mediaControllersMap.get(mediaController.id); - - if (shouldForget) { + if (shouldForget && mediaController) { mediaController.removeEventListener('pictureinpicturemodechange', this.onPipModeChange); mediaController.removeEventListener('positionstatechange', this.onPositionstateChange); mediaController.removeEventListener('playbackstatechange', this.onPlaybackstateChange); @@ -167,6 +184,26 @@ } } + get isSharing() { + return this.mediaControlBar.hasAttribute('media-sharing'); + } + + set isSharing(value) { + if (this._currentBrowser && !value) { + const webRTC = this._currentBrowser.browsingContext.currentWindowGlobal.getActor('WebRTC'); + webRTC.sendAsyncMessage('webrtc:UnmuteMicrophone'); + webRTC.sendAsyncMessage('webrtc:UnmuteCamera'); + } + + if (!value) { + this.mediaControlBar.removeAttribute('mic-muted'); + this.mediaControlBar.removeAttribute('camera-muted'); + } else { + this.mediaControlBar.setAttribute('media-position-hidden', ''); + this.mediaControlBar.setAttribute('media-sharing', ''); + } + } + hideMediaControls() { if (this.mediaControlBar.hasAttribute('hidden')) return; @@ -189,12 +226,16 @@ } showMediaControls() { - if (!this._currentMediaController) return; - - if (this._currentMediaController.isBeingUsedInPIPModeOrFullscreen) return this.hideMediaControls(); if (!this.mediaControlBar.hasAttribute('hidden')) return; - this.updatePipButton(); + if (!this.isSharing) { + if (!this._currentMediaController) return; + if (this._currentMediaController.isBeingUsedInPIPModeOrFullscreen) return this.hideMediaControls(); + + this.updatePipButton(); + this.mediaControlBar.removeAttribute('media-sharing'); + } + const mediaInfoElements = [this.mediaTitle, this.mediaArtist]; for (const element of mediaInfoElements) { element.removeAttribute('overflow'); // So we can properly recalculate the overflow @@ -238,6 +279,7 @@ } setupMediaControlUI(metadata, positionState) { + if (this.isSharing) return; this.updatePipButton(); if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) { @@ -295,6 +337,70 @@ mediaController.addEventListener('deactivated', this.onDeactivated); } + activateMediaDeviceControls(browser) { + if (browser?.browsingContext.currentWindowGlobal.hasActivePeerConnections()) { + this.mediaControlBar.removeAttribute('can-pip'); + this._currentBrowser = browser; + + const tab = window.gBrowser.getTabForBrowser(browser); + const iconURL = browser.mIconURL || `page-icon:${browser.currentURI.spec}`; + + this.isSharing = true; + + this.mediaFocusButton.style.listStyleImage = `url(${iconURL})`; + this.mediaTitle.textContent = tab.label; + this.mediaArtist.textContent = ''; + + this.showMediaControls(); + tab.addEventListener('TabAttrModified', this._onTabAttrModified.bind(this)); + } + } + + deinitMediaSharingControls(browser) { + const tab = window.gBrowser.getTabForBrowser(browser); + if (tab) tab.removeEventListener('TabAttrModified', this._onTabAttrModified.bind(this)); + + this.isSharing = false; + this._currentBrowser = null; + } + + _onTabAttrModified(event) { + const { changed } = event.detail; + const { linkedBrowser } = event.target; + + if (changed.includes('sharing') && !linkedBrowser.browsingContext.currentWindowGlobal.hasActivePeerConnections()) { + if (this._currentBrowser?.browserId === linkedBrowser.browserId) { + event.target.removeEventListener('TabAttrModified', this._onTabAttrModified.bind(this)); + this.deinitMediaSharingControls(linkedBrowser); + + this.hideMediaControls(); + this.switchController(true); + } + } + } + + _onMediaShareStart(event) { + const { innerWindowID } = event; + + for (const browser of window.gBrowser.browsers) { + if (browser.innerWindowID === innerWindowID) { + const webRTC = browser.browsingContext.currentWindowGlobal.getActor('WebRTC'); + webRTC.sendAsyncMessage('webrtc:UnmuteMicrophone'); + webRTC.sendAsyncMessage('webrtc:UnmuteCamera'); + + if (this._currentBrowser) this.deinitMediaSharingControls(this._currentBrowser); + if (this._currentMediaController) { + this._currentMediaController.pause(); + this.deinitMediaController(this._currentMediaController, true, true).then(() => + this.activateMediaDeviceControls(browser) + ); + } else this.activateMediaDeviceControls(browser); + + break; + } + } + } + _onDeactivated(event) { this.deinitMediaController(event.target, true, event.target.id === this._currentMediaController.id, true); this.switchController(); @@ -339,6 +445,9 @@ switchController(force = false) { let timeout = 3000; + if (this.isSharing) return; + if (this.#isSeeking) return; + if (this._controllerSwitchTimeout) { clearTimeout(this._controllerSwitchTimeout); this._controllerSwitchTimeout = null; @@ -466,6 +575,8 @@ } onMediaSeekDrag(event) { + this.#isSeeking = true; + this._currentMediaController?.pause(); const newTime = (event.target.value / 100) * this._currentDuration; this.mediaCurrentTime.textContent = this.formatSecondsToTime(newTime); @@ -477,11 +588,18 @@ this._currentMediaController.seekTo(newPosition); this._currentMediaController.play(); } + + this.#isSeeking = false; } onMediaFocus() { if (!this._currentBrowser) return; - this._currentMediaController?.focus(); + + if (this._currentMediaController) this._currentMediaController.focus(); + else if (this._currentBrowser) { + const tab = window.gBrowser.getTabForBrowser(this._currentBrowser); + if (tab) window.ZenWorkspaces.switchTabIfNeeded(tab); + } } onMediaMute() { @@ -503,9 +621,13 @@ } onControllerClose() { - this._currentMediaController?.pause(); + if (this._currentMediaController) { + this._currentMediaController.pause(); + this.deinitMediaController(this._currentMediaController); + } else if (this.isSharing) this.deinitMediaSharingControls(this._currentBrowser); + + this.hideMediaControls(); this.switchController(true); - this.deinitMediaController(this._currentMediaController); } onMediaPip() { @@ -514,22 +636,37 @@ .sendAsyncMessage('PictureInPicture:KeyToggle'); } + onMicrophoneMuteToggle() { + if (this._currentBrowser) { + const shouldMute = this.mediaControlBar.hasAttribute('mic-muted') ? 'webrtc:UnmuteMicrophone' : 'webrtc:MuteMicrophone'; + + this._currentBrowser.browsingContext.currentWindowGlobal.getActor('WebRTC').sendAsyncMessage(shouldMute); + this.mediaControlBar.toggleAttribute('mic-muted'); + } + } + + onCameraMuteToggle() { + if (this._currentBrowser) { + const shouldMute = this.mediaControlBar.hasAttribute('camera-muted') ? 'webrtc:UnmuteCamera' : 'webrtc:MuteCamera'; + + this._currentBrowser.browsingContext.currentWindowGlobal.getActor('WebRTC').sendAsyncMessage(shouldMute); + this.mediaControlBar.toggleAttribute('camera-muted'); + } + } + updateMuteState() { if (!this._currentBrowser) return; - if (this._currentBrowser._audioMuted) { - this.mediaControlBar.setAttribute('muted', ''); - } else { - this.mediaControlBar.removeAttribute('muted'); - } + this.mediaControlBar.toggleAttribute('muted', this._currentBrowser._audioMuted); } updatePipButton() { if (!this._currentBrowser) return; - const { totalPipCount, totalPipDisabled } = PictureInPicture.getEligiblePipVideoCount(this._currentBrowser); + if (this.isSharing) return; - if (totalPipCount === 1 || (totalPipDisabled > 0 && lazy.RESPECT_PIP_DISABLED)) - this.mediaControlBar.setAttribute('can-pip', ''); - else this.mediaControlBar.removeAttribute('can-pip'); + const { totalPipCount, totalPipDisabled } = PictureInPicture.getEligiblePipVideoCount(this._currentBrowser); + const canPip = totalPipCount === 1 || (totalPipDisabled > 0 && lazy.RESPECT_PIP_DISABLED); + + this.mediaControlBar.toggleAttribute('can-pip', canPip); } } diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index 13ca3d7d..2b7d79b1 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -1181,6 +1181,24 @@ menupopup > menuitem:is([type='checkbox']) .menu-iconic-left { list-style-image: url('close.svg') !important; } +#zen-media-mute-mic-button { + list-style-image: url('microphone.fill.svg') !important; +} + +#zen-media-controls-toolbar[mic-muted] #zen-media-mute-mic-button { + list-style-image: url('microphone-blocked.fill.svg') !important; + fill: rgb(224, 41, 29); +} + +#zen-media-mute-camera-button { + list-style-image: url('video.fill.svg') !important; +} + +#zen-media-controls-toolbar[camera-muted] #zen-media-mute-camera-button { + list-style-image: url('video-blocked.fill.svg') !important; + fill: rgb(224, 41, 29); +} + #zen-media-pip-button { list-style-image: url('chrome://global/skin/media/picture-in-picture-open.svg') !important; } diff --git a/src/browser/themes/shared/zen-icons/jar.inc.mn b/src/browser/themes/shared/zen-icons/jar.inc.mn index 515c183f..6fc922d9 100644 --- a/src/browser/themes/shared/zen-icons/jar.inc.mn +++ b/src/browser/themes/shared/zen-icons/jar.inc.mn @@ -75,7 +75,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) + skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) + skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -125,8 +127,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) + skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) + skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) @@ -209,7 +213,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) + skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) + skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -259,8 +265,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) + skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) + skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) @@ -343,7 +351,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) + skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) + skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -393,8 +403,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) + skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) + skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) diff --git a/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg new file mode 100644 index 00000000..ddf8675f --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg new file mode 100644 index 00000000..4fb5cf62 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg b/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg new file mode 100644 index 00000000..e1032022 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/video.fill.svg b/src/browser/themes/shared/zen-icons/lin/video.fill.svg new file mode 100644 index 00000000..41f98195 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/video.fill.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From ae07ed9445e1b75b5f7eaaa7b2cc3c01aff27dc2 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Sun, 13 Apr 2025 15:00:04 +0700 Subject: [PATCH 05/10] fix(MediaController): prevent media control actions when sharing --- src/browser/base/zen-components/ZenMediaController.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index c77b38a7..968e8836 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -95,6 +95,8 @@ this.mediaProgressBar.addEventListener('change', this.onMediaSeekComplete.bind(this)); window.addEventListener('TabSelect', (event) => { + if (this.isSharing) return; + const linkedBrowser = event.target.linkedBrowser; this.switchController(); @@ -279,7 +281,6 @@ } setupMediaControlUI(metadata, positionState) { - if (this.isSharing) return; this.updatePipButton(); if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) { @@ -324,7 +325,7 @@ lastUpdated: Date.now(), }); - if (!this._currentBrowser) { + if (!this._currentBrowser && !this.isSharing) { this.setupMediaController(mediaController, browser); this.setupMediaControlUI(metadata, positionState); } From ec1c861b13c9a0e4629812cd74b34a7affd18f80 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sun, 13 Apr 2025 10:20:10 +0200 Subject: [PATCH 06/10] Fix tab drag logic to allow dragging the last opened tab --- src/browser/base/zen-components/ZenViewSplitter.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/browser/base/zen-components/ZenViewSplitter.mjs b/src/browser/base/zen-components/ZenViewSplitter.mjs index c094f190..6841721d 100644 --- a/src/browser/base/zen-components/ZenViewSplitter.mjs +++ b/src/browser/base/zen-components/ZenViewSplitter.mjs @@ -189,7 +189,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { !this._lastOpenedTab || (this._lastOpenedTab && this._lastOpenedTab.getAttribute('zen-workspace-id') !== draggedTab.getAttribute('zen-workspace-id') && - !this._lastOpenedTab.hasAttribute('zen-essential')) + !this._lastOpenedTab.hasAttribute('zen-essential')) || + draggedTab === this._lastOpenedTab ) { return; } From 98220c5e74522f327c3814d6a5e8ce3b7c9736b6 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sun, 13 Apr 2025 11:19:25 +0200 Subject: [PATCH 07/10] Updated media controler call icons --- .../content/zen-styles/zen-media-controls.css | 4 ++++ src/browser/themes/shared/zen-icons/icons.css | 8 +++---- .../themes/shared/zen-icons/jar.inc.mn | 24 +++++++++---------- .../zen-icons/lin/microphone-blocked-fill.svg | 1 + .../zen-icons/lin/microphone-blocked.fill.svg | 7 ------ .../shared/zen-icons/lin/microphone-fill.svg | 1 + .../shared/zen-icons/lin/microphone.fill.svg | 6 ----- .../zen-icons/lin/video-blocked-fill.svg | 1 + .../zen-icons/lin/video-blocked.fill.svg | 1 - .../shared/zen-icons/lin/video-fill.svg | 1 + .../shared/zen-icons/lin/video.fill.svg | 3 --- 11 files changed, 24 insertions(+), 33 deletions(-) create mode 100644 src/browser/themes/shared/zen-icons/lin/microphone-blocked-fill.svg delete mode 100644 src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/microphone-fill.svg delete mode 100644 src/browser/themes/shared/zen-icons/lin/microphone.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/video-blocked-fill.svg delete mode 100644 src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg create mode 100644 src/browser/themes/shared/zen-icons/lin/video-fill.svg delete mode 100644 src/browser/themes/shared/zen-icons/lin/video.fill.svg diff --git a/src/browser/base/content/zen-styles/zen-media-controls.css b/src/browser/base/content/zen-styles/zen-media-controls.css index 3c42780e..0bfa9060 100644 --- a/src/browser/base/content/zen-styles/zen-media-controls.css +++ b/src/browser/base/content/zen-styles/zen-media-controls.css @@ -25,6 +25,10 @@ } } + #media-device-buttons { + gap: 2px; + } + &[media-sharing] #zen-media-controls-hbox > toolbarbutton:not(:first-child) { display: none; diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index 2b7d79b1..b671195c 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -1182,20 +1182,20 @@ menupopup > menuitem:is([type='checkbox']) .menu-iconic-left { } #zen-media-mute-mic-button { - list-style-image: url('microphone.fill.svg') !important; + list-style-image: url('microphone-fill.svg') !important; } #zen-media-controls-toolbar[mic-muted] #zen-media-mute-mic-button { - list-style-image: url('microphone-blocked.fill.svg') !important; + list-style-image: url('microphone-blocked-fill.svg') !important; fill: rgb(224, 41, 29); } #zen-media-mute-camera-button { - list-style-image: url('video.fill.svg') !important; + list-style-image: url('video-fill.svg') !important; } #zen-media-controls-toolbar[camera-muted] #zen-media-mute-camera-button { - list-style-image: url('video-blocked.fill.svg') !important; + list-style-image: url('video-blocked-fill.svg') !important; fill: rgb(224, 41, 29); } diff --git a/src/browser/themes/shared/zen-icons/jar.inc.mn b/src/browser/themes/shared/zen-icons/jar.inc.mn index 6fc922d9..1bafe6ce 100644 --- a/src/browser/themes/shared/zen-icons/jar.inc.mn +++ b/src/browser/themes/shared/zen-icons/jar.inc.mn @@ -75,9 +75,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) - skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) + skin/classic/browser/zen-icons/microphone-blocked-fill.svg (../shared/zen-icons/lin/microphone-blocked-fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) - skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) + skin/classic/browser/zen-icons/microphone-fill.svg (../shared/zen-icons/lin/microphone-fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -127,10 +127,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) - skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) + skin/classic/browser/zen-icons/video-blocked-fill.svg (../shared/zen-icons/lin/video-blocked-fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) - skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) + skin/classic/browser/zen-icons/video-fill.svg (../shared/zen-icons/lin/video-fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) @@ -213,9 +213,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) - skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) + skin/classic/browser/zen-icons/microphone-blocked-fill.svg (../shared/zen-icons/lin/microphone-blocked-fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) - skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) + skin/classic/browser/zen-icons/microphone-fill.svg (../shared/zen-icons/lin/microphone-fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -265,10 +265,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) - skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) + skin/classic/browser/zen-icons/video-blocked-fill.svg (../shared/zen-icons/lin/video-blocked-fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) - skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) + skin/classic/browser/zen-icons/video-fill.svg (../shared/zen-icons/lin/video-fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) @@ -351,9 +351,9 @@ skin/classic/browser/zen-icons/media-unmute.svg (../shared/zen-icons/lin/media-unmute.svg) skin/classic/browser/zen-icons/menu-bar.svg (../shared/zen-icons/lin/menu-bar.svg) skin/classic/browser/zen-icons/menu.svg (../shared/zen-icons/lin/menu.svg) - skin/classic/browser/zen-icons/microphone-blocked.fill.svg (../shared/zen-icons/lin/microphone-blocked.fill.svg) + skin/classic/browser/zen-icons/microphone-blocked-fill.svg (../shared/zen-icons/lin/microphone-blocked-fill.svg) skin/classic/browser/zen-icons/microphone-blocked.svg (../shared/zen-icons/lin/microphone-blocked.svg) - skin/classic/browser/zen-icons/microphone.fill.svg (../shared/zen-icons/lin/microphone.fill.svg) + skin/classic/browser/zen-icons/microphone-fill.svg (../shared/zen-icons/lin/microphone-fill.svg) skin/classic/browser/zen-icons/microphone.svg (../shared/zen-icons/lin/microphone.svg) skin/classic/browser/zen-icons/midi.svg (../shared/zen-icons/lin/midi.svg) skin/classic/browser/zen-icons/move-tab.svg (../shared/zen-icons/lin/move-tab.svg) @@ -403,10 +403,10 @@ skin/classic/browser/zen-icons/tracking-protection.svg (../shared/zen-icons/lin/tracking-protection.svg) skin/classic/browser/zen-icons/translations.svg (../shared/zen-icons/lin/translations.svg) skin/classic/browser/zen-icons/unpin.svg (../shared/zen-icons/lin/unpin.svg) - skin/classic/browser/zen-icons/video-blocked.fill.svg (../shared/zen-icons/lin/video-blocked.fill.svg) + skin/classic/browser/zen-icons/video-blocked-fill.svg (../shared/zen-icons/lin/video-blocked-fill.svg) skin/classic/browser/zen-icons/video-open.svg (../shared/zen-icons/lin/video-open.svg) skin/classic/browser/zen-icons/video-save.svg (../shared/zen-icons/lin/video-save.svg) - skin/classic/browser/zen-icons/video.fill.svg (../shared/zen-icons/lin/video.fill.svg) + skin/classic/browser/zen-icons/video-fill.svg (../shared/zen-icons/lin/video-fill.svg) skin/classic/browser/zen-icons/window.svg (../shared/zen-icons/lin/window.svg) skin/classic/browser/zen-icons/xr-blocked.svg (../shared/zen-icons/lin/xr-blocked.svg) skin/classic/browser/zen-icons/xr.svg (../shared/zen-icons/lin/xr.svg) diff --git a/src/browser/themes/shared/zen-icons/lin/microphone-blocked-fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone-blocked-fill.svg new file mode 100644 index 00000000..53cd4cd9 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/microphone-blocked-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg deleted file mode 100644 index ddf8675f..00000000 --- a/src/browser/themes/shared/zen-icons/lin/microphone-blocked.fill.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/browser/themes/shared/zen-icons/lin/microphone-fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone-fill.svg new file mode 100644 index 00000000..55692b81 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/microphone-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg b/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg deleted file mode 100644 index 4fb5cf62..00000000 --- a/src/browser/themes/shared/zen-icons/lin/microphone.fill.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/browser/themes/shared/zen-icons/lin/video-blocked-fill.svg b/src/browser/themes/shared/zen-icons/lin/video-blocked-fill.svg new file mode 100644 index 00000000..74f845dc --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/video-blocked-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg b/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg deleted file mode 100644 index e1032022..00000000 --- a/src/browser/themes/shared/zen-icons/lin/video-blocked.fill.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/video-fill.svg b/src/browser/themes/shared/zen-icons/lin/video-fill.svg new file mode 100644 index 00000000..87b2bf58 --- /dev/null +++ b/src/browser/themes/shared/zen-icons/lin/video-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/browser/themes/shared/zen-icons/lin/video.fill.svg b/src/browser/themes/shared/zen-icons/lin/video.fill.svg deleted file mode 100644 index 41f98195..00000000 --- a/src/browser/themes/shared/zen-icons/lin/video.fill.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file From a56aa7e30856cf63908a9a7abb810a26acb19141 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Sun, 13 Apr 2025 16:29:59 +0700 Subject: [PATCH 08/10] fix(MediaController): remove sharing state when hiding --- src/browser/base/zen-components/ZenMediaController.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index 968e8836..71317450 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -221,7 +221,8 @@ } ) .then(() => { - this.mediaControlBar.setAttribute('hidden', 'true'); + this.mediaControlBar.setAttribute('hidden', 'true') + this.mediaControlBar.removeAttribute('media-sharing'); gZenUIManager.updateTabsToolbar(); gZenUIManager.restoreScrollbarState(); }); @@ -235,7 +236,6 @@ if (this._currentMediaController.isBeingUsedInPIPModeOrFullscreen) return this.hideMediaControls(); this.updatePipButton(); - this.mediaControlBar.removeAttribute('media-sharing'); } const mediaInfoElements = [this.mediaTitle, this.mediaArtist]; From 87b0cee53ac8145be0a6790a4b1c626a00000397 Mon Sep 17 00:00:00 2001 From: Slowlife01 Date: Sun, 13 Apr 2025 16:35:41 +0700 Subject: [PATCH 09/10] chore: format --- src/browser/base/zen-components/ZenMediaController.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/base/zen-components/ZenMediaController.mjs b/src/browser/base/zen-components/ZenMediaController.mjs index 71317450..83f9d703 100644 --- a/src/browser/base/zen-components/ZenMediaController.mjs +++ b/src/browser/base/zen-components/ZenMediaController.mjs @@ -221,7 +221,7 @@ } ) .then(() => { - this.mediaControlBar.setAttribute('hidden', 'true') + this.mediaControlBar.setAttribute('hidden', 'true'); this.mediaControlBar.removeAttribute('media-sharing'); gZenUIManager.updateTabsToolbar(); gZenUIManager.restoreScrollbarState(); From 8a696ad0887241aa70e0b304ebb1a8cbf58ed53a Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sun, 13 Apr 2025 12:31:24 +0200 Subject: [PATCH 10/10] fix(ZenGlanceManager): update tab selection handling to remove sidebar highlight from previous tab --- src/browser/base/zen-components/ZenGlanceManager.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/base/zen-components/ZenGlanceManager.mjs b/src/browser/base/zen-components/ZenGlanceManager.mjs index ed0e4db4..6f89f764 100644 --- a/src/browser/base/zen-components/ZenGlanceManager.mjs +++ b/src/browser/base/zen-components/ZenGlanceManager.mjs @@ -464,8 +464,12 @@ this.#currentGlanceID = tab.getAttribute('glance-id'); if (gBrowser.selectedTab === this.#currentParentTab && this.#currentBrowser) { const curTab = this.#currentTab; + const prevTab = event.detail.previousTab; setTimeout(() => { gBrowser.selectedTab = curTab; + if (prevTab?.linkedBrowser) { + prevTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('deck-selected'); + } }, 0); } else if (gBrowser.selectedTab === this.#currentTab) { setTimeout(this.onLocationChangeOpenGlance.bind(this), 0);