Commit Graph

3 Commits

Author SHA1 Message Date
Matthew Rheaume
efdc7e58c4 Fixed reload & zoom in Flipper Desktop application. (#3840)
Summary:
After the upgrade to Electron in `92cdb81`, the reload functionality no
longer works. I believe this is due to the main menu creation being
moved to the main process where the `window` global variable is undefined
(whereas previously it was on the render process, where `window` would
be defined). Rather than rely on the `window` global, when a reload is
requested just reload the given `focusedWindow`.

Similarly, zooming was also broken, so fix that by going through `focusedWindow` rather than `webFrame` (since `webFrame` only exists in the render process).

Fixes https://github.com/facebook/flipper/issues/3839, https://github.com/facebook/flipper/issues/3820

## Changelog

changelog: Fixed reload & zoom in Flipper Desktop application.

Pull Request resolved: https://github.com/facebook/flipper/pull/3840

Test Plan: Built the application locally, verified that reload worked as expected (and would reload the application), verified that zooming (in, out, actual size) worked as expected.

Reviewed By: passy

Differential Revision: D38784319

Pulled By: mweststrate

fbshipit-source-id: c219063a8aaf42425678c2c8824f6fcde1cadd52
2022-08-18 06:11:38 -07:00
Andrey Goncharov
ae90ce5878 Fix electron reloading
Reviewed By: antonk52

Differential Revision: D37556134

fbshipit-source-id: 7ff301bd6d06f570559b38647462515c35c899f3
2022-07-01 03:42:11 -07:00
Andrey Goncharov
92cdb81096 Upgrade electron version
Summary:
CHANGELOG: Upgrade electron to 18.2.0.

In Electron 18.2.0 we no longer have access to `remote`. Instead, we are recommended to implement IPC communications. We re-implement `remote` methods used before as IPC commands. To support type-safe execution of the commands, we create electron IPC clients on both sides: the main process and renderer process. We also move the main menu creation to the main process and track its usage via sending IPC messages to the renderer process where the logging happens.

Reviewed By: mweststrate

Differential Revision: D36593625

fbshipit-source-id: 6dcf531461ef2edceb9cac372a650f84f3370953
2022-05-31 06:52:14 -07:00