Skip to content
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

Add magnify mouse wheel action (work in progress) #561

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gizabit
Copy link
Contributor

@gizabit gizabit commented Oct 19, 2024

This is a draft for adding a scroll wheel mouse action to magnify windows (as suggested in #459). It is still a work in progress and requires further refinement. I'm sharing it to see if there is enough interest to continue development.

Here is a version that includes this feature for anyone who would like to try it out: AltSnap_magnify.zip

Key Features

  • Based on the Magnification API (available since Windows Vista, presumably)
  • Magnify an individual window
  • Press the hotkey and move the mouse to reposition the magnified area
  • Using it over the desktop area triggers full-screen magnification (accidental feature)

Limitations

  • Only one window can be magnified at a time
  • Magnification resets when the window is moved or resized

Open Points

  • Further testing, especially on different OS versions (I am using Windows 11)
  • Handle mouse wheel step size like in other actions
  • Update all makefiles to link with the Magnification API
  • MinGW doesn't include the library for the API — need to decide how to handle this
  • Changing the magnification can sometimes be glitchy (possibly caused by the API)
  • Some artifacts appear at the window borders
  • Unloading hooks.dll occasionally causes a crash during cleanup
  • Check the need to make certain parameters configurable

@Ichisich
Copy link

Tested on Windows 10 Pro 64bit.

Works great and is more intuitive than Windows' own magnification.
Honestly, I prefer that the magnification is centered on a window and not the entire desktop.

@gizabit
Copy link
Contributor Author

gizabit commented Oct 27, 2024

Thank you for your feedback!

I had issues on both my PC and laptop at work, where the windows stayed black when zooming. Both devices have Intel graphics cards. Fortunately, updating to the latest drivers fixed the problem.

@xan2622
Copy link

xan2622 commented Oct 27, 2024

Thank you for this implementing this feature. Very appreciated.

A few observations:

1-
At first, I was a bit confused about the two mouse cursors but after a while, I got used to the magnified one.
Is it planned to let the user choose to display this magnified cursor or not in the AltSnap.ini file ?

2-
If you press ALT + mousewheelup a bit then release the ALT key, you can still see the content of the focused window magnified (which is cool). But after doing that, if you zoomed in too much, the magnified mouse cursor can't catch the ordinary mouse cursor (for example, if you move the mouse cursor from left to right in the Windows Explorer or Firefox).
And if you move the mouse cursor to the opposite side of the window, you might notice the magnified mouse cursor disappearing off the edge of the window.

On the other hand, if you keep pressing ALT while using mousewheelup (and no matter the zoom level you decide by "mousewheeling" up or down) then you can see that the magnified mouse cursor correctly tries to catch the ordinary mouse cursor. 👍

Maybe the magnification should only be activated as long as the ALT key is continually pressed?

3-
If you try to shut down Windows 11 while Altsnap is still running, you might get this error:

The instruction at 0x00007FFF4351D899 referenced memory at 0x00007FFF4351D899. The memory could not be written.
Click OK to terminate this program.

error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants