gfxmonk/gnome-shell-scroll-workspaces — pull request #7 by N-Yuki (2014-10-22 14:54:36+00:00)
Title: Rewrite, bug fixes, and preferences

It was mainly done as an exercise, but merge back as much (or as little) as you want.

Key notes:
0) The rewrite was to make it more consistent with the extensions hosted on Gnome's shell extensions git repo.
1) It fixes the bug where changing workspaces caused a loss of focus of the last app/window. This can be tested this by opening a window in one workspace, scroll away, then scroll back. Normally you'd expect the appmenu to show the same app as before scrolling away, but it does not.
2) The check for scrollable areas was changed. It should now (hopefully) give a larger scrollable area without relying on the fact that everything in the centre region is safe.
3) The hardcoded 200ms wait was made into an option. The 200ms was a bit high for me, and it sometimes made it feel like it was less responsive. Also, with a mouse with good scrolling ticks, I think no wait would be good. This is how scrolling works in the overview as well, so it made sense to have no wait by default.
4) While adding configurability, the feature from gfxmonk/gnome-shell-scroll-workspaces#6 was also reimplemented using a redesign to fit with the rewrite.
5) The prefs screen was made using Glade 3, so there's no need to piece together the GUI with Gtk, making prefs.js easy to read and maintain.
6) The way prefs.js and settings is managed in extensions seem to be quite fragmented, and many examples I read tend to be unnecessarily complicated or incomplete, so with some scarce documentation and Gnome's shell extensions git repo, I took the parts I thought were good. I also made sure that the preferences UI was responsive to changes made from another source like dconf-editor. This was lacking in nearly every other prefs.js I looked at outside of Gnome's shell extensions git repo.

I also set the minimum Shell and Gtk versions to 3.10, but it probably works with much earlier versions.