-
Notifications
You must be signed in to change notification settings - Fork 16.8k
docs: tutorial for window state persistence #49078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gsoc-2025
Are you sure you want to change the base?
docs: tutorial for window state persistence #49078
Conversation
* test: support for multimonitor tests * fix: update yarn.lock file * test: support any resolution for new displays * test: support display positioning * docs: multi-monitor tests * test: remove dummy test
…electron#47764) * feat: save window state (electron#47425) * feat: save/restore window state * cleanup * remove constructor option * refactor: apply suggestions from code review Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: forward declare prefservice * refactor: remove constructor option * refactor: save window state on move/resize instead of moved/resized * feat: resave window state after construction * test: add basic window save tests * test: add work area tests * test: asynchronous batching behavior * docs: add windowStateRestoreOptions to BaseWindowConstructorOptions * chore: move includes to main block * Update spec/api-browser-window-spec.ts Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * docs: update docs/api/structures/base-window-options.md Co-authored-by: Erick Zhao <erick@hotmail.ca> * fix: preserve original bounds during window state save in special modes * feat: save kiosk state in window preferences * chore: remove ts-expect-error * test: check hasCapturableScreen before running tests * test: remove multimonitor tests * test: add missing hasCapturableScreen checks before tests * docs: add blurb on saving mechanism * feat: add debounce window of 200ms to saveWindowState * docs: remove blurb until finalized * style: convert constants from snake_case to camelCase * refactor: initialize prefs_ only if window state is configured to be saved/restored * refactor: rename window states key * refactor: store in application-level Local State instead of browser context * refactor: switch to more accurate function names * fix: add dcheck for browser_process * fix: flush window state to avoid race condition * refactor: change stateId to name * refactor: change windowStateRestoreOptions to windowStatePersistence * Update docs/api/structures/base-window-options.md Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * fix: add warning when window state persistence enabled without window name * docs: lowercase capital B for consistency --------- Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Erick Zhao <erick@hotmail.ca> * feat: enforce unique window names across BaseWindow and BrowserWindow * docs: update docs for name property * fix: linter issue with symbol --------- Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Co-authored-by: Erick Zhao <erick@hotmail.ca>
…ron#48174) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.10 to 3.29.11. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@96f518a...3c3833e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ron#48762) * refactor: make api::WebRequest inherit from gin::Wrappable refactor: remove unused v8::Isolate* arg from WebRequest ctor refactor: make electron::api::Session::web_request_ a cppgc::Member<api::WebRequest> refactor: allocate api::WebRequest on cpp heap refactor: modify Create(), Find(), and FindOrCreate() to return a WebRequest* * refactor: ProxyingURLLoaderFactory takes a concrete api::WebRequest instead of a WebRequestAPI Experimental commit to ensure `ProxyingURLLoaderFactory::web_request_api_` won't be a dangling pointer. * chore: fix doc shear * refactor: use cppgc::WeakPersistent<> in ProxyingURLLoaderFactory * refactor: make ProxyingURLLoaderFactory::web_request_ const * refactor: make ProxyingWebSocket::web_request_ a cppgc::WeakPersistent<> * add a gin::WeakCellFactory to api::WebRequest * refactor: use a gin::WeakCell for the bound WebRequest argument in HandleOnBeforeRequestResponseEvent() * chore: update patches
…a window to lose focus (electron#45640) Make setFocusable only deactivate a window if focusable is false. Do not deactivate a window when setting focusable to true.
* chore: bump chromium in DEPS to 144.0.7522.0 * 7131867: Remove GenericScopedHandle::IsValid in favor of is_valid https://chromium-review.googlesource.com/c/chromium/src/+/7131867 * 7078879: [video pip] Remove old controls https://chromium-review.googlesource.com/c/chromium/src/+/7078879 * chore: fixup patch indices * 7128138: Add a pref to enable Secure DNS 'automatic mode with DoH fallback'. https://chromium-review.googlesource.com/c/chromium/src/+/7128138 * chore: fixup indices * fix: pip patch --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
build: use tar.xz compression
…#45934) * feat(macos): add --disable-geolocation-mac command-line flag * internally deny geolocation requests if flag set e * wrap PermissionRequestHandler instead * wrap custom handler and deny regardless of response * Update docs/api/command-line-switches.md Co-authored-by: Will Anderson <will@itsananderson.com> * resolving conflicts during rebase * tests added * tests added: minor changes * move IsGeolocationDisabledViaCommandLine inside ElectronPermissionManager as a static member * test: inject fixturesPath via --boot-eval * Update shell/browser/electron_permission_manager.cc Co-authored-by: Robo <hop2deep@gmail.com> * chore: Fixup after merge * fixup after merge --------- Co-authored-by: Will Anderson <will@itsananderson.com> Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* docs: explain how to load SF Symbols with `nativeImage` * fix: use single quotes * fix: use single quotes
* chore: bump chromium in DEPS to 144.0.7526.0 * 7138583: [Partitioned Popins Removal] IPC https://chromium-review.googlesource.com/c/chromium/src/+/7138583 * chore: fixup patch indices * 7139794: Partially remove check for global handlers in plugin mime_type code https://chromium-review.googlesource.com/c/chromium/src/+/7139794 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
In 6399527 we changed the path strings that `node_modules.cc` operates on from single-byte to wide strings. Unfortunately this means that `generic_path()` that the "fix: ensure TraverseParent bails on resource path exit" patch was calling was no longer a safe method to call on Windows if the underlying string has unicode characters in it. Here we fix it by using `ConvertGenericPathToUTF8` from the Node.js internal utilities.
…ron#48941) * fix: handle tar.xz files in uploaders, add to breaking changes * docs: add additional file extension info
test: add view.getBounds|setBounds tests
…ctron#48973) Revert "fix: enable wasm trap handlers in all Node.js processes (electron#48788)" This reverts commit ca0b46b.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
ckerr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with #48069, reviewing this is impossible because there are about 20000 lines of change. Did you possibly merge main into these branches?
If merging main into gsoc-2025 is intentional -- and I do see where that could be useful -- could we do that in a standalone PR so that 49078 and 48069 are humanly reviewable? 😅
Description of Change
Note
This PR is part of the GSoC 2025. It must be stacked on top of the previous PR #48069
Tutorial for
windowStatePersistenceconstructor option.Checklist
Release Notes
Notes: none