When dragging a window to a shared secondary monitor, moveDone is blocked by
`inGrab`. However we only want this as long as the window haven't been detached
by window-entered-monitor.
Use `tilix --working-directory %d` for tilix. Otherwise the daemon will have the
workspace dir as working directory. Subsequent new windows might inherit that
directory. (eg. in spaces that doesn't specify an explicit directory(?))
We override these methods so this will work from the typical launchers:
Shell.App.open_new_window
Shell.App.launch_action('new-window', ...)
Gio.DesktopAppInfo.launch
Gio.DesktopAppInfo.launch_action('new-window', ...)
NOTE: overridden `launch` can act somewhat strange with single process many
window apps if the process. If the process is launched with a specific directory
new windows might inherit this on non-overridden `new-window`. (seen in Tilix)
When spawning windows on a secondary monitor, and there's
workspaces-only-on-primary, we simply want to connect the necessary signals and
make sure the window is shown.
When using `workspaces-only-primary` and a scratch window is moved from a
secondary monitor to the primary gnome-shell will make the window unstuck. So we
need to make it stuck again.
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.