pop-os / touchegg

Pop!_OS fork of https://github.com/JoseExposito/touchegg
GNU General Public License v3.0
37 stars 4 forks source link

fix(config): enable pinch-zoom by default #6

Closed isantop closed 2 years ago

isantop commented 2 years ago

This just maps to the default Ctrl+ and Ctrl- keyboard shortcuts for zoom which are default in most applications which support it. There are some applications for which we may want to add custom configuration; a default configuration for inkscape is included.

I believe the modifications to the conf file will work correctly to enable this.

isantop commented 2 years ago

@n3m0-22

Works well with things like browsers, Nautilus, Document Viewer, Image Viewer, Krita, and Inkscape. It does not work for gnome-terminal which needs Ctrl+Shift++ to zoom in and Ctrl+- to zoom out,

So, I had added these for GNOME Terminal and it didn't work to zoom. I'm thinking given the heavy keyboard focus that Terminal apps have, I don't think putting a ton of effort into making it work would be super worthwhile. I don't see a large use case for moving your hand from your keyboard to your touchpad to zoom in/out

or GIMP which just uses + and -. I think it would be good to add rules for at least those two as they are heavily used.

GIMP Would be a good addition, I'll add that. It should just be a copy-paste of the Inkscape section, since it uses the same ones.

Note: It will work for gedit if you have gedit-plugins installed and enable the Text Size plugin.

That could happen; but I think it might be out of scope for this initial PR since it will need an additional package pulled in.

isantop commented 2 years ago

Actually, it doesn't work with GIMP because GIMP uses Shift + = zoom in and just - to zoom out. Touchegg doesn't like when the modifiers change. I'll need to continue to investigate

isantop commented 2 years ago

@n3m0-22 I've updated the config and included xdotool in the Recommends to enable pinch-zoom by default for Inkscape, Gimp, and Terminal. I've also included some additional apps which I've seen commonly installed (Tilix, which is a Pop_Pick and uses the same configs as the terminal; and Glimpse, a fork of GIMP which uses the same configs as well).

isantop commented 2 years ago

One note: it may not apply for existing users depending on whether or not they've made modifications to their touchegg configuration (or whether Touchegg randomly decided to create a user-configuration for them). However, it should definitely apply to any new users created after updating, and existing users can enable it by removing their current user-config (mv ~/.config/touchegg/touchegg.conf ~/.config/touchegg/touchegg.conf.bak) and then rebooting.

n3m0-22 commented 2 years ago

Working great for everything but Glimpse. The same GIMP keyboard shortcuts work in Glimpse to zoom in and out. There is one way I stumbled on that makes it work in Glimpse.

Now Glimpse will pinch and zoom.

https://user-images.githubusercontent.com/11048214/176557697-f166ee73-5124-4d0c-80e5-ed572e5c73ab.mp4

n3m0-22 commented 2 years ago

Trying to pinch and zoom in Glimpse seems to bring up the Paths Tool. Glimpse has made changes to some of the keyboard shortcuts. For instance GIMP uses B to launch the Paths Tool whereas Glimpse has nothing and B is set to paintbrushes. I tried reassigning the keyboard shortcuts in Glimpse to match those in GIMP, but it made no difference.

isantop commented 2 years ago

@n3m0-22 I realized I hadn't pushed a commit. Can you re-test as of 114c772 ?