diff --git a/build/windows/sign.ps1 b/build/windows/sign.ps1 index 1ca23ea34..4e0f345da 100644 --- a/build/windows/sign.ps1 +++ b/build/windows/sign.ps1 @@ -27,17 +27,10 @@ $token = gh auth token $env:SURFER_MOZCONFIG_ONLY="1" $env:SURFER_SIGNING_MODE="" -# Fetch SignIdentity from the github repo secrets, with the name SURFER_CERT_PATCH_ISSUER -$SignIdentityIssuer = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_ISSUER" -Headers @{Authorization = "Bearer $token"}).value -$SignIdentity = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_NAME" -Headers @{Authorization = "Bearer $token"}).value -$SignIndentityIssuerPrev = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_ISSUER_PREV" -Headers @{Authorization = "Bearer $token"}).value -$SignIdentityPrev = (Invoke-RestMethod -Uri "https://api.github.com/repos/zen-browser/desktop/actions/secrets/SURFER_CERT_PATCH_NAME_PREV" -Headers @{Authorization = "Bearer $token"}). - -$env:SURFER_CERT_PATCH_ISSUER=$SignIdentityIssuer -$env:SURFER_CERT_PATCH_NAME=$SignIdentity - -$env:SURFER_CERT_PATCH_NAME_PREV=$SignIdentityPrev -$env:SURFER_CERT_PATCH_ISSUER_PREV=$SignIndentityIssuerPrev +get-content "$PSScriptRoot/../.env" | foreach { + $name, $value = $_.split('=') + set-content env:\$name $value +} Start-Job -Name "DownloadGitl10n" -ScriptBlock { param($PWD) diff --git a/src/widget/gtk/nsDragService-cpp.patch b/src/widget/gtk/nsDragService-cpp.patch new file mode 100644 index 000000000..85e9760e3 --- /dev/null +++ b/src/widget/gtk/nsDragService-cpp.patch @@ -0,0 +1,29 @@ +diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp +index f760a6bb887b321376761431886c771f14fd03af..d52110ba52a95ef7c7bfb915e120b8dd636c9448 100644 +--- a/widget/gtk/nsDragService.cpp ++++ b/widget/gtk/nsDragService.cpp +@@ -23,6 +23,7 @@ + #include "mozilla/StaticPrefs_widget.h" + #include "mozilla/WidgetUtils.h" + #include "mozilla/WidgetUtilsGtk.h" ++#include "mozilla/nsZenDragAndDrop.h" + #include "nsAppShell.h" + #include "nsArrayUtils.h" + #include "nsCRT.h" +@@ -2304,11 +2305,15 @@ bool nsDragSession::SetAlphaPixmap(SourceSurface* aSurface, + cairo_image_surface_get_stride(surf), SurfaceFormat::B8G8R8A8); + if (!dt) return false; + ++ auto drag_translucency = DRAG_IMAGE_ALPHA_LEVEL; ++ if (auto zenDragAndDrop = zen::nsZenDragAndDrop::GetZenDragAndDropInstance()) { ++ drag_translucency = zenDragAndDrop->GetDragImageOpacity(); ++ } + dt->ClearRect(Rect(0, 0, dragRect.width, dragRect.height)); + dt->DrawSurface( + aSurface, Rect(0, 0, dragRect.width, dragRect.height), + Rect(0, 0, dragRect.width, dragRect.height), DrawSurfaceOptions(), +- DrawOptions(DRAG_IMAGE_ALPHA_LEVEL, CompositionOp::OP_SOURCE)); ++ DrawOptions(drag_translucency, CompositionOp::OP_SOURCE)); + + cairo_surface_mark_dirty(surf); + cairo_surface_set_device_offset(surf, -aXOffset, -aYOffset); diff --git a/src/zen/common/styles/zen-sidebar-notification.css b/src/zen/common/styles/zen-sidebar-notification.css index 2348e32a0..529224f72 100644 --- a/src/zen/common/styles/zen-sidebar-notification.css +++ b/src/zen/common/styles/zen-sidebar-notification.css @@ -78,13 +78,13 @@ } .zen-sidebar-notification-progress { - height: 2px; + height: 1px; overflow: hidden; transform: translateY(-1px); & .zen-sidebar-notification-progress-bar { height: 100%; - background: light-dark(color-mix(in srgb, var(--zen-primary-color) 50%, black), color-mix(in srgb, var(--zen-colors-primary) 15%, #ebebeb)); + background: light-dark(color-mix(in srgb, var(--zen-primary-color) 50%, black), color-mix(in srgb, var(--zen-colors-primary) 15%, transparent 10%, #6b6b6b)); transform-origin: left center; } } diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index c00e60543..355ba82a9 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -183,10 +183,10 @@ if (tabClone.hasAttribute("visuallyselected")) { tabClone.style.transform = "translate(-50%, -50%)"; } - } else if (AppConstants.platform !== "macosx" && !tab.isZenFolder) { - // On windows and linux, we still don't add some extra opaqueness - // for the tab to be more visible. This is a hacky workaround. - // TODO: Make windows and linux DnD use nsZenDragAndDrop::mDragImageOpacity + } else if (AppConstants.platform == "win" && !tab.isZenFolder) { + // On windows, the shell applies its own translucency to the drag + // image which we can't control, so force some extra contrast for + // the tab to be more visible. This is a hacky workaround. tabClone.style.colorScheme = "light"; tabClone.style.setProperty("--tab-selected-textcolor", "black"); } diff --git a/src/zen/sync/ZenSpacesSync.sys.mjs b/src/zen/sync/ZenSpacesSync.sys.mjs index f758c147a..e94e0c13d 100644 --- a/src/zen/sync/ZenSpacesSync.sys.mjs +++ b/src/zen/sync/ZenSpacesSync.sys.mjs @@ -81,6 +81,16 @@ class ZenSpacesSyncStore extends Store { * score is only bumped when something actually differs. */ class ZenSpacesSyncTracker extends Tracker { + _ignoreAll = false; + + get ignoreAll() { + return this._ignoreAll; + } + + set ignoreAll(value) { + this._ignoreAll = value; + } + onStart() { for (const topic of TRACKED_TOPICS) { Services.obs.addObserver(this, topic); @@ -94,6 +104,9 @@ class ZenSpacesSyncTracker extends Tracker { } observe(subject, topic) { + if (this.ignoreAll) { + return; + } if (topic !== SIDEBAR_COLLECTED_TOPIC) { ZenSpacesSyncModel.invalidate(); } diff --git a/src/zen/sync/ZenSpacesSyncModel.sys.mjs b/src/zen/sync/ZenSpacesSyncModel.sys.mjs index f419bdd2b..27167bfa9 100644 --- a/src/zen/sync/ZenSpacesSyncModel.sys.mjs +++ b/src/zen/sync/ZenSpacesSyncModel.sys.mjs @@ -152,6 +152,16 @@ class nsZenSpacesSyncModel { data.version = STORE_VERSION; data.uploaded ||= {}; data.containers ||= {}; + // The container map used to be keyed by guid. It is keyed by + // userContextId now so that registering a guid replaces any + // previous one for the same container. Flip old stores over + // (old values are numeric ids, new values are guid strings). + for (const [key, value] of Object.entries(data.containers)) { + if (typeof value === "number") { + delete data.containers[key]; + data.containers[value] = key; + } + } return data; }, }); @@ -175,16 +185,15 @@ class nsZenSpacesSyncModel { return `${BUILTIN_GUID_PREFIX}${id}`; } const data = this.#data(); - for (const [guid, mapped] of Object.entries(data.containers)) { - if (mapped === id) { - return guid; - } + const existing = data.containers[id]; + if (existing) { + return existing; } if (!create) { return null; } const guid = Services.uuid.generateUUID().toString().slice(1, -1); - data.containers[guid] = id; + data.containers[id] = guid; this.#file.saveSoon(); return guid; } @@ -199,22 +208,36 @@ class nsZenSpacesSyncModel { ? id : null; } - return this.#data().containers[guid] ?? null; + for (const [id, mapped] of Object.entries(this.#data().containers)) { + if (mapped === guid) { + return Number(id); + } + } + return null; } + /** + * Adopts an incoming guid as the identity's synced name. + * + * @param {string} guid + * @param {number} userContextId + */ registerContainerGuid(guid, userContextId) { if (guid.startsWith(BUILTIN_GUID_PREFIX)) { return; } - this.#data().containers[guid] = userContextId; + this.#data().containers[userContextId] = guid; this.#file.saveSoon(); } forgetContainerGuid(guid) { const data = this.#data(); - if (guid in data.containers) { - delete data.containers[guid]; - this.#file.saveSoon(); + for (const [id, mapped] of Object.entries(data.containers)) { + if (mapped === guid) { + delete data.containers[id]; + this.#file.saveSoon(); + return; + } } }