Commit Graph
623 Commits
Author SHA1 Message Date
Tor Hedin Brønner bb22c4ed52 Don't check for pointer warping if we haven't changed monitors
This seems to make `switchWorkspace` animation a bit smoother.
2018-04-30 17:18:45 +02:00
Tor Hedin Brønner 24e8f5534c switchWorkspace: correctly filter out only visible spaces 2018-04-30 17:18:45 +02:00
Tor Hedin Brønner aed3646be2 Extend windows to the bottom of the monitor 2018-04-30 17:18:45 +02:00
Tor Hedin Brønner 2dfbd6edea Add an explicit background actor
We add a `space.actor` to hold background, cloneContainer and label. The
cloneContainer can then clip itself, letting the background have some horizontal
padding.

The background is also positioned somewhat above the monitor to avoid showing
anything through the upper corners.
2018-04-30 17:15:48 +02:00
Tor Hedin Brønner 77dd7438b3 Substitute all windows which protrude from the monitor with a clone
This will prevent tiled windows protruding into other monitors.

It's not completely ideal, but it does the job.
2018-04-30 00:04:27 +02:00
Tor Hedin Brønner 20a9d40fc3 Add a maximum width constraint on windows 2018-04-30 00:03:08 +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 c833998aae disable: Don't bother destroying clones as we'll destroy their parent
This removes a bunch of warnings.
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 cfc3235d92 Fix select workspace animation 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner c83f9590b0 Activate click overlays on startup/monitors-changed
We separate resetting the tiling overlay and activating/deactivating the monitor
click overlay.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner ffe533a172 Reset all ClickOverlays when we change monitors 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 4c794dfa9a Add pointer warping 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner f063bcfcd5 Activate the clickOverlay when switching workspace 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 a48e013395 Add ClickOverlay class 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner ddc0a29861 stackoverlay: Take monitor as an argument
Also place the left overlay correctly at monitor.x
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 870720e44d Share the workspace stack between monitors
We move and scale the `space.clip`s to the active monitor. If we select a
workspace which came from another monitor we move it fully to the active monitor
with `space.setMonitor`.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner b3a395c051 Move windows that enter a monitor to the corresponding space
We only move windows with a visible WindowActor to avoid moving windows into
spaces that's positioned to the left or right.

Also replace all window actors with clones when monitors change to prevent
windows changing workspace when monitors are added or removed.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 73565eacd2 Add monitor -> space map 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 7af0142a7d Document monitor signal ordering 2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 04ba90b9cd Contain all spaces in their own clipping container
We create an actor spanning the whole screen, `Spaces.spaceContainer` which
holds all spaces. A `Space` is now first contained in a `Space.clip` container
which clips away anything that protrudes from the monitor.

The main advantage over having a per monitor clipping actor is getting
flexibility in moving a space around the screen without changing it's monitor.

We also hook up the `monitors-changed` signal, putting the active workpace on
the primary display, and populating the other monitors with the rest of the
workspace mru.

This also prevents a bug where we could end up moving a BackgroundActor.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner cce3341afd Use correct coordinates when animating windows
Adds a `Space.monitor` property, hard coded to the primary monitor for the
moment. `move` needs to know about which space it's moving windows on.

It seems that we really don't have to worry about scaling, as it mutter should
take care of it automatically.

fixes #47
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner aac8a07553 Don't set _isStacked on non inserted windows
This also means that ensureViewport(null, space) won't fail.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner 0fc371d1a7 Remove hard coded <super>Space binding 2018-04-29 23:59:23 +02:00
Tor Hedin Brønner 30fa4959c4 Bind <super>Escape to toggle scratch layer 2018-04-29 23:59:23 +02:00
Tor Hedin Brønner 92d5c112fb Use native mutter actions to override keybindings
This means that we won't kill keybindings on disable (which could be worked
around) or crashes (which would be much harder to work around).

NB: it's necessary to go into dconf and restore
`switch-applications[-backward]`, `switch-group[-backward]` to get the
keybindings working again.
2018-04-29 23:57:39 +02:00
Tor Hedin Brønner 58046addef Remove hardcoded margin and minimumMargin 2018-04-27 13:35:11 +02:00
Tor Hedin Brønner 06e3016da7 navigator: Only reset stackoverlay if we've switched workspace 2018-04-25 13:36:54 +02:00
Tor Hedin Brønner 4efc2fd8af Disable unredirect when switching workspaces 2018-04-25 13:36:44 +02:00
Tor Hedin Brønner f3ee5900ac super+ctrl+above_tab: Move the focused window through the scratch layer
If we're starting workspace navigation with `ctrl` lift the focused window into
the the scratch layer. When navigation is done, drop the lifted window into the
new workspace.
2018-04-25 10:36:57 +02:00
Tor Hedin Brønner 76d819b8f5 ensureViewport: Guard against maximized and fullscreened windows
Small bug where a maximized and fullscreened window would be positioned the
wrong way when navigating the workspace mru stack.
2018-04-24 13:07:39 +02:00
Tor Hedin Brønner 5b3bee5b82 navigator: fix regression
0a506605f broke abort when navigating within a space.
2018-04-24 09:46:13 +02:00
Tor Hedin Brønner e8e0853ed8 Fix stackoverlay code ordering
The stackoverlays are created on enable so will have access to all top level
variables in any modules.
2018-04-24 07:58:45 +02:00
Tor Hedin Brønner fc72f92c1e ensureViewport: remove pivot reset and onStart
These are no longer necessary
2018-04-24 07:53:24 +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 0a506605f4 navigator: Consolidate all finish handling in _onDestroy
This also fixes aborting to a blank workspace.
2018-04-23 11:15:56 +02:00
Tor Hedin Brønner d6fe710d07 Fix typo 2018-04-23 10:33:18 +02:00
Tor Hedin Brønner 95cff98230 Position and size the stackoverlay using gap and margin preferences
Extend it to the bottom of the screen so the bottom corners can be used to
switch windows though.
2018-04-23 09:25:25 +02:00
Tor Hedin Brønner d65f6a25e4 Treat maximized windows the same as fullscreen windows 2018-04-23 09:25:25 +02:00
Tor Hedin Brønner 07c598af0c navigator: fix escape when previewing the active workspace 2018-04-23 09:25:25 +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
Ole Jørgen Brønner 0e21d71d10 bin/debug: Ignore Tweener "has already been finalized" by brute force
Also force sed to use line buffering so we can grep the output interactively
2018-04-22 15:21:13 +02:00
Tor Hedin Brønner b42adca37c Always cover fullscreen windows in stackoverlay 2018-04-22 15:01:57 +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 6bd47b4bf4 Hook up the stackoverlay again
This also fixes an regression where the left/right decision would use the
wrong `destX` value.
2018-04-22 15:01:57 +02:00
Ole Jørgen Brønner e77f3fac79 Notes 2018-04-22 15:01:57 +02:00
Tor Hedin Brønner 722a684525 navigator: Initialize the space mru only when needed
Also use an explicit Tween to position a potential fullscreen window correctly
for the first space.
2018-04-22 15:01:57 +02:00
Tor Hedin Brønner 69898e8f55 Reduce the x clip on Space
When a fullscreen window was selected 1px of the neighbour edges was visible.
2018-04-22 15:01:57 +02:00
Tor Hedin Brønner fff958568d Use monitor relative coordinates in ensureViewport
The whole pipeline assumes coordinates being relative, correcting them back to
absolute coordinates in move.
2018-04-22 15:01:57 +02:00