If there's a new workspace between `enable` and `startup-complete` we would miss
it, leaving us in a broken state.
In particular this happens when using dynamic workspaces and having a window
spawn on startup.
The opacity hack does not work in 3.32 and less. In fact setting opacity on
`queue-redraw` can kill a windows visibility entirely for some reason. The
windowactor property are fine, but the actor still doesn't show up.
So lets just kludge this for compatibility :P
fixes#184
These just doesn't work well and are easy to trigger while scrolling with the
touchpad. (it doesn't help that the overview can be slow as hell)
Thankfully this variable was exposed as a `var` so we override it :)
If you want these you can add this in your `user.js` enable function:
```
Kludges.disableOverride(imports.ui.viewSelector, 'PINCH_GESTURE_THRESHOLD');
```
Not in full use yet.
But the main point is saving the original method on init, supplying an optional
override which will take effect on enable. We reset all properties to their
original form on disable.
NOTE: a property is only ever saved the first time, but new overrides can be
supplied as much as you want.
Finally found a reliable solution for x11.
`first-frame` happens _after_ mutter has drawn the first frame. Meaning there's
a chance of seeing one broken frame (happens reliably with eg. gnome-tweaks).
This worked before as we hid the actor, but we now set opacity instead to work
around 3.34 not allocating hidden actors. opacity is apparently reset on the
first draw, meaning we need to set opacity between `window-created` and
`first-frame`, `queue-redraw` is the obvious choice here.
Not the prettiest code, but it works fairly well.
Selecting the target window works like this (when gliding is finished):
- if the tiling is outside the monitor select the first/last window and snap
- if there's any fully visible windows select the closest one
- if there's no visible window choose the window with highest visible width ratio
This is all calculated the moment we release the swipe, so instead of showing
any potential overshoot we simply adjust the travel so it doesn't overshoot.
The default tree view search doesn't work and can pop up outside the scroll so
disable it.
TODO: add something like `ctrl-f`, `/` to focus the search input