chore: Drag and drop refactor, p=#11723

* feat: Full cross-window workspace syncing, b=no-bug, c=workspaces

* feat: Also change icons and labels if the tab is pending, b=no-bug, c=tabs, workspaces

* feat: Dont session duplicate the tabs, b=no-bug, c=workspaces

* feat: Properly handle tab moves, b=no-bug, c=workspaces

* feat: Start on new session restore, b=no-bug, c=no-component

* Discard changes to prefs/browser.yaml

* feat: Start doing out own session restore, b=no-bug, c=folders, tabs

* feat: Stop using pinned manager and use zen session sidebar, b=no-bug, c=common, folders, tabs, workspaces

* feat: Dont restore windows that are already initialized, b=no-bug, c=no-component

* chore: Update patches to ff 145, b=no-bug, c=no-component

* Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch

* Discard changes to src/browser/components/tabbrowser/content/tab-js.patch

* Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch

* Discard changes to src/zen/tabs/ZenPinnedTabsStorage.mjs

* feat: Run session saver before opening a new winodw, b=no-bug, c=tabs

* feat: Clone the previous state, b=no-bug, c=no-component

* feat: Move window sync to its own JS module, b=no-bug, c=workspaces

* feat: Run session saver before opening a new window, b=no-bug, c=no-component

* feat: Full cross-window workspace syncing, b=no-bug, c=workspaces

* feat: Also change icons and labels if the tab is pending, b=no-bug, c=tabs, workspaces

* feat: Dont session duplicate the tabs, b=no-bug, c=workspaces

* feat: Start on new session restore, b=no-bug, c=no-component

* feat: Properly handle tab moves, b=no-bug, c=workspaces

* Discard changes to prefs/browser.yaml

* feat: Start doing out own session restore, b=no-bug, c=folders, tabs

* feat: Stop using pinned manager and use zen session sidebar, b=no-bug, c=common, folders, tabs, workspaces

* feat: Dont restore windows that are already initialized, b=no-bug, c=no-component

* chore: Update patches to ff 145, b=no-bug, c=no-component

* Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch

* Discard changes to src/browser/components/tabbrowser/content/tab-js.patch

* Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch

* Discard changes to src/zen/tabs/ZenPinnedTabsStorage.mjs

* feat: Run session saver before opening a new winodw, b=no-bug, c=tabs

* feat: Clone the previous state, b=no-bug, c=no-component

* feat: Move window sync to its own JS module, b=no-bug, c=workspaces

* feat: Run session saver before opening a new window, b=no-bug, c=no-component

* feat: Start making use of IDs instead of sync identifiers, b=no-bug, c=folders

* feat: Listen to new tab opens for new sync system, b=no-bug, c=common, folders, tabs

* feat: Listen for more tab events and properly sync them, b=no-bug, c=common, folders, tabs

* feat: Start moving browser views to the selected windows, b=no-bug, c=no-component

* chore: Remove extra patch, b=no-bug, c=no-component

* feat: Leave a screenshot of the page behind when switching windows or tabs, b=no-bug, c=common

* feat: Run session saves right before writing and quiting, b=no-bug, c=common

* fix: Fixed going back to a different window not allowing to type on inputs, b=no-bug, c=no-component

* feat: Start syncing folders as well, b=no-bug, c=folders

* Discard changes to src/browser/components/tabbrowser/content/tab-js.patch

* chore: Update patches to ff 146, b=no-bug, c=no-component

* feat: Early support for unsynced windoiws, b=no-bug, c=workspaces

* fix: Move back active views when closing a window, b=no-bug, c=no-component

* feat: Stop rendering sub-layers when swaping browsers, b=no-bug, c=common

* feat: Improved support for unsynced windows support, b=no-bug, c=workspaces, folders

* feat: Implemented 'Move To...' Button for unsynced windows, b=no-bug, c=workspaces, common

* feat: Make sure to properly flush all windows when making a new one and fix removing progress listeners, b=no-bug, c=workspaces

* feat: Make sure to not lose any tabs when opening from a private window, b=no-bug, c=workspaces

* feat: Allow unload to run instantly and fix closing windows on mac, b=no-bug, c=no-component

* feat: Make sure to always initialize an empty state with the sidebar object, b=no-bug, c=workspaces

* chore: Small fixes and QA checks, b=no-bug, c=tabs, workspaces

* fix: Fixed tab labels not changing on unfocused windows, b=no-bug, c=no-component

* feat: Fixed closing windows on macos not returning to the original views, b=no-bug, c=no-component

* chore: Turn off debug flags by default, b=no-bug, c=no-component

* feat: Start implementing old pinned tab behaviour we used to have, b=no-bug, c=common, tabs

* feat: Unsynced windows should always be allowed to change labels, b=no-bug, c=welcome

* feat: Make sure we wait long enough before we initialize workspaces, b=no-bug, c=workspaces

* feat: Dont mix remoteness when changing browser views and restore window spaces, b=no-bug, c=common, folders, workspaces

* test: Fixed tests for the pinned tabs manager, b=no-bug, c=tabs, folders, tests, welcome

* feat: Added partial support for split views, b=no-bug, c=split-view

* chore: Finished basic support for split views, b=no-bug, c=folders, split-view

* feat: Always make sure to save the last closed window to the sidebar object, b=no-bug, c=no-component

* feat: Implement workspace sync store into the session file, b=closes #10857, c=common, tabs, tests, workspaces

* feat: New drag and drop system, b=no-bug, c=tabs, common, folders

* feat: Add support for drag-and-dropping tabs into groups, b=no-bug, c=common, folders, tabs, workspaces

* feat: Add a default value for the workspace cache, b=no-bug, c=workspaces

* fix: Default assign an array instead of an object to the workspaces cache, b=no-bug, c=workspaces

* feat: Take into consideration win data may not have allocated spaces, b=no-bug, c=workspaces

* feat: Always make sure we are assigning the correct space ID, b=no-bug, c=workspaces

* feat: Make sure to initialize windows even if there are no tabs, b=no-bug, c=no-component

* feat: Improved drag and drop simulation, b=no-bug, c=common, tabs

* feat: Implement opacity changes to the drag image, b=no-bug, c=tabs, common, split-view

* feat: Support for drag and dropping outside the window, b=no-bug, c=split-view

* feat: Added transitions when reordering, b=no-bug, c=split-view, tabs

* feat: Started working on drag and dropping to essentials, b=no-bug, c=no-component

* Discard changes to locales/en-US/browser/browser/zen-workspaces.ftl

* Discard changes to prefs/zen/view.yaml

* Discard changes to prefs/zen/zen.yaml

* Discard changes to src/browser/base/content/zen-assets.inc.xhtml

* Discard changes to src/browser/base/content/zen-assets.jar.inc.mn

* Discard changes to src/browser/base/content/zen-panels/popups.inc

* Discard changes to src/browser/base/content/zen-preloaded.inc.xhtml

* Discard changes to src/browser/components/places/content/editBookmark-js.patch

* Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch

* Discard changes to src/browser/components/sessionstore/TabState-sys-mjs.patch

* Discard changes to src/browser/components/tabbrowser/content/tab-js.patch

* Discard changes to src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch

* Discard changes to src/zen/ZenComponents.manifest

* Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch

* feat: Finish migration, b=no-bug, c=no-component

* feat: Add support for multi tabs dragging, b=no-bug, c=tabs

* feat: Added support for essential tabs, b=no-bug, c=split-view, tabs, workspaces

* feat: Added support to switch space when holding on the side of the sidebar, b=no-bug, c=common, split-view, workspaces

* Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch

* chore: Fixed merge conflicts, b=no-bug, c=no-component

* feat: Added support for split views, b=no-bug, c=split-view

---------

Signed-off-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
This commit is contained in:
mr. m
2025-12-28 18:26:52 +01:00
committed by GitHub
parent b66b05dcf6
commit 335c024e6d
26 changed files with 1755 additions and 608 deletions

View File

@@ -0,0 +1,47 @@
diff --git a/widget/cocoa/nsDragService.mm b/widget/cocoa/nsDragService.mm
index f1614b823a859ff8fbc74982f205bb1f2ef29beb..897c24846a97c132babe3ad79da12ebfcec90484 100644
--- a/widget/cocoa/nsDragService.mm
+++ b/widget/cocoa/nsDragService.mm
@@ -23,6 +23,7 @@
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
+#include "mozilla/nsZenDragAndDrop.h"
#include "nsIContent.h"
#include "nsCocoaUtils.h"
#include "mozilla/gfx/2D.h"
@@ -148,6 +149,10 @@
bitsPerPixel:32];
uint8_t* dest = [imageRep bitmapData];
+ auto drag_translucency = DRAG_TRANSLUCENCY;
+ if (auto zenDragAndDrop = zen::nsZenDragAndDrop::GetZenDragAndDropInstance()) {
+ drag_translucency = zenDragAndDrop->GetDragImageOpacity();
+ }
for (uint32_t i = 0; i < height; ++i) {
uint8_t* src = map.mData + i * map.mStride;
for (uint32_t j = 0; j < width; ++j) {
@@ -155,15 +160,15 @@
// is premultipled here. Also, Quartz likes RGBA, so do that translation
// as well.
#ifdef IS_BIG_ENDIAN
- dest[0] = uint8_t(src[1] * DRAG_TRANSLUCENCY);
- dest[1] = uint8_t(src[2] * DRAG_TRANSLUCENCY);
- dest[2] = uint8_t(src[3] * DRAG_TRANSLUCENCY);
- dest[3] = uint8_t(src[0] * DRAG_TRANSLUCENCY);
+ dest[0] = uint8_t(src[1] * drag_translucency);
+ dest[1] = uint8_t(src[2] * drag_translucency);
+ dest[2] = uint8_t(src[3] * drag_translucency);
+ dest[3] = uint8_t(src[0] * drag_translucency);
#else
- dest[0] = uint8_t(src[2] * DRAG_TRANSLUCENCY);
- dest[1] = uint8_t(src[1] * DRAG_TRANSLUCENCY);
- dest[2] = uint8_t(src[0] * DRAG_TRANSLUCENCY);
- dest[3] = uint8_t(src[3] * DRAG_TRANSLUCENCY);
+ dest[0] = uint8_t(src[2] * drag_translucency);
+ dest[1] = uint8_t(src[1] * drag_translucency);
+ dest[2] = uint8_t(src[0] * drag_translucency);
+ dest[3] = uint8_t(src[3] * drag_translucency);
#endif
src += 4;
dest += 4;