The code isn't all that pretty, but it's easy to modify and tune to test what
works well.
I've opted to keep the workspace menu's smooth scroll implementation. When
swiping it's necessary to wait for a button press on the desired space since the
pointer can be anywhere. As such making sure that the workspace stack always
ends up in a discrete state isn't that useful, so I opted for more control when
swiping.
We should add some preferences that users can use to tune the speed of swiping.
I assume that this can vary quite a lot between different touchpads.
This is a bit cleaner, and makes it possible to deal with previous-workspace
etc. the same way as switch-next etc. ie. mostly handled through it's action
handler, instead of special casing in navigator.js.
Another benefit is that we now actually keep track of the workspace mru
directly, eg. empty workspaces doesn't just drop off for no reason.
Try to make it a bit more "action oriented":
An action exists independently of its binding. It could conceivable be invoked
by other means too.
Some weirdness from the marriage remain to weed out, but this is a working
stepping stone.
While we might need to steal some actions from gnome, we should support using
both actions if the user wants it.
Also add all the correct default bindings to the schema, and don't touch gesettings
at all. This should make it simpler to get #66 done.
Haven't looked at restoration at disable, but this will at least restore things
on restart.
Also remove killKeybinding and restoreKeybindings as they worked out really
badly.
We're assessing all top level declarations from outside the original scope when
we're evaluating code. So everything should be `var`.
Classes are `let` bound so we should use var for `ClickOverlay` too, but there's
a bug in gnome-shell-mode making such statements not evaluate. We therefor wait
for that to be fixed.
This means that we won't kill keybindings on disable (which could be worked
around) or crashes (which would be much harder to work around).
NB: it's necessary to go into dconf and restore
`switch-applications[-backward]`, `switch-group[-backward]` to get the
keybindings working again.
This is useful in the case of nothing changing between a disable and enable. For
instance when locking the screen. Having windows move around in that case is
pretty bad.
We do create a new spaces however as we want to support editing the `Space`
definition and getting the changes when we do a reload (this should work as long
as `Space` is an Array).