602 Commits
Author SHA1 Message Date
Tor Hedin Brønner cc7fb6efb9 Don't add closed windows when enabling extension again
If the user disables the extension manually, closes some windows, and later
enable the extension again things would go really wrong.
2018-09-08 17:21:25 +02:00
Tor Hedin Brønner d9431c4b80 Never set targetX to null on startup 2018-09-08 17:21:25 +02:00
Tor Hedin Brønner 2abdcfd4bf Fix dynamic workspaces again
We need to update the most recently used workspace stack when adding and
removing workspaces.

To make this less of a pain we make spaces.stack track all spaces, not just the
ones that aren't visible. Prefering instead to filter out the visible spaces on
`selectSpace`, this is a lot cleaner.
2018-09-04 20:45:27 +02:00
Tor Hedin Brønner 17c6dcd34d Never show window actors if the space isn't at y = 0 2018-09-04 07:06:43 +02:00
Tor Hedin Brønner 6698c0ff71 Construct spaces on enable, take two
On startup we want to add windows «manually» and not through signals, eg.
because we want to reconstruct an old space. So while we should construct the
spaces as fast as possible to startup look good, we need to defer connecting
most signals until everything has settled (ie. after `startup-complete`).

We introduce `Spaces.init` and `Space.init` which connect signals and take care
of things that can't be done on `enable`, but rather after `startup-complete`.

Some more stuff:

Use `Main.layoutManger._startingUp` to detect startup, this is actually the
thing that's set when `startup-complete` is emitted.

Since we're using the window mru to construct the initial workspace order we
need to wait for all the windows to actually be available.
2018-09-04 07:03:52 +02:00
Tor Hedin Brønner 9e673f4379 Space.layout: never set a negative width 2018-08-31 23:36:09 +02:00
Tor Hedin Brønner 581960fe17 Revert "Construct spaces on enable"
This reverts commit a4f8cd1e3f.

This broke restart on X11 for somee reason, reverting for now
2018-08-29 16:53:01 +02:00
Tor Hedin Brønner 5df74a99f7 Revert "Fix unchecked usage of oldSpace"
This reverts commit 77ca390a5c.
2018-08-29 16:52:40 +02:00
Tor Hedin Brønner 842378d8b2 Fix clipping on all spaces when navigating workspace mru 2018-08-28 01:35:31 +02:00
Tor Hedin Brønner 124d752a1e Add 3 finger touchpad navigation on wayland
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.
2018-08-28 01:35:31 +02:00
Tor Hedin Brønner 6a01b9c52a wayland: Enable clicking on spaces
This will be used to implement selection after swiping.
2018-08-28 01:34:55 +02:00
Tor Hedin Brønner 02169e61d4 Animate fullscreen windows down when navigating
When starting navigation we always want to move fullscreen windows below the top
bar.
2018-08-28 01:27:06 +02:00
Tor Hedin Brønner ff2a7694de Separate overlay and visibility handling
We only need to calculate visible windows when we're ready to show window
actors again. This makes the tracking more robust as it should always be called
at the correct time.

`fixVisible` is replaced by `space.isPlaceable(metaWindow)` which checks if the
window actor can be placed at its clone's position. We simply call isPlaceable
from the main `moveDone` loop.
2018-08-27 20:33:34 +02:00
Tor Hedin Brønner 145a8d3347 Polyfill global.workspace_manager 2018-08-27 20:33:34 +02:00
Tor Hedin Brønner 77ca390a5c Fix unchecked usage of oldSpace 2018-08-27 19:44:04 +02:00
Tor Hedin Brønner 758f8ce750 space.layout: compare against correct width when centering 2018-08-26 19:41:54 +02:00
Tor Hedin Brønner a4f8cd1e3f Construct spaces on enable
To avoid showing the shared background on startup we create spaces on enable,
only deferring adding the windows (which isn't available on enable).
2018-08-26 17:58:36 +02:00
Tor Hedin Brønner a5899fdd6b fixup: set selected correctly 2018-08-23 01:38:01 +02:00
Tor Hedin Brønner 01fa77cc6c Run layout on every window resize
If a non-selected was resized the layout would be wrong.
2018-08-23 01:36:02 +02:00
Tor Hedin Brønner 62f497aeee cleanup 2018-08-23 01:25:02 +02:00
Tor Hedin Brønner 4c7484d683 window layout: Use the actor's size instead of buffer
For some reason `get_buffer_rect` causes issues when animating new windows,
specifically with Tilix windows.

Also simplify the comments here.
2018-08-23 01:25:02 +02:00
Tor Hedin Brønner fd9fae47f1 Align window clone coordinates using a layout manager
This way we won't have to compute dX all over the place, instead the clones are
correctly aligned with the window frame by default.

This also seems to mostly fix the resize problem on wayland, so we no longer
need to update the clone size on `size-changed`.
2018-08-18 02:12:56 +02:00
Tor Hedin Brønner 51d1cf0deb Space: Increase background height
This makes the bottom of the space prettier if seen (eg. when smooth scrolling).
2018-08-06 17:18:06 +02:00
Tor Hedin Brønner 2a2511eea4 Disable the background menu 2018-08-06 16:37:43 +02:00
Tor Hedin Brønner 90a076bb1d add_filter: Simplify 2018-08-05 23:07:08 +02:00
Tor Hedin Brønner 9e24210e2c Never add transient or non-normal windows
A transient window can be NORMAL, at least in wayland.
2018-08-05 23:05:41 +02:00
Tor Hedin Brønner e747ec9a47 switch-left/right: Select the top stacked window in a column 2018-08-03 16:30:44 +02:00
Tor Hedin Brønner 9881b970a0 selectSpace: Don't restart animations 2018-08-03 15:51:39 +02:00
Tor Hedin Brønner c8678ea79f workspace scroll: Add smooth scroll for touchpads
closes #74
2018-08-03 15:50:42 +02:00
Tor Hedin Brønner a1bda566df Refactor _initWorkspaceStack out of selectSpace 2018-08-02 15:12:39 +02:00
Tor Hedin Brønner bad680975c layout: Center correctly
Subtract the last added gap
2018-07-24 18:20:38 +02:00
Tor Hedin Brønner 1b03c6177d Fix "Guard against moving windows while changing monitors"
`monitor.index` is a number, not a function. So the guard doesn't seem to work
as it just happened to prevent moving windows to other monitors/workspaces.
2018-07-23 18:15:38 +02:00
Tor Hedin Brønner c349e068d1 Another fix for clipping in the overview 2018-07-21 15:11:38 +02:00
Tor Hedin Brønner 051d778d78 Show the window actors when leaving the overview 2018-07-20 10:48:35 +02:00
Tor Hedin Brønner 9e97ba77c8 Avoid showing any clipping when the overview is active 2018-07-19 12:59:54 +02:00
Tor Hedin Brønner 5e89005a5d Set a max width for tiled windows 2018-07-19 10:31:17 +02:00
Tor Hedin Brønner cea275d222 Guard against moving windows while changing monitors 2018-07-19 10:31:17 +02:00
Tor Hedin Brønner 371b9f2c0e spaces: rebuild the stack on monitors-changed 2018-07-19 10:31:17 +02:00
Tor Hedin Brønner a2b5a26838 Expose the workspace preview in Tiling.inPreview
Might not be ideal, but having it on spaces can cause trouble if ensureVievport
is called before spaces is constructed fully.
2018-07-18 23:08:23 +02:00
Tor Hedin Brønner 07ab295d28 Add move functionality to spaces.selectSpace 2018-07-18 23:08:23 +02:00
Tor Hedin Brønner 222421d694 Insert new windows into the correct space when navigating 2018-07-18 23:08:23 +02:00
Tor Hedin Brønner 1529fd86f4 switch-first/last: Integrate properly into the navigator 2018-07-18 22:37:34 +02:00
Tor Hedin Brønner 73b028e423 Apply actions to the correct space 2018-07-18 22:37:34 +02:00
Tor Hedin Brønner 0ed2cd32bf Refactor workspace selection from navigator to spaces
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.
2018-07-18 22:37:34 +02:00
Tor Hedin Brønner b7eda1957d Move switch-workspace handling to Spaces 2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner 39e0a68d3c Refactor switch-next/previous 2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner 61290f142d Prepare for navigator refactor + refactor switch-left/right/up/down 2018-07-18 22:37:34 +02:00
Tor Hedin Brønner fc260da22d Consistently declare and use screen and display
Makes things shorter and removes language warnings of using undeclared
variables.
2018-07-12 16:14:26 +02:00
Tor Hedin Brønner d41d6b9033 Fix duplicate workspace settings
Simplyfy things by storing all workspace settings from the get go.
2018-07-11 18:47:56 +02:00
Tor Hedin Brønner 55c6b60803 Add settings UI with workspace controls and gap and margin spinners
`Settings.ui` is built with and can be inpsected with Glade.
2018-07-11 18:47:56 +02:00