Commit Graph
1000 Commits
Author SHA1 Message Date
Ole Jørgen Brønner da04d5526a Bugfix: Space.targetX was sometimes set to null
space.targetX = Math.round(clone.targetX) + ...  resulted in null when
clone.targetX was undefined. This could happend on extension startup and caused
the space to be unusable.

Initialize clone.targetX and remove duplicated space.targetX initialization.
2018-11-11 16:24:05 +01:00
ganthern 9ad6ee605d added default background to preferences UI 2018-11-04 19:01:01 +01:00
Tor Hedin Brønner b295e9d00d Add default-background preference
Not exposed in the preference ui yet.

Can be set with dconf or in `user.js` like this:

var settings = Extension.imports.convenience.getSettings();
settings.set_string('default-background', '/path/to/image.jpg');

ref #83
2018-10-19 11:16:36 +02:00
Tor Hedin Brønner 4b9c8df3ab background: Use 'zoom' style on picture wallpapers
Zoom is the default option in gnome when using pictures as the background image.
This is a much better default then what we've been using.

When using color backgrounds with noise we need to use the `wallpaper` style, as
the noise isn't designed for stretching.

ref #83
2018-10-19 10:43:02 +02:00
Tor Hedin Brønner 4dbc77de78 Only redirect newly created windows
When moving an existing window to another workspace via. eg. the overview we
shouldn't redirect it to the selected workspace.

fixes #82
2018-10-18 16:53:22 +02:00
Tor Hedin Brønner a0c352d085 Add shell.sh utility to run nested X11/wayland sessions
Runs X11 by default, pass in -w to run a wayland session. The dbus address is
copied to clipboard, so it's easy to connect to the new sesssion from emacs
using `gnome-shell-set-dbus-address`.

Depends on Xephyr in the case of x11, and xclip is used to copy the dbus
address.
2018-10-16 11:22:51 +02:00
Tor Hedin Brønner 3d6f2f9426 horizontal swipe: stop animation when starting a new swipe 2018-10-16 11:07:54 +02:00
Tor Hedin Brønner 00837ffbcc horizontal swipe: store state on space
Each space should have its own state, so that several spaces can be scrolled at
the same time.
2018-10-16 11:07:54 +02:00
Tor Hedin Brønner 3929fe9daf Add focus winprop option
Useful for eg. rofi in normal window mode in wayland.
2018-09-25 18:37:39 +02:00
Tor Hedin Brønner f4d2bc1fdd Select window under pointer when clicking on spaces 2018-09-21 13:02:13 +02:00
Tor Hedin Brønner 27a7f6439e Add window at point utility functions 2018-09-21 13:02:13 +02:00
Tor Hedin Brønner 0c7dc2fe03 Never redirect windows that are present on all workspaces 2018-09-21 11:25:55 +02:00
Tor Hedin Brønner f6d45a0eba Delay redirecting new windows to a previewed space
fixes #81
2018-09-19 22:00:30 +02:00
Tor Hedin Brønner 49479d5e4a Disconnect signals before destroying objects
This now causes an error
2018-09-19 18:56:26 +02:00
Tor Hedin Brønner 3d1a69980b fixup! 3.30: fix grab 2018-09-19 18:56:26 +02:00
Tor Hedin Brønner eeb4d5a887 3.30: fix grab
It seems that we're getting display twice as input to `grap-op-begin`.

In the gnome-shell source they're not doing this, but that might actually be a
bug.
2018-09-19 13:47:46 +02:00
Tor Hedin Brønner 14ab95a6f5 performance: Only show visible spaces in the workspace stack
Only 4 spaces are actually visible at the same time, so we hide all others to
improve fps.
2018-09-16 12:54:37 +02:00
Tor Hedin Brønner 73ac480f39 Get rid of the ugly spaces._yPositions 2018-09-16 12:54:37 +02:00
Ole Jørgen Brønner af9c12cabe Hide space actors initially
This prevents triggering the performance bug fixed in c439124dc and 04a219f6d on
startup/reload.
2018-09-15 23:01:56 +02:00
Tor Hedin Brønner 04a219f6df animateToSpace: Split up animation and hiding of spaces
The code here tried to serve two purposes, animating spaces above the newly
selected space and hiding spaces that would no longer be visible. Hiding
probably never worked as the loop wouldn't touch all spaces.

We split it up properly, fixing the performance bug mentioned in the parent.
While properly handling animation on its own.
2018-09-15 19:42:46 +02:00
Ole Jørgen Brønner c439124dc8 Bugfix: non-active spaces was not hidden on ending animation
Due to `to.clip` being the top actor combined with ClutterActor.get_next_sibling
returning null for top actors. (ie. it doesn't wrap)

Iterate to the spaces instead of using get_previous_sibling to avoid subtle
dependency on `to` being the top.

This bug cased a quite large performance drop. Clutter FPS halved on my
setup (10+ workspaces) during certain operations.
2018-09-15 17:34:52 +02:00
Ole Jørgen Brønner 37a2d6f52e Notes about getting the clutter FPS 2018-09-15 16:26:42 +02:00
Ole Jørgen Brønner 1752adf3b9 Bugfix: Barfing the bottom window when active mixed up focus
Reproduction:

Focus window A
Slurp (vert. tiles window B)
Go to window B
Barf (untiles B vert.)

B has focus, but is not selected.

Happens because removeWindow ensures a window is selected, but addWindow doesn't
select the added window (which both makes sense).
2018-09-15 14:17:44 +02:00
Tor Hedin Brønner c5d80dcdcf horizontal scroll: Use proper coordinates to select a window
This makes selection correct when the space is scaled.
2018-09-14 17:11:01 +02:00
Tor Hedin Brønner 94a15d191f resizeHandler: fix coordinates
This makes resize work correctly on all monitors.
2018-09-14 17:10:33 +02:00
Tor Hedin Brønner d287ba16d8 Refactor Space.fixOverlays from move_to
When using gestures we can end up with broken edge overlays, so we fix them on
moveDone.
2018-09-11 14:07:34 +02:00
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 f20518e1d1 readme: fix typo
closes #79
2018-09-06 17:08:59 +02:00
Tor Hedin Brønner 12bfc7eefe readme: note limitations around modals and dynamic workspaces 2018-09-05 10:47:58 +02:00
Ole Jørgen Brønner 62761ec4cc Respect XDG_CONFIG_HOME (user.js)
Fixes #78
2018-09-05 09:26:16 +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 96b9ac57fd Fix startup with already existing windows
Installing and enabling the extension didn't work, as some stuff accessed
`TopBar.menu` too early. This was a pretty bad bug, that was fixed, but then
reverted.
2018-08-31 02:07:37 +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 78740e76ce Disable the hot corner by default
Having the hot corner activate the overview works rather poorly with scrolling
through the workspaces.

We disable the functionality by default. The preference `override-hot-corner`
controls the functionality, so set it to false if you want it back.

A possibility is having the hot-corner force the top bar to be visible when
a fullscreen window has focus, but it's not yet implemented.
2018-08-28 01:24:04 +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