Commit Graph
829 Commits
Author SHA1 Message Date
Tor Hedin Brønner 5f3ee4aa68 Add Space.layout
Similar to Minimap.layout, it will move through the tiling from left to right
laying out clones correctly in the space.cloneContainer.

A clone's animation target can be looked up using `clone.targetX`.
2018-07-01 20:54:52 +02:00
Ole Jørgen Brønner b08194b9ab user.js: Initialize "local" imports in init
Otherwise gnome-shell-reload will fail.
2018-07-01 18:08:13 +02:00
Ole Jørgen Brønner 49f402c8d2 Include the most common imports in user.js
No need to split declaration and initialization any more either (?)
2018-07-01 17:52:11 +02:00
Ole Jørgen Brønner 4356128f35 Autofocus new scratch windows if scratch layer already have focus
Or maybe we should do in unconditionally?

An autofocus / noAutoFocus winprop might be useful?
2018-07-01 13:54:22 +02:00
Ole Jørgen Brønner 1240d363a0 Only evaluate winprops on window creation
Doesn't make sense to revaluate each time the window changes workspace.

Also make it easier to control initial focus of scratch windows and removes
side-effects from add_filter.
2018-07-01 13:54:22 +02:00
Tor Hedin Brønner d310553715 minimap: position on correct monitor 2018-07-01 12:26:53 +02:00
Tor Hedin Brønner f783a56940 Ovelays are no longer in the window_group, so don't bother raising 2018-06-30 12:01:06 +02:00
Tor Hedin Brønner 3f381b0c5f edge overlays: Add overlays to the uiGroup
There's no reason to deal with stacking problems of the window_group
2018-06-29 13:56:06 +02:00
Tor Hedin Brønner 2ec4a7afe2 Only run onComplete once 2018-06-29 13:56:06 +02:00
Tor Hedin Brønner ce58c1c2b6 Refactor signal handling into utils.Signals class
We use this pattern all over the place:
```
  signals = [ foo.connect('bar', handler) ];
  signals.forEach(id => foo.disconnect(id));
```
So we abstract it into a class that keeps track of the state automatically.
2018-06-29 13:56:06 +02:00
Tor Hedin Brønner c1bc171491 navigator: Create minimaps on demand
Show a minimap when navigating a space while preview is active.
2018-06-29 13:56:06 +02:00
Tor Hedin Brønner 948d8230a8 minimap: simplify layout 2018-06-29 13:18:12 +02:00
Tor Hedin Brønner ed2cebdddf minimap: Extend Array to mimic Space 2018-06-29 13:18:12 +02:00
Tor Hedin Brønner bcee9acfb8 Move _reorder to Space.swap(direction, window)
Emit `Space::swapped`
2018-06-29 13:18:12 +02:00
Tor Hedin Brønner 204b8ffcb5 Let the minimap take care of its own position 2018-06-29 13:18:09 +02:00
Tor Hedin Brønner 6fda263957 Update the minimap through signals from the space
A space now emits four signals (supplying these arguments):

1. `select`, which runs on `ensureViewport`
2. `window-added` (metaWindow, index, row)
3. `window-removed` (metaWindow, index, row)
4. `monitor-changed`, currently not used

The minimap hooks into these signals updating as necessary. This is a lot
cleaner and goes a long way untangling the minimap from the navigator. One nice
effect is proper support of adding and removing windows when the minimap is
active.

It also works better on wayland as there's less reliance on synchronous updates.
2018-06-29 13:17:50 +02:00
Tor Hedin Brønner 69decf9f12 navigator: Don't navigate using this.space.getWindows()
Also remove state like `_seletedIndex` which is superflous.
2018-06-29 11:06:02 +02:00
Tor Hedin Brønner f0455bc93a Add Space.getWindow(index, row) and Space.positionOf(w) => [i, r] 2018-06-29 11:06:02 +02:00
Tor Hedin Brønner 85d3474593 Keybind handling: accept native close action when navigating 2018-06-29 11:06:02 +02:00
Tor Hedin Brønner e930b93fc8 Refactor space.emit('move-done') to space.moveDone()
This was simply the wrong way to use signals.
2018-06-27 11:40:49 +02:00
Tor Hedin Brønner f011c6e0e9 Cleanup and some comments 2018-06-27 11:28:23 +02:00
Tor Hedin Brønner acf06bae4e windowEnteredMonitor: Don't move scratch windows
Or windows that are `stuck`
2018-06-27 10:22:07 +02:00
Tor Hedin Brønner be15267cb0 Track monitor overlay 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner 07ab09ec84 Fix moving selected window to another monitor/space
Let focus follow the selected window. This caused issues in the past, but seems
to work now. It actually makes the switch more reliable, squashing a weird bug
where changing to another after moving a window would trigger the native switch
workspace animation.

In `moveSizeHandler` we need to check the coordinates of the window against the
monitor because `metaWindow.get_monitor()` reports the old monitor.

We also need to force ensure when inserting a window into a workspace that's not
active.
2018-06-27 10:22:07 +02:00
Tor Hedin Brønner b48ed8b2bd Activate workspace with focus when the mouse enters a monitor 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner 23693de392 Insert windows regardless of which monitor it spawns on 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner fc76805324 Fix up the active workspace after monitors-changed 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner d0e7cc259e Support workspaces-only-on-primary
Also run `monitorsChanged` when `workspaces-only-on-primary` is toggled.
2018-06-27 10:22:07 +02:00
Tor Hedin Brønner 3d9a766699 Remember and restore monitor setup on disable/enable cycles
When monitors actually change we try out some heuristics. In particular we make
sure that the previously active workspace is shown on its assigned
monitor (which might've changed).
2018-06-27 10:22:07 +02:00
Tor Hedin Brønner 920a33b652 Use at least window_gap when dividing space among windows 2018-06-27 10:22:07 +02:00
Ole Jørgen Brønner 6a1d4dcbc5 Fix debug/log-viewer for non-nixos systems + show more initial lines 2018-06-26 21:46:33 +02:00
Tor Hedin Brønner 5f75e9376e Document Space more 2018-06-26 14:29:15 +02:00
Tor Hedin Brønner 49ee4152a8 Prevent onComplete hiding the space.actor after we run show
Fix for 6f270ac442
2018-06-26 14:29:15 +02:00
Ole Jørgen Brønner fd3be2cf25 Notes: how to check if a key sequence is bound (outside clutter) 2018-06-25 22:35:17 +02:00
Ole Jørgen Brønner 2dd9b86bb9 Minor cleanup: notes.org 2018-06-25 22:35:17 +02:00
Tor Hedin Brønner 5a4e78cd2d Fix coordinates that broke multi monitor setup
Used monitor relative coordinates as absolute two places.
2018-06-25 21:28:16 +02:00
Ole Jørgen Brønner 0d19b749e7 Cleanup: remove repl.js
Not useful anymore - better to put some useful sample code in ./examples/
2018-06-25 20:30:03 +02:00
Ole Jørgen Brønner b13cb4dda4 Minor cleanup 2018-06-25 20:26:16 +02:00
Tor Hedin Brønner 9dc591e697 Fix slurp and barf when navigating
Simply rebuild all the clones whenever we execute a non-navigating action. This
is a bit ad-hoc and the whole minimap should probably be rewritten using signals
emitted when the associated space changes (eg. on `space.addWindow`).
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 8c93f10509 fixColumn: move visible check outside the loop 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner ccc6249283 edge-overlays: Always cover the gap when targets are almost hidden
Instead of removing the gap when we're dealing with fullscreen or maximized
windows we remove it when the overlay is wider than 75 pixels.

Also fully cover all windows that aren't marked as `visible` by the space.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 5f6a071651 move_to: Use overlay.target to check if the overlay has a target 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner a7cc11107f edge-overlays: setTarget(metaWindow) -> setTarget(space, index)
Let the edge-overlays act on columns.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 1ff4793cf4 disable: Lower all windows
Lower windows using the flat order of the space.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 65726c197e moveSizeHandler: only pass onComplete if we should animate 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 8a3bf62c9b Constrain selection highlight to the bottom of the top bar 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner baf0d53000 Deprecrate detach in favor of space.removeWindow 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 604da418bc Select the correct window when removing selectedWindow
We simply select the most raised window, ie. how clutter chooses the next focus
window.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner db19ac1376 Simply keybindings somewhat
Only use one instance of the wrapped functions.
2018-06-25 16:50:44 +02:00
Ole Jørgen Brønner 5f7396f25f Misc changes to moveSizeHandler, move_to and centerWindwo:
`move_to` means move the window's *column*, not the window itself.

- Honor y argument in move_to. It's needed to position fullscreen/maximized
  windows.
- Provide a default y value for move_to (top of column)
- Use the moved frame's x position in moveSizeHandler (otherwise it's not
  possible to move non-top vertically tiled windows

Only passing y to move_to in moveSizeHandler is maybe a bit confusing?
2018-06-25 16:50:44 +02:00