Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Zoom with Ctrl+Mousewheel doesn't work #379

Open
gsantner opened this issue Jun 1, 2017 · 11 comments
Open

Zoom with Ctrl+Mousewheel doesn't work #379

gsantner opened this issue Jun 1, 2017 · 11 comments
Labels

Comments

@gsantner
Copy link

gsantner commented Jun 1, 2017

Description

Tried zooming with the numpad +/-/0 keys and neither do work.

Steps to Reproduce Issue

  • Open any application created with nativefier
  • Press CTRL + +/-/0
  • No zoom action happens

Specifications

  • Version of Nativefier (run $ nativefier --version): v7.4.0
  • Version of Node.js (run $ node --version): v7.10.0
  • OS: Arch
  • Architecture x64
@ronjouch ronjouch added the bug label Jun 1, 2017
@ronjouch
Copy link
Contributor

ronjouch commented Jun 1, 2017

Seems legit, thanks for the report @gsantner 👍. As a workaround, non-keypad Ctrl++/-/0 do work, and Zoom In/Out actions (in the View menu) do too.

@joeytwiddle
Copy link

Ctrl-MouseWheelUp/Down also do not zoom (like they do in the browser). Not sure if related.

@derekperkins
Copy link

I can zoom using the non-keypad combinations, but the zoom resets on every click navigation. I'm using nativefier 7.4.1 for GitHub.

@ronjouch ronjouch changed the title Zoom +/-/0 with numpad keys doesn't work Zoom with Ctrl+{+/-/0} numpad keys, and Ctrl+Mousewheel, doesn't work Oct 25, 2017
@eladnava
Copy link

Can confirm zoom functionality stopped working for me as well.

@ronjouch
Copy link
Contributor

Zoom with Ctrl+{+/-/0} numpad keys is fixed in ts branch, which I encourage everyone to test.

To those of you willing to give this dev. branch a try, go ahead: it's ready to ship, currently being reviewed by Jia, will ship soon, so testing is extremely welcome. See the build instructions at #898 (comment) , and please report any issues with a [ts] prefix.

@eladnava
Copy link

Hi @ronjouch,
Thanks for the reply.

I've just tested with ts branch and indeed hotkey zoom works. Any pointers on how to get touchpad zoom working again like in previous versions?

@eladnava
Copy link

eladnava commented Mar 12, 2020

Turns out pinch-to-zoom (macOS touchpad) zoom is now disabled by default in newer versions of Electron:
electron/electron#12679

To re-enable, I've added the following invocation inside window.webContents.on('did-finish-load', () => {}:

window.webContents.setVisualZoomLevelLimits(1, 3);

Woohoo! 🎉

@ronjouch
Copy link
Contributor

Turns out pinch-to-zoom (macOS touchpad) zoom is now disabled by default in newer versions of Electron: electron/electron#12679 To re-enable, I've added the following invocation inside window.webContents.on('did-finish-load', () => {}:

window.webContents.setVisualZoomLevelLimits(1, 3);

@eladnava thanks! I incorporated your patch in branch ts, but I don't have a mac to test it. Please check out branch ts, pull, re-build, and confirm pinch-to-zoom works. If it doesn't, suggestions welcome as to what I barfed up in 3875743 . 🙏

@eladnava
Copy link

Hi @ronjouch,
Perfect, just one thing, it would be nice if pinch-to-zoom was supported on any non-main windows (e.g. opening a link in a new nativefier window):

In mainWindow.js:

Find:

const sendParamsOnDidFinishLoad = (window) => {
        window.webContents.on('did-finish-load', () => {
            window.webContents.send('params', JSON.stringify(options));
        });
    };

Replace with:

const sendParamsOnDidFinishLoad = (window) => {
        window.webContents.on('did-finish-load', () => {
            // Re-enable zoom
            window.webContents.setVisualZoomLevelLimits(1, 3);
            window.webContents.send('params', JSON.stringify(options));
        });
    };

@ronjouch
Copy link
Contributor

Perfect, just one thing, it would be nice if pinch-to-zoom was supported on any non-main windows

@eladnava true! Incorporated in ts! Thanks again!

@eladnava
Copy link

Perfect, confirmed working 🎉

ronjouch added a commit that referenced this issue Mar 15, 2020
## Breaking changes

- Require **Node >= 8.10.0 and npm 5.6.0**
- Move to **Electron 8.1.1**.
- That's it. Lots of care went into breaking CLI & programmatic behavior
  as little as possible. **Please report regressions**.
- Known issue: build may fail behind a proxy. Get in touch if you use one:
  #907 (comment)

## Changes summary

Nativefier didn't get much love recently, to the point that it's
becoming hard to run on recent Node, due to old dependencies.
Also, some past practices now seem weird, as better expressible
by modern JS/TS, discouraging contributions including mine.

Addressing this, and one thing leading to another, came a
bigger-than-expected revamp, aiming at making Nativefier more
**lean, stable, future-proof, user-friendly and dev-friendly**,
while **not changing the CLI/programmatic interfaces**. Highlights:

- **Require Node>=8**, as imposed by many of our dependencies. Node 8
  is twice LTS, and easily available even in conservative Linux distros.
  No reason not to demand it.
- **Default to Electron 8**.
- **Bump** all dependencies to latest version, including electron-packager.
- **Move to TS**. TS is great. As of today, I see no reason not to use it,
  and fight interface bugs at runtime rather than at compile time.
  With that, get rid of everything Babel/Webpack.
- **Move away from Gulp**. Gulp's selling point is perf via streaming,
  but for small builds like Nativefier, npm tasks are plenty good
  and less dependency bloat. Gulp was the driver for this PR: broken
  on Node 12, and I didn't feel like just upgrading and keeping it.
- Add tons of **verbose logs** everywhere it makes sense, to have a
  fine & clear trace of the program flow. This will be helpful to
  debug user-reported issues, and already helped me fix a few bugs.
    - With better simple logging, get rid of the quirky and buggy
      progress bar based on package `progress`. Nice logging (minimal
      by default, the verbose logging mentioned above is only used
      when passing `--verbose`) is better and one less dependency.
- **Dump `async` package**, a relic from old callback-hell early Node.
  Also dump a few other micro-packages unnecessary now.
- A first pass of code **cleanup** thanks to modern JS/TS features:
  fixes, simplifications, jsdoc type annotations to types, etc.
- **Remove GitHub integrations Hound & CodeClimate**, which are more
  exotic than good'ol'linters, and whose signal-to-noise ratio is too low.
- Quality: **Add tests** and add **Windows + macOS CI builds**.
  Also, add a **manual test script**, helping to quickly verify the
  hard-to-programatically-test stuff before releases, and limit regressions.
- **Fix a very small number of existing bugs**. The goal of this PR was
  *not* to fix bugs, but to get Nativefier in better shape to do so.
  Bugfixes will come later. Still, these got addressed:
  - Add common `Alt`+`Left`/`Right` for previous/next navigation.
  - Improve #379: fix zoom with `Ctrl` + numpad `+`/`-`
  - Fix pinch-to-zoom (see #379 (comment) )
@ronjouch ronjouch changed the title Zoom with Ctrl+{+/-/0} numpad keys, and Ctrl+Mousewheel, doesn't work Zoom with Ctrl+Mousewheel doesn't work Mar 15, 2020
Adam777Z pushed a commit to Adam777Z/nativefier that referenced this issue Nov 9, 2022
## Breaking changes

- Require **Node >= 8.10.0 and npm 5.6.0**
- Move to **Electron 8.1.1**.
- That's it. Lots of care went into breaking CLI & programmatic behavior
  as little as possible. **Please report regressions**.
- Known issue: build may fail behind a proxy. Get in touch if you use one:
  nativefier#907 (comment)

## Changes summary

Nativefier didn't get much love recently, to the point that it's
becoming hard to run on recent Node, due to old dependencies.
Also, some past practices now seem weird, as better expressible
by modern JS/TS, discouraging contributions including mine.

Addressing this, and one thing leading to another, came a
bigger-than-expected revamp, aiming at making Nativefier more
**lean, stable, future-proof, user-friendly and dev-friendly**,
while **not changing the CLI/programmatic interfaces**. Highlights:

- **Require Node>=8**, as imposed by many of our dependencies. Node 8
  is twice LTS, and easily available even in conservative Linux distros.
  No reason not to demand it.
- **Default to Electron 8**.
- **Bump** all dependencies to latest version, including electron-packager.
- **Move to TS**. TS is great. As of today, I see no reason not to use it,
  and fight interface bugs at runtime rather than at compile time.
  With that, get rid of everything Babel/Webpack.
- **Move away from Gulp**. Gulp's selling point is perf via streaming,
  but for small builds like Nativefier, npm tasks are plenty good
  and less dependency bloat. Gulp was the driver for this PR: broken
  on Node 12, and I didn't feel like just upgrading and keeping it.
- Add tons of **verbose logs** everywhere it makes sense, to have a
  fine & clear trace of the program flow. This will be helpful to
  debug user-reported issues, and already helped me fix a few bugs.
    - With better simple logging, get rid of the quirky and buggy
      progress bar based on package `progress`. Nice logging (minimal
      by default, the verbose logging mentioned above is only used
      when passing `--verbose`) is better and one less dependency.
- **Dump `async` package**, a relic from old callback-hell early Node.
  Also dump a few other micro-packages unnecessary now.
- A first pass of code **cleanup** thanks to modern JS/TS features:
  fixes, simplifications, jsdoc type annotations to types, etc.
- **Remove GitHub integrations Hound & CodeClimate**, which are more
  exotic than good'ol'linters, and whose signal-to-noise ratio is too low.
- Quality: **Add tests** and add **Windows + macOS CI builds**.
  Also, add a **manual test script**, helping to quickly verify the
  hard-to-programatically-test stuff before releases, and limit regressions.
- **Fix a very small number of existing bugs**. The goal of this PR was
  *not* to fix bugs, but to get Nativefier in better shape to do so.
  Bugfixes will come later. Still, these got addressed:
  - Add common `Alt`+`Left`/`Right` for previous/next navigation.
  - Improve nativefier#379: fix zoom with `Ctrl` + numpad `+`/`-`
  - Fix pinch-to-zoom (see nativefier#379 (comment) )
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants