Proof-of-concept

A first proof-of-concept shows that this should be possible with reasonably small changes to mutter and gnome-shell respectively.

About halfway through, the video clip shows a clash between this implementation and the workspace scrolling feature in the gnome-shell overview.

Design of the PoC

Design and code changes src/core/events.c: Mutter 1. Bypass Wayland for scroll events where (hard-coded) modifiers are active. -- added 'if-clause' in events.c::meta_display_handle_events -- hard-coded modifiers to <shift>+<ctrl>+<mod2> -- the <mod2> is there because for some reason, it is always set in the scroll event. magnifier.js: gnome-shell 1. Handle 'scroll-event' where the (hard-coded) modifiers are active by updating the mag-factor in the magnifier gsettings schema. -- added a 'DynamicZoomer' class with heavy inspiration from the SwipeTracker::ScrollGesture class. -- create a DynamicZoomer instance in Magnifier::constructor() -- the DynamicZoomer multiplies/divides the mag-factor with a (hard-coded) factor for each received scroll event with the correct modifiers set as active.

The code changes was based on the 'main' branches of mutter/gnome-shell sometime after the 42.rc tag.

Suggested roadmap

Focus on the non-gui parts and leave all user-facing GUI stuff to last.

  1. Mutter

    1. Sort out what gsetting schema/key(s) that shall be added to toggle the scroll-event+modifier key mask event filtering in mutter.

    2. Sort out how to handle some (possible) kinks of the combination of this feature and the current Super+scroll workspace switching.

    3. Implement the mutter updates and get the resulting MR accepted.

  2. gnome-shell

    1. Decide if the chosen solution of changing the magFactor via the gsettings schema is acceptable or if an alternative is needed (for performance or other reasons)

    2. Decide what gsettings schemas/keys shall be added/changed to control this feature.

    3. Implement the gnome-shell updates and get the resulting MR accepted.

  3. User facing GUI stuff

    1. Decide how to add this feature to preference dialogues and similar

    2. Design the GUI

    3. Implement and merge (I do not currently know which project(s) this would affect).

Questions

How can I work towards getting this into the next gnome release (44?)?

  1. Can I get a sponsor/mentor to pester with questions ranging from the development environment to what communication channels are appropriate for certain questions?

Loads of questions around implementation design, eg:

  1. What is the proper way to move the hard-coded values into gsetting keys/schemas?

  2. Where should these properties be added in the schema hierarchy?

  3. How should the dynamic desktop zoom relate to the other functionality of the magnifier?

  4. Is the chosen implementation (to change the mag-factor gsetting using scroll events) ok from a performance perspective or does one want to avoid the round-trip via gsettings and change the mag-factor directly? (if ok, the chosen way has some benefits I think)

  5. The current proof-of-concept

    1. clashes with the workspace scrolling in the 'Overview' action mode. I would like the dynamic zooming to take preference in all action modes, are there any hindrances/downsides to this?

    2. does not work when the lock-screen is active, is fixing this a problem?

    3. does not work in the gdm welcome screen. Is fixing this a problem? To me, this is low prio.