Commit Graph

45 Commits

Author SHA1 Message Date
Tor Hedin Brønner
8daee7ce38 Remove transition from tween calls 2019-09-28 16:20:42 +02:00
Tor Hedin Brønner
18fd713900 Use clutter animations
There's a few differences in how onComplete is run:
- We need to run moveDone on every clone transition, as the transitions aren't
done when cloneContainer's transition finishes
- We cannot run layout until startup is done. For some reason onComplete runs
before monitor setup is done properly.

squash! Use clutter animations

- Can't use addTween as a timeout, but transitions are now finished when
onComplete is run, so there's no need for this anymore.
2019-09-28 15:06:57 +02:00
Tor Hedin Brønner
7fb9f4a0c1 Fix full hot code reload
`getCurrentExtension()` does not work with gnome-shell-mode's eval. Use a
somewhat verbose feature detection to work around the changes made in 3.34.
2019-09-03 17:36:37 +02:00
Rasmus Eneman
f949799c37 Fix crash under Gnome 3.34 2019-08-30 08:16:23 +02:00
Tor Hedin Brønner
509c38caee toggle-scratch-window: only hide when the scratch window has focus
This makes it easier to switch between the tiling and a floating window.
2019-04-08 15:23:47 +02:00
Tor Hedin Brønner
621b7b728f Port to class in preparation for 3.32
see:
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361

TODO: port the LayoutManager in minimap.js, though it looks like gjs won't
deprecrate Lang.Class yet, so it's probably fine to keep using it for now.
2019-03-24 03:49:36 +01:00
Ole Jørgen Brønner
6cb848a6a1 Fix weird minimize animation of scratch windows with remembered position
The scratch window would first be moved to the remembered position - then
animated "down".

Also ensures that windows minimized when navigating get a proper position.
(restoring a window that was minimized when it was non-placeable results in the
window being out-of-view)

Note: Use 'effect-completed' to detect when a the animation is done - then
resize/move. Could also have stored the target position, but that complicates
all the places we want to preview a minimized window.
2019-03-17 16:37:33 +01:00
Ole Jørgen Brønner
9c702ecba2 scratch: always position scratch windows on focus monitor 2019-02-27 22:41:10 +01:00
Ole Jørgen Brønner
2174981cfc scratch: remember previous "scratch geometry" and restore it on detach 2019-02-27 22:41:00 +01:00
Ole Jørgen Brønner
571a2d0680 Don't show actors of minimized scratch windows
Specifically fixes bug where whole scratch layer become visible (but only the
actors) when reloading (or disable/enable cycle) when at least on scratch window
was active.

This also sometimes crashed gnome-shell (confirmed on v3.28.3 - ubuntu 18.04)

Also remove some code who seem to partly work around the problem
2019-01-26 14:05:09 +01:00
Tor Hedin Brønner
187f6ee9cb Only toggle the most recent window on super-escape
super-shift-escape toggles the whole layer.
2019-01-14 18:22:57 +01:00
Ole Jørgen Brønner
b5fdb1b119 focusMonitor: don't crash on display.focus_window == null
Can sometimes happen on enable (eg. when unlocking screen)
2019-01-11 19:25:00 +01:00
Ole Jørgen Brønner
6ed174e0ce Fade selection when scratch layer has focus 2019-01-10 20:48:51 +01:00
Tor Hedin Brønner
84550d6717 Reparent the selection highlight on the window clone
This makes selection logic a lot more centralized and robust. In particular the
selection highlight will now consitently track the window clone.

Also introduce `showWindow` `animateWindow` and `isWindowAnimating` to wrap some
potentially changing structure.
2019-01-05 10:25:06 +01:00
Ole Jørgen Brønner
aa5a77738f Main.layoutManager.focusMonitor is very new so use a "polyfill" for now 2018-06-25 16:50:44 +02:00
Ole Jørgen Brønner
c18ce14e00 Return early in Scratch.show if there's no scratch windows 2018-06-23 19:31:26 +02:00
Tor Hedin Brønner
632ff93ce7 Hide the clickoverlay when unwanted, show again on focus
This should fix the issues with the clickoverlay and the scratch layer, where
the overlay would be inactive after closing the scratch layer.
2018-06-03 00:49:49 +02:00
Tor Hedin Brønner
15d21d35ac Reset the left/right clickoverlays when showing the scratch layer 2018-05-02 17:03:57 +02:00
Tor Hedin Brønner
42aedba3b6 Use var for all top level declarations to avoid warnings
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.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner
30427f0bc4 Remove unnecessary StackOverlay import
The better name clickOverlays should be accessed from eg. `space.monitor` now.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner
5263bb834c Make a ClickOverlay per monitor 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner
7dd2883830 Add StackOverlay.reset()
Also reset the overlay when we're done with navigation. It would hang around
when switching to a blank workspace.
2018-04-23 11:17:40 +02:00
Tor Hedin Brønner
4e0fe38c43 scratch: Don't show the whole layer when floating a new window 2018-04-23 09:25:25 +02:00
Tor Hedin Brønner
a8c112ce4e Deactivate the stackoverlay when the scratch layer is active 2018-04-22 15:01:57 +02:00
Tor Hedin Brønner
580c10df39 Fix minimize animations
Attach all cloneContainers to the BackgroundGroup, leaving it at the bottom of
the window group.

This seems to fix minimize animations.
2018-04-22 14:56:35 +02:00
Tor Hedin Brønner
2ced462637 Never show window actors when navigating 2018-04-22 14:56:05 +02:00
Tor Hedin Brønner
0d061618f4 Fix scratch
For some reason the cloneContainer changes triggers the no minimize animation
bug. This makes things usable.
2018-04-22 14:56:05 +02:00
Tor Hedin Brønner
0dfa8d000e scratch: Force top bar visibility when showing the scratch layer 2018-04-13 20:05:55 +02:00
Tor Hedin Brønner
a66d8fc4e7 scratch: When detaching/attaching windows also show/hide the scratch layer
Attaching and detaching windows could be somewhat disorienting. Eg. making the
focused window hidden by other floating windows when attaching the current
window to the tiling.
2018-04-12 20:11:50 +02:00
Tor Hedin Brønner
83fb20eb6a scratch: Add show/hide functions 2018-04-12 20:06:33 +02:00
Tor Hedin Brønner
def0d6c47c isScratchWindow: don't fail on null
Silly regression
2018-03-10 22:09:53 +01:00
Tor Hedin Brønner
d80e2eacc6 scratch: Use an explicit marker for floating windows
On startup we use a heuristic to figure out which windows should float in the
scratch layer, but from then on we simply check if the window is marked as
floating.

NB: Since `above` is reset when a window is minimized there's no guarantee that
a floating window will be above when visible.
2018-03-10 20:42:00 +01:00
Tor Hedin Brønner
2b6a406071 scratch: Simplify scratch menu 2018-02-26 13:32:13 +01:00
Tor Hedin Brønner
fa0a0db195 Add scratch window toggle
Binding `<Super><Ctrl>Escape>`.

Schema change
2018-02-25 10:36:40 +01:00
Tor Hedin Brønner
af339aedca scratch: Test out using above/minimized as scratch indicators
In addition to making `always on visible workspace` work for multimonitor setups
this makes it possible to have workspace local scratch windows.
2018-01-11 14:11:55 +01:00
Tor Hedin Brønner
ab9d4c6a99 scratch: Add scratch toggle to alt-space menu
This makes it possible, with some work, to use a combination of above and
minimized to detect scratch windows. Leaving always visible on all workspaces
functional for multimonitor use.

As mentioned we need to use a combination of above and minimized since minimized
windows can't be above.
2018-01-11 14:11:55 +01:00
Tor Hedin Brønner
7c6bf66ee7 Use isScratchWindow to detect scratch windows consistently 2018-01-11 14:11:44 +01:00
Tor Hedin Brønner
52c93dac3e scratchpad: Preserve stack ordering
Reversing the window order when un-minimizing solves this.
2017-12-27 21:35:35 +01:00
Tor Hedin Brønner
56dac2a8b6 Get the Extension object via hardcoded uuid lookup
This enables reloading of a whole module.
2017-12-03 19:18:14 +01:00
Tor Hedin Brønner
d7adf22ff2 Use proper function syntax
There's no longer any reason to use `var name = function()` or
`var name = ()=>{}`.
2017-10-29 16:12:53 +01:00
Tor Hedin Brønner
d8e6cb32ad Make debug local
Add `Extension` and `debug` to all the module scopes for convenience.

(also add var to non-used function)
2017-10-27 21:23:46 +02:00
Tor Hedin Brønner
e260fc25b7 Always pass an owner object to dynamic_function_ref
This way we can remove a bunch more globally declared variables.
2017-10-27 21:03:53 +02:00
Ole Jørgen Brønner
2021b584e4 Put scratch windows first in LiveAltTab (when scratch is active)
(in scratch windwo MRU order of course)

Ideally the scratch layer would somehow mutate the MRU itself on
activation, but it seems the only way to do this is to actually focus
the windows in turn. That might be slowish(?) and also messes with the
stacking order (I think). Ie. would need to restore the stacking order
after doing the focus dance.
2017-10-19 18:16:57 +02:00
Tor Hedin Brønner
a1a71a0849 Fix #22: unmake_above when hiding scratch layer 2017-09-23 00:55:29 +02:00
Tor Hedin Brønner
317d2c0c2a Basic scratch toggle
Stack ordering isn't preserved properly. Use <Super>e to toggle for now.
2017-09-22 23:37:27 +02:00