This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
Disable zoom every time a display gets added or removed - #11345
Merged
Merged
Conversation
as-cii
force-pushed
the
as-fix-pinch-to-zoom
branch
from
April 1, 2016 14:04
f709f08 to
793f5f9
Compare
Contributor
|
Wow, good find 👍 |
Contributor
|
Awesome detective work! ❤️ |
Contributor
Contributor
|
I think we should report this to Electron too – I'm surprised that this resets after display changes. 😕 |
Contributor
Author
|
@zcbenz: thoughts on what might be happening here? |
Contributor
|
@as-cii This surprised me too, I have no idea of why it happens. |
as-cii
pushed a commit
that referenced
this pull request
Mar 7, 2017
This commit will register the `display-added` and `display-removed` events only once in the main process in order to disable zoom (see #11345) directly instead of unnecessarily paying for I/O in the renderer process during startup.
as-cii
pushed a commit
that referenced
this pull request
Mar 7, 2017
This commit will register the `display-added` and `display-removed` events only once in the main process in order to disable zoom (see #11345) directly instead of unnecessarily paying for I/O in the renderer process during startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #8850. This continues the investigation started on #11326 and attempts to fix it using a different approach.
It turns out that the issue with pinch-to-zoom occurs only under certain circumstances; on my MacBook, it happens only whenever I do the following:
(The above never happens if my MacBook is open when Atom is launched)
As soon as a new display gets added or removed, in facts, the zoom level limit of the web frame is reset to the default and hence the page becomes zoomable again. This doesn't happen when changing the display's metrics (e.g. screen resolution), so I assume it must be something related to adding/removing displays. I have verified this arises also when enabling/disabling mirroring, which is considered by OS X as adding/removing one display.
Electron provides two events which allow us to detect when a display gets added or removed, so that we can reset the zoom level limits to
(1, 1)every time this happens. I suspect this is what is happening in #8850, and this PR should fix it once for all./cc: @joshaber @nathansobo @mnquintana @atom/feedback for extra 👀 👀 👀.