Compare commits

..

16 Commits

Author SHA1 Message Date
mr. m
5b685bc26d feat: Change default shortcut for unsynced windows, b=no-bug, c=windows, kbs 2026-01-24 15:34:46 +01:00
mr. m
6b255eabec feat: Fixed allowing folders to drop into normal tabs, b=no-bug, c=tabs 2026-01-24 08:58:36 +01:00
mr. m
1da0bed725 feat: Properly wait for session initialization event, b=no-bug, c=no-component 2026-01-23 23:19:43 +01:00
mr. m
a806bc7d0f fix: Fixed migration issue when clear history is enabled, b=closes #11993, c=flatpak, workspaces 2026-01-23 23:00:42 +01:00
mr. m
e0484d6fd6 feat: Limit the amount of displayed moving tabs we show, b=no-bug, c=common, tabs 2026-01-23 11:54:41 +01:00
mr. m
60a9463708 feat: Make split views visible when drag and dropping, b=no-bug, c=workspaces 2026-01-23 10:45:04 +01:00
mr. m
f476a62144 fix: Fixed not flushing the browsers correctly on quit grant and pinned icons not saving when the page didn't load, b=no-bug, c=common, kbs 2026-01-22 16:43:11 +01:00
mr. m
acd75771e1 feat: Have in mind we might have invalid drop elements when DnD, b=no-bug, c=no-component 2026-01-22 07:49:17 +01:00
mr. m
0d2667432c Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2026-01-21 21:33:32 +01:00
mr. m
9d70b1a9f6 feat: Improve drag and drop to handle perifery drag over, b=no-bug, c=tabs 2026-01-21 21:33:26 +01:00
Mr. M
7af6cae278 feat: Make sure to always store closed window data, b=no-bug, c=no-component 2026-01-21 18:20:51 +01:00
mr. m
51f7202b93 Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2026-01-21 14:00:00 +01:00
mr. m
c6c2a2fe5a fix: Fixed drag and drop not using the actual pointer location, b=no-bug, c=folders, tabs, workspaces 2026-01-21 13:59:52 +01:00
Moaed Yahia
116d70d08a fix: Prevent black flash when switching workspaces to split view, p=#11966 2026-01-21 07:26:26 +01:00
mr. m
fdf453d34e fix: Small fixes to tab aligment and dialog colors, b=no-bug, c=tabs, workspaces 2026-01-20 23:21:06 +01:00
mr. m
404fe069cd fix: Make sure to save the state of the last restored 'normal' window, b=no-bug, c=no-component 2026-01-20 15:34:00 +01:00
50 changed files with 426 additions and 189 deletions

View File

@@ -20,7 +20,6 @@ finish-args:
- --socket=cups - --socket=cups
- --persist=.zen - --persist=.zen
- --env=DICPATH=/usr/share/hunspell - --env=DICPATH=/usr/share/hunspell
- --filesystem=xdg-config/gtk-3.0:ro
- --filesystem=xdg-download:rw - --filesystem=xdg-download:rw
- --filesystem=/run/.heim_org.h5l.kcm-socket - --filesystem=/run/.heim_org.h5l.kcm-socket
- --filesystem=xdg-run/speech-dispatcher:ro - --filesystem=xdg-run/speech-dispatcher:ro

View File

@@ -148,7 +148,7 @@ function SignAndPackage($name) {
$env:WIN32_REDIST_DIR="$PWD\win-cross\vs2022\VC\Redist\MSVC\14.38.33135\x64\Microsoft.VC143.CRT" $env:WIN32_REDIST_DIR="$PWD\win-cross\vs2022\VC\Redist\MSVC\14.38.33135\x64\Microsoft.VC143.CRT"
} }
$env:MAR="..\\build\\winsign\\mar.exe" $env:MAR="..\\build\\windows\\mar.exe"
if ($name -eq "arm64") { if ($name -eq "arm64") {
$env:SURFER_COMPAT="aarch64" $env:SURFER_COMPAT="aarch64"
} else { } else {

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Commuta l'emmagatzematge
zen-devtools-toggle-dom-shortcut = Commuta el DOM zen-devtools-toggle-dom-shortcut = Commuta el DOM
zen-devtools-toggle-accessibility-shortcut = Commuta l'accessibilitat zen-devtools-toggle-accessibility-shortcut = Commuta l'accessibilitat
zen-close-all-unpinned-tabs-shortcut = Tanca totes les pestanyes no fixades zen-close-all-unpinned-tabs-shortcut = Tanca totes les pestanyes no fixades
zen-new-unsynced-window-shortcut = Nova finestra en blanc zen-new-unsynced-window-shortcut = Nova finestra no sincronitzada

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Fosca .label = Fosca
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nova finestra en blanc .label = New Blank Window

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Toglo Storio
zen-devtools-toggle-dom-shortcut = Toglo DOM zen-devtools-toggle-dom-shortcut = Toglo DOM
zen-devtools-toggle-accessibility-shortcut = Toglo Hygyrchedd zen-devtools-toggle-accessibility-shortcut = Toglo Hygyrchedd
zen-close-all-unpinned-tabs-shortcut = Cau Pob Tab Heb ei Binio zen-close-all-unpinned-tabs-shortcut = Cau Pob Tab Heb ei Binio
zen-new-unsynced-window-shortcut = Ffenestr Wag Newydd zen-new-unsynced-window-shortcut = Ffenestr Newydd Heb ei Chydweddu

View File

@@ -2,8 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
zen-panel-ui-current-profile-text = y proffil cyfredol zen-panel-ui-current-profile-text = proffil cyfredol
unified-extensions-description = Mae estyniadau'n cael ei defnyddio er mwyn ychwanegu fwy o swyddogaeth i { -brand-short-name }. unified-extensions-description = Mae ychwanegiadau'n cael ei defnyddio er mwyn ychwanegu fwy o weithrediadau i { -brand-short-name }.
tab-context-zen-reset-pinned-tab = tab-context-zen-reset-pinned-tab =
.label = Ailosod Tab wedi'i Binio .label = Ailosod Tab wedi'i Binio
.accesskey = A .accesskey = A
@@ -109,7 +109,7 @@ zen-sidebar-notification-updated-tooltip =
zen-sidebar-notification-restart-safe-mode-label = Rhywbeth wedi torri? zen-sidebar-notification-restart-safe-mode-label = Rhywbeth wedi torri?
zen-sidebar-notification-restart-safe-mode-tooltip = zen-sidebar-notification-restart-safe-mode-tooltip =
.title = Ailgychwyn yn y Modd Diogel .title = Ailgychwyn yn y Modd Diogel
zen-window-sync-migration-dialog-title = Cadw Eich Ffenestr Wedi'u Cydweddu zen-window-sync-migration-dialog-title = Keep Your Windows in Sync
zen-window-sync-migration-dialog-message = Mae Zen bellach yn cydweddu ffenestri ar yr un ddyfais, felly mae newidiadau mewn un ffenestr yn cael eu dangos ar y lleill yn syth. zen-window-sync-migration-dialog-message = Zen now syncs windows on the same device, so changes in one window are reflected across the others instantly.
zen-window-sync-migration-dialog-learn-more = Dysgu Rhagor zen-window-sync-migration-dialog-learn-more = Learn More
zen-window-sync-migration-dialog-accept = Iawn zen-window-sync-migration-dialog-accept = Got It

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Tywyll .label = Tywyll
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Ffenestr Wag Newydd .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Sombre .label = Sombre
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nouvelle fenêtre non synchronisée .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Dorcha .label = Dorcha
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Fuinneog Nua Bán .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = כהה .label = כהה
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = חלון ריק חדש .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Sötét .label = Sötét
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Új üres lap .label = New Blank Window

View File

@@ -49,8 +49,8 @@ zen-tabs-close-on-back-with-no-history =
zen-tabs-cycle-by-attribute = zen-tabs-cycle-by-attribute =
.label = Ctrl+Tab berputar hanya dalam tab Esensial atau Ruang Kerja .label = Ctrl+Tab berputar hanya dalam tab Esensial atau Ruang Kerja
zen-tabs-cycle-ignore-pending-tabs = zen-tabs-cycle-ignore-pending-tabs =
.label = Lewati tab tak termuat saat beralih dengan Ctrl+Tab .label = Ignore Pending tabs when cycling with Ctrl+Tab
zen-tabs-cycle-by-attribute-warning = Ctrl+Tab akan beralih berdasarkan urutan terakhir digunakan zen-tabs-cycle-by-attribute-warning = Ctrl+Tab will cycle by recently used order, as it is enabled
zen-look-and-feel-compact-toolbar-themed = zen-look-and-feel-compact-toolbar-themed =
.label = Gunakan latar belakang bertema untuk bilah atas dalam mode ringkas .label = Gunakan latar belakang bertema untuk bilah atas dalam mode ringkas
zen-workspace-continue-where-left-off = zen-workspace-continue-where-left-off =
@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Ubah Penyimpanan
zen-devtools-toggle-dom-shortcut = Ubah DOM zen-devtools-toggle-dom-shortcut = Ubah DOM
zen-devtools-toggle-accessibility-shortcut = Ubah Aksesibilitas zen-devtools-toggle-accessibility-shortcut = Ubah Aksesibilitas
zen-close-all-unpinned-tabs-shortcut = Tutup Semua Tab yang Tidak Disematkan zen-close-all-unpinned-tabs-shortcut = Tutup Semua Tab yang Tidak Disematkan
zen-new-unsynced-window-shortcut = Jendela Kosong Baru zen-new-unsynced-window-shortcut = New Unsynced Window

View File

@@ -60,8 +60,8 @@ zen-site-data-settings = Pengaturan
zen-generic-manage = Kelola zen-generic-manage = Kelola
zen-generic-more = Selengkapnya zen-generic-more = Selengkapnya
zen-generic-next = Lanjut zen-generic-next = Lanjut
zen-essentials-promo-label = Tambahkan ke Essentials zen-essentials-promo-label = Add to Essentials
zen-essentials-promo-sublabel = Akses tab favorit Anda hanya dengan sekali klik zen-essentials-promo-sublabel = Keep your favorite tabs just a click away
# These labels will be used for the site data panel settings # These labels will be used for the site data panel settings
zen-site-data-setting-allow = Diizinkan zen-site-data-setting-allow = Diizinkan
zen-site-data-setting-block = Diblokir zen-site-data-setting-block = Diblokir
@@ -109,7 +109,7 @@ zen-sidebar-notification-updated-tooltip =
zen-sidebar-notification-restart-safe-mode-label = Ada yang rusak? zen-sidebar-notification-restart-safe-mode-label = Ada yang rusak?
zen-sidebar-notification-restart-safe-mode-tooltip = zen-sidebar-notification-restart-safe-mode-tooltip =
.title = Mulai Ulang dalam Mode Aman .title = Mulai Ulang dalam Mode Aman
zen-window-sync-migration-dialog-title = Jaga Jendela Anda Tetap Sinkron zen-window-sync-migration-dialog-title = Keep Your Windows in Sync
zen-window-sync-migration-dialog-message = Zen kini menyinkronkan jendela pada perangkat yang sama, sehingga perubahan di satu jendela akan langsung terlihat di jendela lainnya. zen-window-sync-migration-dialog-message = Zen now syncs windows on the same device, so changes in one window are reflected across the others instantly.
zen-window-sync-migration-dialog-learn-more = Pelajari Lebih Lanjut zen-window-sync-migration-dialog-learn-more = Learn More
zen-window-sync-migration-dialog-accept = Oke! zen-window-sync-migration-dialog-accept = Got It

View File

@@ -4,19 +4,19 @@
zen-menubar-toggle-pinned-tabs = zen-menubar-toggle-pinned-tabs =
.label = .label =
{ $pinnedAreCollapsed -> { $pinnedAreCollapsed ->
[true] Perluas Tab yang Disematkan [true] Expand Pinned Tabs
*[false] Ciutkan Tab yang Disematkan *[false] Collapse Pinned Tabs
} }
zen-menubar-appearance = zen-menubar-appearance =
.label = Tampilan .label = Appearance
zen-menubar-appearance-description = zen-menubar-appearance-description =
.label = Situs web akan menggunakan: .label = Websites will use:
zen-menubar-appearance-auto = zen-menubar-appearance-auto =
.label = Otomatis .label = Automatic
zen-menubar-appearance-light = zen-menubar-appearance-light =
.label = Terang .label = Light
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Gelap .label = Dark
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Jendela Kosong Baru .label = New Blank Window

View File

@@ -4,13 +4,13 @@
zen-panel-ui-workspaces-text = Ruang Kerja Lainnya zen-panel-ui-workspaces-text = Ruang Kerja Lainnya
zen-panel-ui-spaces-label = zen-panel-ui-spaces-label =
.label = Ruang .label = Spaces
zen-panel-ui-workspaces-create = zen-panel-ui-workspaces-create =
.label = Buat Ruang .label = Buat Ruang
zen-panel-ui-folder-create = zen-panel-ui-folder-create =
.label = Buat Folder .label = Buat Folder
zen-panel-ui-new-empty-split = zen-panel-ui-new-empty-split =
.label = Split Baru .label = New Split
zen-workspaces-panel-context-delete = zen-workspaces-panel-context-delete =
.label = Hapus Ruang .label = Hapus Ruang
.accesskey = D .accesskey = D
@@ -66,6 +66,6 @@ zen-workspaces-close-all-unpinned-tabs-title =
.label = Bersihkan .label = Bersihkan
.tooltiptext = Tutup semua tab yang tidak disematkan .tooltiptext = Tutup semua tab yang tidak disematkan
zen-panel-ui-workspaces-change-forward = zen-panel-ui-workspaces-change-forward =
.label = Ruang Selanjutnya .label = Next Space
zen-panel-ui-workspaces-change-back = zen-panel-ui-workspaces-change-back =
.label = Ruang Sebelumnya .label = Previous Space

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Dökkt .label = Dökkt
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nýr auður gluggi .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = 다크 .label = 다크
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = 새 빈 창 .label = New Blank Window

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Perjungti saugyklą
zen-devtools-toggle-dom-shortcut = Perjungti DOM zen-devtools-toggle-dom-shortcut = Perjungti DOM
zen-devtools-toggle-accessibility-shortcut = Perjungti prieinamumą zen-devtools-toggle-accessibility-shortcut = Perjungti prieinamumą
zen-close-all-unpinned-tabs-shortcut = Užverti visas neprisegtas korteles zen-close-all-unpinned-tabs-shortcut = Užverti visas neprisegtas korteles
zen-new-unsynced-window-shortcut = Naujas tuščias langas zen-new-unsynced-window-shortcut = Naujas nesinchronizuotas langas

View File

@@ -60,8 +60,8 @@ zen-site-data-settings = Nustatymai
zen-generic-manage = Tvarkyti zen-generic-manage = Tvarkyti
zen-generic-more = Daugiau zen-generic-more = Daugiau
zen-generic-next = Sekantis zen-generic-next = Sekantis
zen-essentials-promo-label = Įtraukti į būtiniausius zen-essentials-promo-label = Add to Essentials
zen-essentials-promo-sublabel = Laikykite mėgstamas korteles vos nuo vienu paspaudimu zen-essentials-promo-sublabel = Keep your favorite tabs just a click away
# These labels will be used for the site data panel settings # These labels will be used for the site data panel settings
zen-site-data-setting-allow = Leidžiama zen-site-data-setting-allow = Leidžiama
zen-site-data-setting-block = Užblokuota zen-site-data-setting-block = Užblokuota
@@ -109,7 +109,7 @@ zen-sidebar-notification-updated-tooltip =
zen-sidebar-notification-restart-safe-mode-label = Kažkas sugedo? zen-sidebar-notification-restart-safe-mode-label = Kažkas sugedo?
zen-sidebar-notification-restart-safe-mode-tooltip = zen-sidebar-notification-restart-safe-mode-tooltip =
.title = Paleisti iš naujo saugioje režime .title = Paleisti iš naujo saugioje režime
zen-window-sync-migration-dialog-title = Išlaikykite savo langus sinchronizuotus zen-window-sync-migration-dialog-title = Keep Your Windows in Sync
zen-window-sync-migration-dialog-message = Zen“ dabar sinchronizuoja langus tame pačiame įrenginyje, todėl viename lange atlikti pakeitimai iš karto atsispindi ir kituose. zen-window-sync-migration-dialog-message = Zen now syncs windows on the same device, so changes in one window are reflected across the others instantly.
zen-window-sync-migration-dialog-learn-more = Sužinoti daugiau zen-window-sync-migration-dialog-learn-more = Learn More
zen-window-sync-migration-dialog-accept = Supratau zen-window-sync-migration-dialog-accept = Got It

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Tamsų .label = Tamsų
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Naujas tuščias langas .label = New Blank Window

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Escuro .label = Escuro
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nova janela em branco .label = New Blank Window

View File

@@ -18,9 +18,9 @@ tab-context-zen-replace-pinned-url-with-current =
.label = Substituir o URL Fixado pelo URL Atual .label = Substituir o URL Fixado pelo URL Atual
.accesskey = C .accesskey = C
tab-context-zen-edit-title = tab-context-zen-edit-title =
.label = Alterar etiqueta... .label = Change Label...
tab-context-zen-edit-icon = tab-context-zen-edit-icon =
.label = Alterar ícone... .label = Change Icon...
zen-themes-corrupted = O seu ficheiro de modificações do { -brand-short-name } está corrompido. Elas foram redefinidas como iguais às do tema padrão. zen-themes-corrupted = O seu ficheiro de modificações do { -brand-short-name } está corrompido. Elas foram redefinidas como iguais às do tema padrão.
zen-shortcuts-corrupted = O seu ficheiro de atalhos do { -brand-short-name } está corrompido. Eles foram redefinidos para os atalhos padrão. zen-shortcuts-corrupted = O seu ficheiro de atalhos do { -brand-short-name } está corrompido. Eles foram redefinidos para os atalhos padrão.
# note: Do not translate the "<br/>" tags in the following string # note: Do not translate the "<br/>" tags in the following string
@@ -109,7 +109,7 @@ zen-sidebar-notification-updated-tooltip =
zen-sidebar-notification-restart-safe-mode-label = Falhou alguma coisa? zen-sidebar-notification-restart-safe-mode-label = Falhou alguma coisa?
zen-sidebar-notification-restart-safe-mode-tooltip = zen-sidebar-notification-restart-safe-mode-tooltip =
.title = Reiniciar em Modo de Segurança .title = Reiniciar em Modo de Segurança
zen-window-sync-migration-dialog-title = Mantenha As Suas Janelas Sincronizadas zen-window-sync-migration-dialog-title = Keep Your Windows in Sync
zen-window-sync-migration-dialog-message = Agora, o Zen sincroniza as janelas no dispositivo, pelo que alterações numa janela são refletidas instantaneamente nas outras. zen-window-sync-migration-dialog-message = Zen now syncs windows on the same device, so changes in one window are reflected across the others instantly.
zen-window-sync-migration-dialog-learn-more = Learn More zen-window-sync-migration-dialog-learn-more = Learn More
zen-window-sync-migration-dialog-accept = Entendido zen-window-sync-migration-dialog-accept = Got It

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Escuro .label = Escuro
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nova janela sem sincronização .label = New Blank Window

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Переключить хранилище
zen-devtools-toggle-dom-shortcut = Переключить DOM zen-devtools-toggle-dom-shortcut = Переключить DOM
zen-devtools-toggle-accessibility-shortcut = Включить/выключить специальные возможности zen-devtools-toggle-accessibility-shortcut = Включить/выключить специальные возможности
zen-close-all-unpinned-tabs-shortcut = Закрыть все не закреплённые вкладки zen-close-all-unpinned-tabs-shortcut = Закрыть все не закреплённые вкладки
zen-new-unsynced-window-shortcut = Новое пустое окно zen-new-unsynced-window-shortcut = Новое несинхронизированное окно

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Växla lagring
zen-devtools-toggle-dom-shortcut = Växla DOM zen-devtools-toggle-dom-shortcut = Växla DOM
zen-devtools-toggle-accessibility-shortcut = Växla tillgänglighetsinställningar zen-devtools-toggle-accessibility-shortcut = Växla tillgänglighetsinställningar
zen-close-all-unpinned-tabs-shortcut = Stäng alla flikar som inte är fästa zen-close-all-unpinned-tabs-shortcut = Stäng alla flikar som inte är fästa
zen-new-unsynced-window-shortcut = Nytt tomt fönster zen-new-unsynced-window-shortcut = Nytt osynkroniserat fönster

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Mörkt .label = Mörkt
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Nytt tomt fönster .label = New Blank Window

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = Depolamayı Aç/Kapat
zen-devtools-toggle-dom-shortcut = DOM'u Aç/Kapat zen-devtools-toggle-dom-shortcut = DOM'u Aç/Kapat
zen-devtools-toggle-accessibility-shortcut = Erişilebilirliği Aç/Kapat zen-devtools-toggle-accessibility-shortcut = Erişilebilirliği Aç/Kapat
zen-close-all-unpinned-tabs-shortcut = Sabitlenmemiş Tüm Sekmeleri Kapat zen-close-all-unpinned-tabs-shortcut = Sabitlenmemiş Tüm Sekmeleri Kapat
zen-new-unsynced-window-shortcut = Yeni Boş Pencere zen-new-unsynced-window-shortcut = Senkronize Edilmemiş Yeni Pencere

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = Koyu .label = Koyu
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = Yeni Boş Pencere .label = New Blank Window

View File

@@ -314,4 +314,4 @@ zen-devtools-toggle-storage-shortcut = 開啟儲存空間檢測器
zen-devtools-toggle-dom-shortcut = 開啟 DOM zen-devtools-toggle-dom-shortcut = 開啟 DOM
zen-devtools-toggle-accessibility-shortcut = 開啟輔助功能 zen-devtools-toggle-accessibility-shortcut = 開啟輔助功能
zen-close-all-unpinned-tabs-shortcut = 關閉所有未釘選的分頁 zen-close-all-unpinned-tabs-shortcut = 關閉所有未釘選的分頁
zen-new-unsynced-window-shortcut = 開新初始視窗 zen-new-unsynced-window-shortcut = 開新未同步視窗

View File

@@ -19,4 +19,4 @@ zen-menubar-appearance-light =
zen-menubar-appearance-dark = zen-menubar-appearance-dark =
.label = 暗色 .label = 暗色
zen-menubar-new-unsynced-window = zen-menubar-new-unsynced-window =
.label = 新初始視窗 .label = 新初始視窗

View File

@@ -49,7 +49,7 @@ zen-panel-ui-gradient-click-to-add = 點擊新增顏色
zen-workspace-creation-name = zen-workspace-creation-name =
.placeholder = 工作區名稱 .placeholder = 工作區名稱
zen-move-tab-to-workspace-button = zen-move-tab-to-workspace-button =
.label = 移動至… .label = 移動至…
.tooltiptext = 將此視窗所有頁面移至單一工作區 .tooltiptext = 將此視窗所有頁面移至單一工作區
zen-workspaces-panel-context-reorder = zen-workspaces-panel-context-reorder =
.label = 排序工作區 .label = 排序工作區

View File

@@ -10,3 +10,6 @@
- name: zen.session-store.restore-unsynced-windows - name: zen.session-store.restore-unsynced-windows
value: true value: true
- name: browser.sessionstore.max_windows_undo
value: 2

View File

@@ -33,7 +33,7 @@
value: true value: true
- name: zen.workspaces.dnd-switch-padding - name: zen.workspaces.dnd-switch-padding
value: 4 value: 5
- name: zen.workspaces.debug - name: zen.workspaces.debug
value: "@cond" value: "@cond"

View File

@@ -30,7 +30,7 @@
value: 20 # Percentage of folder height to trigger dragover value: 20 # Percentage of folder height to trigger dragover
- name: zen.tabs.dnd-switch-space-delay - name: zen.tabs.dnd-switch-space-delay
value: 1000 # milliseconds value: 800 # milliseconds
- name: zen.ctrlTab.show-pending-tabs - name: zen.ctrlTab.show-pending-tabs
value: false value: false

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2e8fe19ff 100644 index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2f63071f78782dbc30bde25b3bcaa96faedf6f0b 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs --- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs +++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -127,6 +127,9 @@ const TAB_EVENTS = [ @@ -127,6 +127,9 @@ const TAB_EVENTS = [
@@ -54,6 +54,15 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
let tabbrowser = aWindow.gBrowser; let tabbrowser = aWindow.gBrowser;
// add tab change listeners to all already existing tabs // add tab change listeners to all already existing tabs
@@ -2076,7 +2085,7 @@ var SessionStoreInternal = {
let isTaskbarTab = this._windows[aWindow.__SSi].isTaskbarTab;
// A regular window is not a private window, taskbar tab window, or popup window
let isRegularWindow =
- !isPrivateWindow && !isTaskbarTab && aWindow.toolbar.visible;
+ !isPrivateWindow && !isTaskbarTab && aWindow.toolbar.visible && !this._windows[aWindow.__SSi].isZenUnsynced;
// perform additional initialization when the first window is loading
if (lazy.RunState.isStopped) {
@@ -2131,6 +2140,7 @@ var SessionStoreInternal = { @@ -2131,6 +2140,7 @@ var SessionStoreInternal = {
null, null,
"sessionstore-one-or-no-tab-restored" "sessionstore-one-or-no-tab-restored"
@@ -95,36 +104,56 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
TAB_EVENTS.forEach(function (aEvent) { TAB_EVENTS.forEach(function (aEvent) {
tabbrowser.tabContainer.removeEventListener(aEvent, this, true); tabbrowser.tabContainer.removeEventListener(aEvent, this, true);
@@ -2491,7 +2509,7 @@ var SessionStoreInternal = { @@ -2434,7 +2452,7 @@ var SessionStoreInternal = {
let isLastRegularWindow =
Object.values(this._windows).filter(
- wData => !wData.isPrivate && !wData.isTaskbarTab
+ wData => !wData.isPrivate && !wData.isTaskbarTab && !wData.isZenUnsynced
).length == 1;
this._log.debug(
`onClose, closing window isLastRegularWindow? ${isLastRegularWindow}`
@@ -2491,8 +2509,8 @@ var SessionStoreInternal = {
// 2) Flush the window. // 2) Flush the window.
// 3) When the flush is complete, revisit our decision to store the window // 3) When the flush is complete, revisit our decision to store the window
// in _closedWindows, and add/remove as necessary. // in _closedWindows, and add/remove as necessary.
- if (!winData.isPrivate && !winData.isTaskbarTab) { - if (!winData.isPrivate && !winData.isTaskbarTab) {
- this.maybeSaveClosedWindow(winData, isLastWindow);
+ if (!winData.isPrivate && !winData.isTaskbarTab && !winData.isZenUnsynced) { + if (!winData.isPrivate && !winData.isTaskbarTab && !winData.isZenUnsynced) {
this.maybeSaveClosedWindow(winData, isLastWindow); + this.maybeSaveClosedWindow(winData, isLastWindow, isLastRegularWindow);
} }
@@ -2512,7 +2530,8 @@ var SessionStoreInternal = { completionPromise = lazy.TabStateFlusher.flushWindow(aWindow).then(() => {
@@ -2512,8 +2530,9 @@ var SessionStoreInternal = {
// Save non-private windows if they have at // Save non-private windows if they have at
// least one saveable tab or are the last window. // least one saveable tab or are the last window.
- if (!winData.isPrivate && !winData.isTaskbarTab) { - if (!winData.isPrivate && !winData.isTaskbarTab) {
- this.maybeSaveClosedWindow(winData, isLastWindow);
+ lazy.ZenWindowSync.on_WindowCloseAndBrowserFlushed(browsers); + lazy.ZenWindowSync.on_WindowCloseAndBrowserFlushed(browsers);
+ if (!winData.isPrivate && !winData.isTaskbarTab && !winData.isZenUnsynced) { + if (!winData.isPrivate && !winData.isTaskbarTab && !winData.isZenUnsynced) {
this.maybeSaveClosedWindow(winData, isLastWindow); + this.maybeSaveClosedWindow(winData, isLastWindow, isLastRegularWindow);
if (!isLastWindow && winData.closedId > -1) { if (!isLastWindow && winData.closedId > -1) {
@@ -2608,6 +2627,9 @@ var SessionStoreInternal = { this._addClosedAction(
@@ -2589,7 +2608,7 @@ var SessionStoreInternal = {
* to call this method again asynchronously (for example, after
* a window flush).
*/
- maybeSaveClosedWindow(winData, isLastWindow) {
+ maybeSaveClosedWindow(winData, isLastWindow, isLastRegularWindow = false) {
// Make sure SessionStore is still running, and make sure that we
// haven't chosen to forget this window.
if (
@@ -2606,6 +2625,7 @@ var SessionStoreInternal = {
// _closedWindows from a previous call to this function.
let winIndex = this._closedWindows.indexOf(winData);
let alreadyStored = winIndex != -1; let alreadyStored = winIndex != -1;
+ lazy.ZenSessionStore.maybeSaveClosedWindow(winData, isLastRegularWindow);
// If sidebar command is truthy, i.e. sidebar is open, store sidebar settings // If sidebar command is truthy, i.e. sidebar is open, store sidebar settings
let shouldStore = hasSaveableTabs || isLastWindow; let shouldStore = hasSaveableTabs || isLastWindow;
+ lazy.ZenSessionStore.maybeSaveClosedWindow(winData, isLastWindow);
+ // TODO: Do we want to store closed Zen windows? All of them are synced anyways
+ shouldStore = false;
if (shouldStore && !alreadyStored) { @@ -3408,7 +3428,7 @@ var SessionStoreInternal = {
let index = this._closedWindows.findIndex(win => {
@@ -3408,7 +3430,7 @@ var SessionStoreInternal = {
if (!isPrivateWindow && tabState.isPrivate) { if (!isPrivateWindow && tabState.isPrivate) {
return; return;
} }
@@ -133,7 +162,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
return; return;
} }
@@ -4129,6 +4151,12 @@ var SessionStoreInternal = { @@ -4129,6 +4149,12 @@ var SessionStoreInternal = {
Math.min(tabState.index, tabState.entries.length) Math.min(tabState.index, tabState.entries.length)
); );
tabState.pinned = false; tabState.pinned = false;
@@ -146,7 +175,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
if (inBackground === false) { if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab; aWindow.gBrowser.selectedTab = newTab;
@@ -4565,6 +4593,8 @@ var SessionStoreInternal = { @@ -4565,6 +4591,8 @@ var SessionStoreInternal = {
// Append the tab if we're opening into a different window, // Append the tab if we're opening into a different window,
tabIndex: aSource == aTargetWindow ? pos : Infinity, tabIndex: aSource == aTargetWindow ? pos : Infinity,
pinned: state.pinned, pinned: state.pinned,
@@ -155,7 +184,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
userContextId: state.userContextId, userContextId: state.userContextId,
skipLoad: true, skipLoad: true,
preferredRemoteType, preferredRemoteType,
@@ -5414,7 +5444,7 @@ var SessionStoreInternal = { @@ -5414,7 +5442,7 @@ var SessionStoreInternal = {
for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) { for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) {
let tab = tabbrowser.tabs[i]; let tab = tabbrowser.tabs[i];
@@ -164,7 +193,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
removableTabs.push(tab); removableTabs.push(tab);
} }
} }
@@ -5525,7 +5555,7 @@ var SessionStoreInternal = { @@ -5525,7 +5553,7 @@ var SessionStoreInternal = {
// collect the data for all windows // collect the data for all windows
for (ix in this._windows) { for (ix in this._windows) {
@@ -173,7 +202,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
// window data is still in _statesToRestore // window data is still in _statesToRestore
continue; continue;
} }
@@ -5668,11 +5698,12 @@ var SessionStoreInternal = { @@ -5668,11 +5696,12 @@ var SessionStoreInternal = {
} }
let tabbrowser = aWindow.gBrowser; let tabbrowser = aWindow.gBrowser;
@@ -187,7 +216,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
// update the internal state data for this window // update the internal state data for this window
for (let tab of tabs) { for (let tab of tabs) {
if (tab == aWindow.FirefoxViewHandler.tab) { if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -5683,6 +5714,9 @@ var SessionStoreInternal = { @@ -5683,6 +5712,9 @@ var SessionStoreInternal = {
tabsData.push(tabData); tabsData.push(tabData);
} }
@@ -197,7 +226,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
// update tab group state for this window // update tab group state for this window
winData.groups = []; winData.groups = [];
for (let tabGroup of aWindow.gBrowser.tabGroups) { for (let tabGroup of aWindow.gBrowser.tabGroups) {
@@ -5695,7 +5729,7 @@ var SessionStoreInternal = { @@ -5695,7 +5727,7 @@ var SessionStoreInternal = {
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab, // a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected). // since it's only inserted into the tab strip after it's selected).
if (aWindow.FirefoxViewHandler.tab?.selected) { if (aWindow.FirefoxViewHandler.tab?.selected) {
@@ -206,7 +235,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
winData.title = tabbrowser.tabs[0].label; winData.title = tabbrowser.tabs[0].label;
} }
winData.selected = selectedIndex; winData.selected = selectedIndex;
@@ -5810,8 +5844,8 @@ var SessionStoreInternal = { @@ -5810,8 +5842,8 @@ var SessionStoreInternal = {
// selectTab represents. // selectTab represents.
let selectTab = 0; let selectTab = 0;
if (overwriteTabs) { if (overwriteTabs) {
@@ -217,7 +246,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
selectTab = Math.min(selectTab, winData.tabs.length); selectTab = Math.min(selectTab, winData.tabs.length);
} }
@@ -5833,6 +5867,7 @@ var SessionStoreInternal = { @@ -5833,6 +5865,7 @@ var SessionStoreInternal = {
if (overwriteTabs) { if (overwriteTabs) {
for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) { for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) {
if (!tabbrowser.tabs[i].selected) { if (!tabbrowser.tabs[i].selected) {
@@ -225,7 +254,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
tabbrowser.removeTab(tabbrowser.tabs[i]); tabbrowser.removeTab(tabbrowser.tabs[i]);
} }
} }
@@ -5866,6 +5901,12 @@ var SessionStoreInternal = { @@ -5866,6 +5899,12 @@ var SessionStoreInternal = {
savedTabGroup => !openTabGroupIdsInWindow.has(savedTabGroup.id) savedTabGroup => !openTabGroupIdsInWindow.has(savedTabGroup.id)
); );
} }
@@ -238,7 +267,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
// Move the originally open tabs to the end. // Move the originally open tabs to the end.
if (initialTabs) { if (initialTabs) {
@@ -6419,6 +6460,25 @@ var SessionStoreInternal = { @@ -6419,6 +6458,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring // Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events. // attributes that may trigger external events.
@@ -264,7 +293,17 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
if (tabData.pinned) { if (tabData.pinned) {
tabbrowser.pinTab(tab); tabbrowser.pinTab(tab);
@@ -7343,7 +7403,7 @@ var SessionStoreInternal = { @@ -6567,6 +6625,9 @@ var SessionStoreInternal = {
aWindow.gURLBar.readOnly = false;
}
}
+ if (aWinData.isZenUnsynced) {
+ this._windows[aWindow.__SSi].isZenUnsynced = true;
+ }
let promiseParts = Promise.withResolvers();
aWindow.setTimeout(() => {
@@ -7343,7 +7404,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map(); let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) { for (let tIndex = 0; tIndex < window.tabs.length; ) {
@@ -273,7 +312,7 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..cd350d9e787c1ef0d1dffcb7d872b9c2
// Adjust window.selected // Adjust window.selected
if (tIndex + 1 < window.selected) { if (tIndex + 1 < window.selected) {
window.selected -= 1; window.selected -= 1;
@@ -7358,7 +7418,7 @@ var SessionStoreInternal = { @@ -7358,7 +7419,7 @@ var SessionStoreInternal = {
); );
// We don't want to increment tIndex here. // We don't want to increment tIndex here.
continue; continue;

View File

@@ -1,5 +1,5 @@
diff --git a/browser/themes/shared/tabbrowser/content-area.css b/browser/themes/shared/tabbrowser/content-area.css diff --git a/browser/themes/shared/tabbrowser/content-area.css b/browser/themes/shared/tabbrowser/content-area.css
index b00139d7af878326ff303c08d5ddd47501b8c7db..52bad3e978004f3322f3d504cbd663e7b620b69f 100644 index b00139d7af878326ff303c08d5ddd47501b8c7db..7361a5e98d6ea372f6fdc583d90044d276cfb81b 100644
--- a/browser/themes/shared/tabbrowser/content-area.css --- a/browser/themes/shared/tabbrowser/content-area.css
+++ b/browser/themes/shared/tabbrowser/content-area.css +++ b/browser/themes/shared/tabbrowser/content-area.css
@@ -90,7 +90,6 @@ @@ -90,7 +90,6 @@
@@ -32,7 +32,7 @@ index b00139d7af878326ff303c08d5ddd47501b8c7db..52bad3e978004f3322f3d504cbd663e7
.dialogOverlay[topmost="true"], .dialogOverlay[topmost="true"],
#window-modal-dialog::backdrop { #window-modal-dialog::backdrop {
- background-color: var(--dialog-backdrop-color); - background-color: var(--dialog-backdrop-color);
+ background-color: light-dark(rgba(255, 255, 255, .2), rgba(0, 0, 0, .2)); + background-color: light-dark(rgba(255, 255, 255, .3), rgba(0, 0, 0, .3));
} }
.dialogOverlay[hideContent="true"][topmost="true"] { .dialogOverlay[hideContent="true"][topmost="true"] {

View File

@@ -24,6 +24,7 @@ export class nsZenMenuBar {
this.#initViewMenu(); this.#initViewMenu();
this.#initSpacesMenu(); this.#initSpacesMenu();
this.#initAppMenu(); this.#initAppMenu();
this.#hideWindowRestoreMenus();
} }
#initViewMenu() { #initViewMenu() {
@@ -121,4 +122,12 @@ export class nsZenMenuBar {
command="cmd_zenNewNavigatorUnsynced"/>`) command="cmd_zenNewNavigatorUnsynced"/>`)
); );
} }
#hideWindowRestoreMenus() {
const itemsToHide = ["appMenuRecentlyClosedWindows", "historyUndoWindowMenu"];
for (const id of itemsToHide) {
const element = PanelMultiView.getViewNode(document, id);
element.setAttribute("hidden", "true");
}
}
} }

View File

@@ -142,7 +142,7 @@
--zen-toolbar-element-bg: light-dark( --zen-toolbar-element-bg: light-dark(
color-mix(in oklch, var(--toolbox-textcolor) 10%, transparent), color-mix(in oklch, var(--toolbox-textcolor) 10%, transparent),
color-mix(in oklch, var(--toolbox-textcolor) 12.5%, transparent) color-mix(in oklch, var(--toolbox-textcolor) 15%, transparent)
); );
--zen-toolbar-element-bg-hover: light-dark( --zen-toolbar-element-bg-hover: light-dark(

View File

@@ -39,6 +39,7 @@
!element || !element ||
element.closest(".zen-current-workspace-indicator") || element.closest(".zen-current-workspace-indicator") ||
element.hasAttribute("split-view-group") || element.hasAttribute("split-view-group") ||
element.classList.contains("zen-drop-target") ||
isEssentialsPromo(element) isEssentialsPromo(element)
) { ) {
return element; return element;
@@ -52,6 +53,9 @@
if (isTabGroupLabel(element)) { if (isTabGroupLabel(element)) {
return element.closest(".tab-group-label-container"); return element.closest(".tab-group-label-container");
} }
if (gBrowser.isTabGroup(element)) {
return element.labelContainerElement;
}
throw new Error(`Element "${element.tagName}" is not expected to move`); throw new Error(`Element "${element.tagName}" is not expected to move`);
}; };
@@ -111,7 +115,7 @@
const { offsetX, offsetY } = this.#getDragImageOffset(event, tab, draggingTabs); const { offsetX, offsetY } = this.#getDragImageOffset(event, tab, draggingTabs);
const dragImage = this.#createDragImageForTabs(draggingTabs); const dragImage = this.#createDragImageForTabs(draggingTabs);
this.originalDragImageArgs = [dragImage, offsetX, offsetY]; this.originalDragImageArgs = [dragImage, offsetX, offsetY];
dt.updateDragImage(...this.originalDragImageArgs); dt.setDragImage(...this.originalDragImageArgs);
if (tab.hasAttribute("zen-essential")) { if (tab.hasAttribute("zen-essential")) {
setTimeout(() => { setTimeout(() => {
tab.style.visibility = "hidden"; tab.style.visibility = "hidden";
@@ -125,18 +129,28 @@
); );
const tabRect = window.windowUtils.getBoundsWithoutFlushing(movingTabs[0]); const tabRect = window.windowUtils.getBoundsWithoutFlushing(movingTabs[0]);
const wrapper = document.createElement("div"); const wrapper = document.createElement("div");
let movingTabsCount = Math.min(movingTabs.length, 3);
wrapper.style.width = tabRect.width + "px"; wrapper.style.width = tabRect.width + "px";
wrapper.style.height = tabRect.height * movingTabs.length + "px"; wrapper.style.height = tabRect.height * movingTabsCount + "px";
wrapper.style.position = "fixed"; wrapper.style.position = "fixed";
wrapper.style.top = "-9999px"; wrapper.style.top = "-9999px";
periphery.appendChild(wrapper); periphery.appendChild(wrapper);
for (let i = 0; i < movingTabs.length; i++) { for (let i = 0; i < movingTabsCount; i++) {
const tab = movingTabs[i]; const tab = movingTabs[i];
const tabClone = tab.cloneNode(true); const tabClone = tab.cloneNode(true);
if (tab.hasAttribute("zen-essential")) { if (tab.hasAttribute("zen-essential")) {
const rect = tab.getBoundingClientRect(); const rect = tab.getBoundingClientRect();
tabClone.style.minWidth = tabClone.style.maxWidth = `${rect.width}px`; tabClone.style.minWidth = tabClone.style.maxWidth = `${rect.width}px`;
tabClone.style.minHeight = tabClone.style.maxHeight = `${rect.height}px`; tabClone.style.minHeight = tabClone.style.maxHeight = `${rect.height}px`;
if (tabClone.hasAttribute("visuallyselected")) {
tabClone.style.transform = "translate(-50%, -50%)";
}
} else if (AppConstants.platform !== "macosx") {
// 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
tabClone.style.colorScheme = "light";
tabClone.style.color = "black";
} }
if (i > 0) { if (i > 0) {
tabClone.style.transform = `translate(${i * 4}px, -${i * (tabRect.height - 4)}px)`; tabClone.style.transform = `translate(${i * 4}px, -${i * (tabRect.height - 4)}px)`;
@@ -150,6 +164,13 @@
const label = tabClone.textLabel; const label = tabClone.textLabel;
const tabLabelParentWidth = label.parentElement.getBoundingClientRect().width; const tabLabelParentWidth = label.parentElement.getBoundingClientRect().width;
label.textContent = label.textContent.slice(0, Math.floor(tabLabelParentWidth / 6)); label.textContent = label.textContent.slice(0, Math.floor(tabLabelParentWidth / 6));
} else if (gBrowser.isTabGroup(tabClone) && tabClone.hasAttribute("split-view-group")) {
let tabs = tab.tabs;
for (let j = 0; j < tabs.length; j++) {
const tabInGroup = tabs[j];
const tabInGroupClone = tabInGroup.cloneNode(true);
tabClone.appendChild(tabInGroupClone);
}
} }
} }
this.#maybeCreateDragImageDot(movingTabs, wrapper); this.#maybeCreateDragImageDot(movingTabs, wrapper);
@@ -197,12 +218,7 @@
? dragData.screenY ? dragData.screenY
: dragData.screenX; : dragData.screenX;
let allTabs = this._tabbrowserTabs.ariaFocusableItems; let allTabs = this._tabbrowserTabs.ariaFocusableItems;
let numEssentials = gBrowser._numZenEssentials; let tabs = allTabs;
let isEssential = draggedTab.hasAttribute("zen-essential");
let tabs = allTabs.slice(
isEssential ? 0 : numEssentials,
isEssential ? numEssentials : undefined
);
if (!tabs.length) { if (!tabs.length) {
tabs = [...movingTabs]; tabs = [...movingTabs];
} }
@@ -235,7 +251,9 @@
dragData.translateY = translateY; dragData.translateY = translateY;
// Move the dragged tab based on the mouse position. // Move the dragged tab based on the mouse position.
let periphery = document.getElementById("tabbrowser-arrowscrollbox-periphery"); let periphery = gZenWorkspaces.activeWorkspaceElement.querySelector(
"#tabbrowser-arrowscrollbox-periphery"
);
let lastMovingTab = movingTabs.at(-1); let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0]; let firstMovingTab = movingTabs[0];
let endEdge = (ele) => ele[screenAxis] + bounds(ele)[size]; let endEdge = (ele) => ele[screenAxis] + bounds(ele)[size];
@@ -452,9 +470,7 @@
// 4) we just started dragging and the `oldDropElementIndex` has its default // 4) we just started dragging and the `oldDropElementIndex` has its default
// valuë of `movingTabs[0].elementIndex`. In this case, the drop element // valuë of `movingTabs[0].elementIndex`. In this case, the drop element
// shouldn't be a moving tab, so keep it `undefined`. // shouldn't be a moving tab, so keep it `undefined`.
let lastPossibleDropElement = this._rtlMode let lastPossibleDropElement = this._rtlMode ? tabs.find((t) => t != draggedTab) : undefined;
? tabs.find((t) => t != draggedTab)
: tabs.findLast((t) => t != draggedTab);
let maxElementIndexForDropElement = lastPossibleDropElement?.elementIndex; let maxElementIndexForDropElement = lastPossibleDropElement?.elementIndex;
if (Number.isInteger(maxElementIndexForDropElement)) { if (Number.isInteger(maxElementIndexForDropElement)) {
let index = Math.min(oldDropElementIndex, maxElementIndexForDropElement); let index = Math.min(oldDropElementIndex, maxElementIndexForDropElement);
@@ -521,7 +537,7 @@
[dropBefore, dropElement] = this.#applyDragoverIndicator( [dropBefore, dropElement] = this.#applyDragoverIndicator(
event, event,
tabs, dropElement,
movingTabs, movingTabs,
draggedTab draggedTab
) ?? [dropBefore, dropElement]; ) ?? [dropBefore, dropElement];
@@ -608,12 +624,30 @@
if (!this.#changeSpaceTimer) { if (!this.#changeSpaceTimer) {
this.#changeSpaceTimer = setTimeout(() => { this.#changeSpaceTimer = setTimeout(() => {
this.clearDragOverVisuals(); this.clearDragOverVisuals();
dt.updateDragImage(...this.originalDragImageArgs); gZenWorkspaces
gZenWorkspaces.changeWorkspaceShortcut( .changeWorkspaceShortcut(isNearLeftEdge ? -1 : 1, false, /* Disable wrapping */ true)
isNearLeftEdge ? -1 : 1, .then((spaceChanged) => {
false, if (AppConstants.platform !== "macosx") {
/* Disable wrapping */ true // See the hack in #createDragImageForTabs for more details which
); // explains why we need to do this on non-macOS platforms.
return;
}
let tabs = this.originalDragImageArgs[0].children;
const { isDarkMode, isExplicitMode } =
gZenThemePicker.getGradientForWorkspace(spaceChanged);
for (let tab of tabs) {
if (isExplicitMode) {
tab.style.colorScheme = isDarkMode ? "dark" : "light";
} else {
tab.style.colorScheme = "";
}
}
requestAnimationFrame(() => {
requestAnimationFrame(() => {
dt.updateDragImage(...this.originalDragImageArgs);
});
});
});
this.#changeSpaceTimer = null; this.#changeSpaceTimer = null;
}, this._dndSwitchSpaceDelay); }, this._dndSwitchSpaceDelay);
} }
@@ -678,6 +712,7 @@
handle_drop(event) { handle_drop(event) {
this.clearSpaceSwitchTimer(); this.clearSpaceSwitchTimer();
gZenFolders.highlightGroupOnDragOver(null);
super.handle_drop(event); super.handle_drop(event);
this.#maybeClearVerticalPinnedGridDragOver(); this.#maybeClearVerticalPinnedGridDragOver();
const dt = event.dataTransfer; const dt = event.dataTransfer;
@@ -705,7 +740,10 @@
if (isTabGroupLabel(dropElement)) { if (isTabGroupLabel(dropElement)) {
dropElement = dropElement.group; dropElement = dropElement.group;
} }
if (isTabGroupLabel(draggedTab)) { if (
isTabGroupLabel(draggedTab) ||
(isTab(draggedTab) && draggedTab.group?.hasAttribute("split-view-group"))
) {
draggedTab = draggedTab.group; draggedTab = draggedTab.group;
} }
for (let item of this._tabbrowserTabs.ariaFocusableItems) { for (let item of this._tabbrowserTabs.ariaFocusableItems) {
@@ -817,6 +855,9 @@
if (currentEssenialContainer?.essentialsPromo) { if (currentEssenialContainer?.essentialsPromo) {
currentEssenialContainer.essentialsPromo.remove(); currentEssenialContainer.essentialsPromo.remove();
} }
// We also call it here to ensure we clear any highlight if the drop happened
// outside of a valid drop target.
gZenFolders.highlightGroupOnDragOver(null);
this.ZenDragAndDropService.onDragEnd(); this.ZenDragAndDropService.onDragEnd();
super.handle_dragend(event); super.handle_dragend(event);
this.#removeDragOverBackground(); this.#removeDragOverBackground();
@@ -872,35 +913,26 @@
} }
// eslint-disable-next-line complexity // eslint-disable-next-line complexity
#applyDragoverIndicator(event, tabs, movingTabs, draggedTab) { #applyDragoverIndicator(event, dropElement, movingTabs, draggedTab) {
const separation = 4; const separation = 4;
const dropZoneSelector = const dropZoneSelector = ":is(.zen-drop-target)";
":is(.tabbrowser-tab, .zen-drop-target, .tab-group-label, tab-group[split-view-group])";
let shouldPlayHapticFeedback = false; let shouldPlayHapticFeedback = false;
let showIndicatorUnderNewTabButton = false; let showIndicatorUnderNewTabButton = false;
let dropBefore = false; let dropBefore = false;
let dropElement = event.target.closest(dropZoneSelector); let dropElementFromEvent = event.target.closest(dropZoneSelector);
if (!dropElement) { dropElement = dropElementFromEvent || dropElement;
if (event.target.classList.contains("zen-workspace-empty-space")) { if (!dropElementFromEvent) {
dropElement = this._tabbrowserTabs.ariaFocusableItems.at(-1); let hoveringPeriphery = !!event.target.closest("#tabbrowser-arrowscrollbox-periphery");
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
let lastTab = gBrowser.tabs.at(-1);
dropElement =
(hoveringPeriphery
? this._tabbrowserTabs.ariaFocusableItems.at(
gBrowser._numVisiblePinTabsWithoutCollapsed
)
: this._tabbrowserTabs.ariaFocusableItems.at(-1)) || lastTab;
// Only if there are no normal tabs to drop after // Only if there are no normal tabs to drop after
showIndicatorUnderNewTabButton = showIndicatorUnderNewTabButton = lastTab.hasAttribute("zen-empty-tab");
gBrowser.tabs[gBrowser.tabs.length - 1].hasAttribute("zen-empty-tab");
} else {
const numEssentials = gBrowser._numZenEssentials;
const numPinned = gBrowser.pinnedTabCount - numEssentials;
const tabToUse =
event.target.closest(dropZoneSelector) || draggedTab._dragData?.dropElement;
if (!tabToUse) {
return null;
}
const isPinned = tabToUse.pinned;
const relativeTabs = tabs.slice(
isPinned ? 0 : numPinned,
isPinned ? numPinned : undefined
);
const draggedTabRect = elementToMove(tabToUse).getBoundingClientRect();
dropElement = event.clientY > draggedTabRect.top ? relativeTabs.at(-1) : relativeTabs[0];
} }
} }
dropElement = elementToMove(dropElement); dropElement = elementToMove(dropElement);
@@ -909,24 +941,47 @@
shouldPlayHapticFeedback = this.#lastDropTarget !== null; shouldPlayHapticFeedback = this.#lastDropTarget !== null;
this.#removeDragOverBackground(); this.#removeDragOverBackground();
} }
let isZenFolder = dropElement.parentElement?.isZenFolder; if (!dropElement) {
let dragData = draggedTab._dragData;
dropElement = dragData.dropElement;
dropBefore = dragData.dropBefore;
}
if (!dropElement) {
this.clearDragOverVisuals();
return null;
}
if (dropElement.hasAttribute("zen-empty-tab") && dropElement.group) {
let secondTab = dropElement.group.tabs[1];
dropElement = secondTab || dropElement.group.labelContainerElement;
if (secondTab) {
dropBefore = true;
}
}
let possibleFolderElement = dropElement.parentElement;
let isZenFolder = possibleFolderElement?.isZenFolder;
let canHightlightGroup = let canHightlightGroup =
gZenFolders.highlightGroupOnDragOver(dropElement.parentElement, movingTabs) || !isZenFolder; gZenFolders.highlightGroupOnDragOver(possibleFolderElement, movingTabs) || !isZenFolder;
let rect = window.windowUtils.getBoundsWithoutFlushing(dropElement); let rect = window.windowUtils.getBoundsWithoutFlushing(dropElement);
const overlapPercent = (event.clientY - rect.top) / rect.height; const overlapPercent = (event.clientY - rect.top) / rect.height;
// We wan't to leave a small threshold (20% for example) so we can drag tabs below and above // We wan't to leave a small threshold (20% for example) so we can drag tabs below and above
// a folder label without dragging into the folder. // a folder label without dragging into the folder.
let threshold = Services.prefs.getIntPref("zen.tabs.folder-dragover-threshold-percent") / 100; let threshold = Services.prefs.getIntPref("zen.tabs.folder-dragover-threshold-percent") / 100;
let dropIntoFolder = let dropIntoFolder =
isZenFolder && (overlapPercent < threshold || overlapPercent > 1 - threshold); isZenFolder &&
(overlapPercent < threshold ||
(overlapPercent > 1 - threshold &&
(possibleFolderElement.collapsed ||
possibleFolderElement.childGroupsAndTabs.length < 2)));
if ( if (
isTabGroupLabel(draggedTab) && (isTabGroupLabel(draggedTab) &&
draggedTab.group?.isZenFolder && draggedTab.group?.isZenFolder &&
(isTab(dropElement) || dropElement.hasAttribute("split-view-group")) && (isTab(dropElement) || dropElement.hasAttribute("split-view-group")) &&
(!dropElement.pinned || dropElement.hasAttribute("zen-essential")) (!dropElement.pinned || dropElement.hasAttribute("zen-essential"))) ||
showIndicatorUnderNewTabButton
) { ) {
dropElement = null;
this.clearDragOverVisuals(); this.clearDragOverVisuals();
return null; return [dropElement, dropBefore];
} }
if ( if (
isTab(dropElement) || isTab(dropElement) ||
@@ -941,7 +996,7 @@
let top = 0; let top = 0;
threshold = threshold =
Services.prefs.getIntPref("browser.tabs.dragDrop.moveOverThresholdPercent") / 100; Services.prefs.getIntPref("browser.tabs.dragDrop.moveOverThresholdPercent") / 100;
if (overlapPercent > threshold) { if (overlapPercent > threshold || showIndicatorUnderNewTabButton) {
top = Math.round(rect.top + rect.height) + "px"; top = Math.round(rect.top + rect.height) + "px";
dropBefore = false; dropBefore = false;
} else { } else {

View File

@@ -1134,11 +1134,10 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
* @param {MozTabbrowserTabGroup|undefined|null} folder The folder to highlight, or null to clear highlight. * @param {MozTabbrowserTabGroup|undefined|null} folder The folder to highlight, or null to clear highlight.
* @param {Array<MozTabbrowserTab>|null} movingTabs The tabs being moved. * @param {Array<MozTabbrowserTab>|null} movingTabs The tabs being moved.
*/ */
highlightGroupOnDragOver(folder, movingTabs) { highlightGroupOnDragOver(folder, movingTabs = null) {
if (folder === this.#lastHighlightedGroup) { if (folder === this.#lastHighlightedGroup) {
return true; return true;
} }
const tab = movingTabs ? movingTabs[0] : null;
if (this.#lastHighlightedGroup && this.#lastHighlightedGroup !== folder) { if (this.#lastHighlightedGroup && this.#lastHighlightedGroup !== folder) {
if (this.#lastHighlightedGroup.collapsed) { if (this.#lastHighlightedGroup.collapsed) {
this.updateFolderIcon(this.#lastHighlightedGroup, "close"); this.updateFolderIcon(this.#lastHighlightedGroup, "close");
@@ -1148,7 +1147,6 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
if ( if (
folder?.isZenFolder && folder?.isZenFolder &&
(!folder.hasAttribute("split-view-group") || !folder.hasAttribute("selected")) && (!folder.hasAttribute("split-view-group") || !folder.hasAttribute("selected")) &&
folder !== tab?.group &&
!( !(
folder.level >= this.#ZEN_MAX_SUBFOLDERS && folder.level >= this.#ZEN_MAX_SUBFOLDERS &&
movingTabs?.some((t) => gBrowser.isTabGroupLabel(t)) movingTabs?.some((t) => gBrowser.isTabGroupLabel(t))

View File

@@ -123,11 +123,11 @@ zen-folder {
} }
&[state="open"] .back { &[state="open"] .back {
transform: skewX(16deg) translate(-2px, 3.4px) scale(0.85); transform: skewX(16deg) translate(-4px, 2px) scale(0.85);
} }
&[state="open"] :is(.front, .dots, .icon) { &[state="open"] :is(.front, .dots, .icon) {
transform: skewX(-16deg) translate(11.1px, 3.4px) scale(0.85); transform: skewX(-16deg) translate(8px, 2px) scale(0.85);
} }
& .icon { & .icon {

View File

@@ -506,6 +506,10 @@ class KeyShortcut {
return this.#disabled; return this.#disabled;
} }
setDisabled(value) {
this.#disabled = value;
}
isReserved() { isReserved() {
return this.#reserved; return this.#reserved;
} }
@@ -1112,19 +1116,27 @@ class nsZenKeyboardShortcutsVersioner {
"N", "N",
"", "",
ZEN_OTHER_SHORTCUTS_GROUP, ZEN_OTHER_SHORTCUTS_GROUP,
AppConstants.platform === "win" nsKeyShortcutModifiers.fromObject({ accel: true, shift: true }),
? nsKeyShortcutModifiers.fromObject({ alt: true })
: nsKeyShortcutModifiers.fromObject({ accel: true, alt: true }),
"cmd_zenNewNavigatorUnsynced", "cmd_zenNewNavigatorUnsynced",
"zen-new-unsynced-window-shortcut" "zen-new-unsynced-window-shortcut"
) )
); );
// Also, change the default for new empty split from + to * on mac // Also, change the default for new empty split from + to * on mac
// and disable the "Restore closed window" shortcut by default due to conflicts
let emptySplitFound = false,
undoCloseWindowFound = false;
for (let shortcut of data) { for (let shortcut of data) {
if (shortcut.getID() == "zen-new-empty-split-view" && AppConstants.platform == "macosx") { if (shortcut.getID() == "zen-new-empty-split-view" && AppConstants.platform == "macosx") {
if (shortcut.getKeyName() == "+") { if (shortcut.getKeyName() == "+") {
shortcut.setNewBinding("*"); shortcut.setNewBinding("*");
} }
emptySplitFound = true;
} else if (shortcut.getID() == "key_undoCloseWindow") {
shortcut.shouldBeEmpty = true;
shortcut.setDisabled(true);
undoCloseWindowFound = true;
}
if (emptySplitFound && undoCloseWindowFound) {
break; break;
} }
} }

View File

@@ -205,7 +205,7 @@ export class nsZenSessionManager {
// object will always be empty after migration because we haven't // object will always be empty after migration because we haven't
// gotten the opportunity to save the session yet. // gotten the opportunity to save the session yet.
if (this._shouldRunMigration) { if (this._shouldRunMigration) {
this.#runStateMigration(initialState); initialState = this.#runStateMigration(initialState);
} }
// If there are no windows, we create an empty one. By default, // If there are no windows, we create an empty one. By default,
// firefox would create simply a new empty window, but we want // firefox would create simply a new empty window, but we want
@@ -215,7 +215,11 @@ export class nsZenSessionManager {
if (!initialState?.windows?.length) { if (!initialState?.windows?.length) {
this.log("No windows found in initial state, creating an empty one"); this.log("No windows found in initial state, creating an empty one");
initialState ||= {}; initialState ||= {};
initialState.windows = this._shouldRunMigration ? [] : [{}]; initialState.windows = [
{
tabs: [],
},
];
} }
// When we don't have browser.startup.page set to resume session, // When we don't have browser.startup.page set to resume session,
// we only want to restore the pinned tabs into the new windows. // we only want to restore the pinned tabs into the new windows.
@@ -295,6 +299,14 @@ export class nsZenSessionManager {
this.log("Restoring tabs from last closed normal window"); this.log("Restoring tabs from last closed normal window");
} }
} }
if (!initialState?.windows?.length) {
initialState ||= {};
initialState.windows = [
{
tabs: [],
},
];
}
for (const winData of initialState?.windows || []) { for (const winData of initialState?.windows || []) {
winData.spaces = this._migrationData?.spaces || []; winData.spaces = this._migrationData?.spaces || [];
if (winData.tabs) { if (winData.tabs) {
@@ -312,6 +324,17 @@ export class nsZenSessionManager {
// Save the state to the sidebar object so that it gets written // Save the state to the sidebar object so that it gets written
// to the session file. // to the session file.
delete this._migrationData; delete this._migrationData;
return initialState;
}
/**
* Determines if a given window data object is saveable.
*
* @param {object} aWinData - The window data object to check.
* @returns {boolean} True if the window is saveable, false otherwise.
*/
#isWindowSaveable(aWinData) {
return !aWinData.isPopup && !aWinData.isTaskbarTab && !aWinData.isZenUnsynced;
} }
/** /**
@@ -321,7 +344,7 @@ export class nsZenSessionManager {
*/ */
saveState(state) { saveState(state) {
let windows = state?.windows || []; let windows = state?.windows || [];
windows = windows.filter((win) => !win.isPopup && !win.isTaskbarTab && !win.isZenUnsynced); windows = windows.filter((win) => this.#isWindowSaveable(win));
if (!windows.length || !lazy.gWindowSyncEnabled) { if (!windows.length || !lazy.gWindowSyncEnabled) {
// Don't save (or even collect) anything in permanent private // Don't save (or even collect) anything in permanent private
// browsing mode. We also don't want to save if there are no windows. // browsing mode. We also don't want to save if there are no windows.

View File

@@ -10,17 +10,17 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs", TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs",
// eslint-disable-next-line mozilla/valid-lazy // eslint-disable-next-line mozilla/valid-lazy
ZenSessionStore: "resource:///modules/zen/ZenSessionManager.sys.mjs", ZenSessionStore: "resource:///modules/zen/ZenSessionManager.sys.mjs",
TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs", TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
}); });
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gWindowSyncEnabled", "zen.window-sync.enabled"); XPCOMUtils.defineLazyPreferenceGetter(lazy, "gWindowSyncEnabled", "zen.window-sync.enabled");
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gShouldLog", "zen.window-sync.log", true); XPCOMUtils.defineLazyPreferenceGetter(lazy, "gShouldLog", "zen.window-sync.log", true);
const OBSERVING = ["browser-window-before-show"]; const OBSERVING = ["browser-window-before-show", "sessionstore-windows-restored"];
const INSTANT_EVENTS = ["SSWindowClosing"]; const INSTANT_EVENTS = ["SSWindowClosing"];
const UNSYNCED_WINDOW_EVENTS = ["TabOpen"]; const UNSYNCED_WINDOW_EVENTS = ["TabOpen"];
const EVENTS = [ const EVENTS = [
@@ -147,9 +147,6 @@ class nsZenWindowSync {
for (let topic of OBSERVING) { for (let topic of OBSERVING) {
Services.obs.addObserver(this, topic); Services.obs.addObserver(this, topic);
} }
lazy.SessionStore.promiseAllWindowsRestored.then(() => {
this.#onSessionStoreInitialized();
});
} }
uninit() { uninit() {
@@ -176,6 +173,13 @@ class nsZenWindowSync {
* @param {Window} aWindow - The browser window that is about to be shown. * @param {Window} aWindow - The browser window that is about to be shown.
*/ */
#onWindowBeforeShow(aWindow) { #onWindowBeforeShow(aWindow) {
if (
aWindow.gZenWindowSync ||
aWindow.document.documentElement.hasAttribute("zen-unsynced-window")
) {
return;
}
this.log("Setting up window sync for window", aWindow);
// There are 2 possibilities to know if we are trying to open // There are 2 possibilities to know if we are trying to open
// a new *unsynced* window: // a new *unsynced* window:
// 1. We are passing `zen-unsynced` in the window arguments. // 1. We are passing `zen-unsynced` in the window arguments.
@@ -221,6 +225,7 @@ class nsZenWindowSync {
// that didn't have this feature. // that didn't have this feature.
await this.#runOnAllWindowsAsync(null, async (aWindow) => { await this.#runOnAllWindowsAsync(null, async (aWindow) => {
const { gZenWorkspaces } = aWindow; const { gZenWorkspaces } = aWindow;
this.#onWindowBeforeShow(aWindow);
await gZenWorkspaces.promiseInitialized; await gZenWorkspaces.promiseInitialized;
for (let tab of gZenWorkspaces.allStoredTabs) { for (let tab of gZenWorkspaces.allStoredTabs) {
if (!tab.id) { if (!tab.id) {
@@ -288,6 +293,10 @@ class nsZenWindowSync {
this.#onWindowBeforeShow(aSubject); this.#onWindowBeforeShow(aSubject);
break; break;
} }
case "sessionstore-windows-restored": {
this.#onSessionStoreInitialized();
break;
}
} }
} }
@@ -577,7 +586,17 @@ class nsZenWindowSync {
* @param {object} aOtherTab - The tab in the other window. * @param {object} aOtherTab - The tab in the other window.
*/ */
async #swapBrowserDocShellsAsync(aOurTab, aOtherTab) { async #swapBrowserDocShellsAsync(aOurTab, aOtherTab) {
let promise = this.#maybeFlushTabState(aOurTab); if (!this.#canSwapBrowsers(aOurTab, aOtherTab)) {
this.log(
`Cannot swap browsers between tabs ${aOurTab.id} and ${aOtherTab.id} due to process mismatch`
);
return;
}
if (aOtherTab.closing) {
this.log(`Cannot swap browsers, other tab ${aOtherTab.id} is closing`);
return;
}
let promise = this.#maybeFlushTabState(aOtherTab);
await this.#styleSwapedBrowsers( await this.#styleSwapedBrowsers(
aOurTab, aOurTab,
aOtherTab, aOtherTab,
@@ -626,6 +645,27 @@ class nsZenWindowSync {
} }
} }
/**
* Checks if two tabs can have their browsers swapped.
*
* @param {object} aOurTab - The tab in the current window.
* @param {object} aOtherTab - The tab in the other window.
* @returns {boolean} True if the tabs can be swapped, false otherwise.
*/
#canSwapBrowsers(aOurTab, aOtherTab) {
// In this case, the other tab is most likely discarded or pending.
// We *shouldn't* care about this scenario since the remoteness should be
// the same anyways.
if (!aOurTab.linkedBrowser || !aOtherTab.linkedBrowser) {
return true;
}
// Can't swap between chrome and content processes.
if (aOurTab.linkedBrowser.isRemoteBrowser != aOtherTab.linkedBrowser.isRemoteBrowser) {
return false;
}
return true;
}
/** /**
* Swaps the browser docshells between two tabs. * Swaps the browser docshells between two tabs.
* *
@@ -638,19 +678,32 @@ class nsZenWindowSync {
*/ */
#swapBrowserDocShellsInner(aOurTab, aOtherTab, { focus = true, onClose = false } = {}) { #swapBrowserDocShellsInner(aOurTab, aOtherTab, { focus = true, onClose = false } = {}) {
// Can't swap between chrome and content processes. // Can't swap between chrome and content processes.
if (aOurTab.linkedBrowser.isRemoteBrowser != aOtherTab.linkedBrowser.isRemoteBrowser) { if (!this.#canSwapBrowsers(aOurTab, aOtherTab)) {
this.log(
`Cannot swap browsers between tabs ${aOurTab.id} and ${aOtherTab.id} due to process mismatch`
);
return null; return null;
} }
// See https://github.com/zen-browser/desktop/issues/11851, swapping the browsers // See https://github.com/zen-browser/desktop/issues/11851, swapping the browsers
// don't seem to update the state's cache properly, leading to issues when restoring // don't seem to update the state's cache properly, leading to issues when restoring
// the session later on. // the session later on.
let tabStateEntries = this.#getTabEntriesFromCache(aOurTab); let tabStateEntries = this.#getTabEntriesFromCache(aOtherTab);
const setStateToTab = () => {
if (!tabStateEntries?.entries.length) {
this.log(`Error: No tab state entries found for tab ${aOurTab.id} during swap`);
return;
}
lazy.TabStateCache.update(aOurTab.linkedBrowser.permanentKey, {
history: tabStateEntries,
});
};
// Running `swapBrowsersAndCloseOther` doesn't expect us to use the tab after // Running `swapBrowsersAndCloseOther` doesn't expect us to use the tab after
// the operation, so it doesn't really care about cleaning up the other tab. // the operation, so it doesn't really care about cleaning up the other tab.
// We need to make a new tab progress listener for the other tab after the swap. // We need to make a new tab progress listener for the other tab after the swap.
this.#withRestoreTabProgressListener( this.#withRestoreTabProgressListener(
aOtherTab, aOtherTab,
() => { () => {
setStateToTab();
this.log(`Swapping docshells between windows for tab ${aOurTab.id}`); this.log(`Swapping docshells between windows for tab ${aOurTab.id}`);
aOurTab.ownerGlobal.gBrowser.swapBrowsersAndCloseOther(aOurTab, aOtherTab, false); aOurTab.ownerGlobal.gBrowser.swapBrowsersAndCloseOther(aOurTab, aOtherTab, false);
// Since we are moving progress listeners around, there's a chance that we // Since we are moving progress listeners around, there's a chance that we
@@ -701,13 +754,7 @@ class nsZenWindowSync {
// we would start receiving invalid history changes from the the incorrect // we would start receiving invalid history changes from the the incorrect
// browser view that was just swapped out. // browser view that was just swapped out.
return this.#maybeFlushTabState(aOurTab).finally(() => { return this.#maybeFlushTabState(aOurTab).finally(() => {
if (!tabStateEntries?.entries.length) { setStateToTab();
this.log(`Error: No tab state entries found for tab ${aOtherTab.id} during swap`);
return;
}
lazy.TabStateCache.update(aOurTab.linkedBrowser.permanentKey, {
history: tabStateEntries,
});
}); });
} }
@@ -905,7 +952,7 @@ class nsZenWindowSync {
if (aTab.linkedBrowser) { if (aTab.linkedBrowser) {
cachedState = lazy.TabStateCache.get(aTab.linkedBrowser.permanentKey); cachedState = lazy.TabStateCache.get(aTab.linkedBrowser.permanentKey);
} }
return cachedState?.history?.entries ? cachedState.history : { entries: [] }; return cachedState?.history?.entries ? Cu.cloneInto(cachedState.history, {}) : { entries: [] };
} }
/** /**
@@ -1007,13 +1054,30 @@ class nsZenWindowSync {
moveAllTabsToWindow(true); moveAllTabsToWindow(true);
} }
/**
* Updates the initial pinned tab image for all windows if not already set.
*
* @param {object} aTab - The tab to update the image for.
*/
#maybeEditAllTabsEntryImage(aTab) {
if (!aTab?._zenPinnedInitialState || aTab._zenPinnedInitialState.image) {
return;
}
let image = aTab.getAttribute("image") || aTab.ownerGlobal.gBrowser.getIcon(aTab);
this.#runOnAllWindows(null, (win) => {
const targetTab = this.getItemFromWindow(win, aTab.id);
if (targetTab) {
targetTab._zenPinnedInitialState.image = image;
}
});
}
/* Mark: Event Handlers */ /* Mark: Event Handlers */
on_TabOpen(aEvent) { on_TabOpen(aEvent) {
const tab = aEvent.target; const tab = aEvent.target;
const window = tab.ownerGlobal; const window = tab.ownerGlobal;
const isUnsyncedWindow = window.gZenWorkspaces.privateWindowOrDisabled; const isUnsyncedWindow = window.gZenWorkspaces.privateWindowOrDisabled;
if (tab.id) { if (tab.id) {
// This tab was opened as part of a sync operation. // This tab was opened as part of a sync operation.
return; return;
@@ -1045,6 +1109,7 @@ class nsZenWindowSync {
// No need to sync icon changes for tabs that aren't active in this window. // No need to sync icon changes for tabs that aren't active in this window.
return; return;
} }
this.#maybeEditAllTabsEntryImage(aEvent.target);
return this.#delegateGenericSyncEvent(aEvent, SYNC_FLAG_ICON); return this.#delegateGenericSyncEvent(aEvent, SYNC_FLAG_ICON);
} }
@@ -1258,7 +1323,11 @@ class nsZenWindowSync {
} }
}); });
return this.#onTabSwitchOrWindowFocus(window, null, /* ignoreSameTab = */ true); return new Promise((resolve) => {
lazy.setTimeout(() => {
this.#onTabSwitchOrWindowFocus(window, null, /* ignoreSameTab = */ true).finally(resolve);
}, 0);
});
} }
} }

View File

@@ -1354,10 +1354,15 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
} }
}); });
// Apply grid to tabs first to set zen-split attribute on containers
// before setting zen-split-view on parents. This prevents the black flash
// caused by CSS rules that hide containers without zen-split attribute
// when the parent has zen-split-view attribute.
this.applyGridToTabs(splitData.tabs);
this.tabBrowserPanel.setAttribute("zen-split-view", "true"); this.tabBrowserPanel.setAttribute("zen-split-view", "true");
document.getElementById("tabbrowser-tabbox").setAttribute("zen-split-view", "true"); document.getElementById("tabbrowser-tabbox").setAttribute("zen-split-view", "true");
this.applyGridToTabs(splitData.tabs);
this.applyGridLayout(splitData.layoutTree); this.applyGridLayout(splitData.layoutTree);
this.setTabsDocShellState(splitData.tabs, true); this.setTabsDocShellState(splitData.tabs, true);
this.toggleWrapperDisplay(true); this.toggleWrapperDisplay(true);
@@ -1403,6 +1408,10 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
tab.setAttribute("split-view", "true"); tab.setAttribute("split-view", "true");
const container = tab.linkedBrowser?.closest(".browserSidebarContainer"); const container = tab.linkedBrowser?.closest(".browserSidebarContainer");
container.setAttribute("is-zen-split", "true"); container.setAttribute("is-zen-split", "true");
// Set zen-split early to prevent visibility flash when switching workspaces.
// The CSS rule for [is-zen-split]:not([zen-split]) sets visibility:hidden,
// so we must set zen-split before the parent zen-split-view attribute is applied.
container.setAttribute("zen-split", "true");
if (!container?.querySelector(".zen-tab-rearrange-button")) { if (!container?.querySelector(".zen-tab-rearrange-button")) {
// insert a header into the container // insert a header into the container
const header = this._createHeader(container); const header = this._createHeader(container);

View File

@@ -560,6 +560,16 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
); );
const essentialTabsTarget = event.target.closest(".zen-essentials-container"); const essentialTabsTarget = event.target.closest(".zen-essentials-container");
const tabsTarget = !pinnedTabsTarget; const tabsTarget = !pinnedTabsTarget;
let currentEssenialContainer = gZenWorkspaces.getCurrentEssentialsContainer();
if (currentEssenialContainer?.essentialsPromo) {
currentEssenialContainer.essentialsPromo.remove();
}
movingTabs = movingTabs.filter((tab) =>
gBrowser.isTabGroupLabel(tab)
? tab.group?.isZenFolder && !tabsTarget && !essentialTabsTarget
: true
);
// TODO: Solve the issue of adding a tab between two groups // TODO: Solve the issue of adding a tab between two groups
// Remove group labels from the moving tabs and replace it // Remove group labels from the moving tabs and replace it
@@ -651,7 +661,6 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
} }
} }
} }
return moved; return moved;
} catch (ex) { } catch (ex) {
console.error("Error moving tabs:", ex); console.error("Error moving tabs:", ex);

View File

@@ -296,7 +296,7 @@
border-bottom: 0px solid transparent !important; border-bottom: 0px solid transparent !important;
--tab-block-margin: 2px; --tab-block-margin: 2px;
--tab-selected-bgcolor: light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.12)); --tab-selected-bgcolor: light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.18));
--tab-selected-shadow: 0 1px 1px 1px light-dark(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.05)) !important; --tab-selected-shadow: 0 1px 1px 1px light-dark(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.05)) !important;
grid-gap: 0 !important; grid-gap: 0 !important;
@@ -496,6 +496,11 @@
padding-left: 0 !important; padding-left: 0 !important;
} }
#tabbrowser-tabs {
--toolbarbutton-inner-padding: 10px !important;
--tab-icon-end-margin: var(--toolbarbutton-inner-padding) !important;
}
& .tab-audio-button { & .tab-audio-button {
margin-inline-start: -4px; margin-inline-start: -4px;
margin-inline-end: 2px; margin-inline-end: 2px;
@@ -665,7 +670,7 @@
.tab-sharing-icon-overlay, .tab-sharing-icon-overlay,
.tab-icon-overlay { .tab-icon-overlay {
margin-inline-end: var(--toolbarbutton-inner-padding) !important; margin-inline-end: var(--toolbarbutton-inner-padding) !important;
margin-inline-start: calc(var(--toolbarbutton-inner-padding) / 4) !important; margin-inline-start: calc(var(--toolbarbutton-inner-padding) / 3) !important;
} }
} }
} }
@@ -929,7 +934,7 @@
height: calc(100% - var(--tab-block-margin) * 2); height: calc(100% - var(--tab-block-margin) * 2);
margin-left: calc(-1 * var(--tab-inline-padding) + var(--tab-block-margin)); margin-left: calc(-1 * var(--tab-inline-padding) + var(--tab-block-margin));
margin-right: 8px; margin-right: 8px;
padding: 0 calc(var(--toolbarbutton-inner-padding) - 2px) 0 calc(var(--toolbarbutton-inner-padding) / 4 + var(--tab-inline-padding) - 2px); padding: 0 calc(var(--toolbarbutton-inner-padding) - 2px) 0 calc(var(--toolbarbutton-inner-padding) / 3 + var(--tab-inline-padding) - 2px);
border-radius: 0; border-radius: 0;
border-top-left-radius: var(--border-radius-medium); border-top-left-radius: var(--border-radius-medium);
width: unset; width: unset;

View File

@@ -2739,6 +2739,7 @@ class nsZenWorkspaces {
let nextWorkspace = workspaces[targetIndex]; let nextWorkspace = workspaces[targetIndex];
await this.changeWorkspace(nextWorkspace, { whileScrolling }); await this.changeWorkspace(nextWorkspace, { whileScrolling });
return nextWorkspace;
} }
#initializeWorkspaceTabContextMenus() { #initializeWorkspaceTabContextMenus() {

View File

@@ -155,7 +155,7 @@
/* Mark workspaces indicator */ /* Mark workspaces indicator */
.zen-current-workspace-indicator { .zen-current-workspace-indicator {
--indicator-gap: 10px; --indicator-gap: calc(var(--toolbarbutton-inner-padding) - 1px);
padding: calc(2px + var(--tab-inline-padding) + var(--zen-toolbox-padding)); padding: calc(2px + var(--tab-inline-padding) + var(--zen-toolbox-padding));
font-weight: 500; font-weight: 500;
position: relative; position: relative;
@@ -208,8 +208,14 @@
align-items: center; align-items: center;
fill-opacity: 0.6; fill-opacity: 0.6;
-moz-context-properties: fill-opacity, fill; -moz-context-properties: fill-opacity, fill;
fill: currentColor; fill: var(--toolbox-textcolor);
font-size: 14px; font-size: 16px;
padding-top: 2px;
color: light-dark(rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0.8));
& img {
transform: translateY(-1px);
}
&[zen-emoji-open='true']::before { &[zen-emoji-open='true']::before {
border: 1px dashed light-dark(rgba(0, 0, 0, .5), rgba(255, 255, 255, .5)); border: 1px dashed light-dark(rgba(0, 0, 0, .5), rgba(255, 255, 255, .5));
@@ -225,19 +231,19 @@
@media (-moz-platform: windows) { @media (-moz-platform: windows) {
& img { & img {
margin-bottom: -4px; margin-bottom: -2px;
} }
} }
} }
.zen-current-workspace-indicator-name { .zen-current-workspace-indicator-name {
display: flex; display: block;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
cursor: auto; cursor: auto;
white-space: nowrap;
font-weight: 600; font-weight: 600;
align-items: center;
margin: 0; margin: 0;
:root[zen-unsynced-window] & { :root[zen-unsynced-window] & {

View File

@@ -20,7 +20,7 @@
"brandShortName": "Zen", "brandShortName": "Zen",
"brandFullName": "Zen Browser", "brandFullName": "Zen Browser",
"release": { "release": {
"displayVersion": "1.18b", "displayVersion": "1.18.1b",
"github": { "github": {
"repo": "zen-browser/desktop" "repo": "zen-browser/desktop"
}, },
@@ -40,7 +40,7 @@
"brandShortName": "Twilight", "brandShortName": "Twilight",
"brandFullName": "Zen Twilight", "brandFullName": "Zen Twilight",
"release": { "release": {
"displayVersion": "1.18t", "displayVersion": "1.19t",
"github": { "github": {
"repo": "zen-browser/desktop" "repo": "zen-browser/desktop"
} }