Commit Graph
426 Commits
Author SHA1 Message Date
Tor Hedin Brønner 9dce8f363c setInitialPosition: Always set the initial position for new windows
Since it's too early to set the position on `window-added` we do it in
`setInitialPosition` when the window actor is known to exist.
2018-02-07 18:25:48 +01:00
Tor Hedin Brønner f811dfdb33 More robust init guard
`initCount` would be reset when reloading `extension.js`, this change should
handle those cases.
2018-02-05 23:08:58 +01:00
Tor Hedin Brønner ec5c54bb49 Fix broken alt-tab binding after gdm lock
For some reason locking the screen with GDM kills the live-alt-tab binding.
2018-02-05 17:54:47 +01:00
Tor Hedin Brønner 32a53002f5 ad-hoc height fix: maximize height on ensure
This makes things usable on wayland.
2018-02-03 18:12:48 +01:00
Tor Hedin Brønner b1b5ce8f9a Avoid crashing on wayland
Resizing `MetaWindowWayland` typed windows this early causes gnome shell to
crash.
2018-02-03 17:52:14 +01:00
Tor Hedin Brønner d9af00df4a Fix typo 2018-02-03 10:46:41 +01:00
Tor Hedin Brønner 4e04bf0902 stackoverlay: 0 is falsy so can't use ||
If destinationX is `0` it will incorrectly be regarded as false.
2018-02-01 12:26:53 +01:00
Tor Hedin Brønner 78449a9f28 Fix complaints about negative width in the logs 2018-02-01 12:06:38 +01:00
Tor Hedin Brønner 44ce70b820 stackoverlay: Enable fast clicking on edges
With the two previous commits we can now safely remove the `restacked` signal
watching. For some reason watching the signal is this way blocks clicks while things are
moving.

So now it's possible to eg. doubleclick on the left/right edge and jump
two places.
2018-02-01 07:52:47 +01:00
Tor Hedin Brønner f6d9429dbc stackoverlay: Use destination when deciding stack placement 2018-02-01 07:40:11 +01:00
Tor Hedin Brønner 96d422fe65 Update the stack overlay before animation
We set the target after setting starting all animations so the calculations are
correct, though this doesn't seem to work for some reason.
2018-01-31 17:31:54 +01:00
Tor Hedin Brønner 79245c09d8 Remove ad-hoc stack level fix
This is no longer necessary as we now raise windows when we know if they will be
visible after animation, which is much better than after animation is finished.
2018-01-31 17:31:54 +01:00
Tor Hedin Brønner 019f997c24 Move left/right stack logic to ensure and propagate functions
When we propagate the position forward/backward we check the desired position
against the left/right limits and stack the rest of the windows if it's the
case.

This also fixes the stack performance issue in a cleaner way. We simply raise
all non-stacked windows while propagating, instead of doing a fix-up afterwards.
2018-01-31 17:31:07 +01:00
Tor Hedin Brønner 6af4314e14 Add stackWindow function
Make it easy to move left/right stacking out of `move`.
2018-01-31 16:25:54 +01:00
Tor Hedin Brønner a894552439 workspace preview: Don't imply a specific spatial layout
When navigating workspaces in mru order animating the workspaces based on the
mru order gives a false sense of spatiallity. Instead simply animate the
previewed workspace from the bottom and animate the last workspace down.
2018-01-31 14:25:53 +01:00
Tor Hedin Brønner b338f7372e fixStackLevels: Handle empty right stacks
When the right stack was empty the former function wouldn't loop to and raise the
last visible window.
2018-01-31 07:43:26 +01:00
Tor Hedin Brønner a3e597b36c Refactor fixStackLevels out of ensure_viewport 2018-01-31 07:37:57 +01:00
Tor Hedin Brønner 60fd6876de topOfRight/LeftStack: Don't depend on selectedWindow
`selectedWindow` isn't necessarily a visible window, eg. when we're doing
previews, so just do a search from the start/end up until we find the last
stackd window.
2018-01-30 19:12:28 +01:00
Tor Hedin Brønner 2072aac18a performance: Minimize lower/raise calls
The bottleneck when calling ensure seems to be calling lower on every window on
the left/right stack.

This is a quick fix, where we simply call raise on the top of the left/right
stack, and the visible windows.

A consequence of this change is the left/right stacks might be above a visible
window for a short time, but it's not very noticeable.
2018-01-30 19:11:59 +01:00
Tor Hedin Brønner 73d59c2d0f Use easeOutQuad curve when bringing windows into view
If an animation needs to wait for a window covering it to move it should start
out fast.
2018-01-18 02:54:00 +01:00
Tor Hedin Brønner c222ed7590 dual monitor: Enable moving windows to shared monitors
When there's only workspaces on the primary display, moving a window to another
monitor makes it `stick`. In the past this would make it part of the scratch
layer, but that's not the case anymore, so it would just be detached and
attached to the workspace again.

This makes it possible to simply drag a window from a space into another monitor
and it will detach and float on the monitor.
2018-01-11 14:11:55 +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 ba0642acd0 liveAltTab: Only show scratch windows when scratch layer is focused 2018-01-10 21:51:03 +01:00
Tor Hedin Brønner 56708fee15 Super+n: Global new window binding
Add a new window action, bound to Super+n by default. This clashes with the
`focus-active-notification` so we kill it.

Schema change!
2018-01-10 10:00:03 +01:00
Tor Hedin Brønner 06ca7eecaa Pass settings object to killKeybinding
Restoration require the same settings object to be available due to the use of
Map. Indexing on the canonical name of the schema is probably a better solution.
2018-01-10 09:59:10 +01:00
Tor Hedin Brønner 43b26611bd Fix typo 2018-01-10 09:59:10 +01:00
Tor Hedin Brønner 8bc50b4eb1 liveAltTab: Always clean up any clone 2018-01-07 10:12:37 +01:00
Tor Hedin Brønner 059cd66067 liveAltTab: Add live previews of scratch windows
Make a clone of pseudo focused scratch windows which gets pushed to the
top (Can't use raise as it would mutate the stack level).
2018-01-07 08:34:50 +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 6510a78745 Move add window logic to add_filter
add_all_from_workspace needs the same logic as add_handler, so move it to the
common add_filter.

This fixes a regression from the last commit which caused scratch windows to
inserted in a space when restarting Gnome Shell.
2017-12-26 18:14:45 +01:00
Tor Hedin Brønner d15dbb0e99 Set always on top for new scratch windows
Also move unmake_above to insertWindow.
2017-12-26 14:54:25 +01:00
Tor Hedin Brønner 70ff3a24c0 New paged windows should never be on top
Windows on the stack should never be on top, windows not on the stack will never
overlap. Which means that alaways on top is never wanted for ordered windows.

The issue is noticed when attaching a scratch window to the page strip, as it
will continue to be always on top, making the stack overlap visible windows.
2017-12-19 15:37:27 +01:00
Tor Hedin Brønner 3d2e86fe11 Use custom action for live alt tab
We kill the regular actions which uses super-tab (and super above_tab, which is
strictly not necessary).

NB: Require schema compilation.
2017-12-08 09:44:03 +01:00
Tor Hedin Brønner 33dd6932d3 Add kill and restore binding functions
This isn't fully robust as a crash will lose user set values. A solution would
be to store the user values in gsettings as not to lose them.
2017-12-08 09:43:44 +01:00
Tor Hedin Brønner 2898fb2062 bindings: Add arrow keybindings
Super-right/left to switch to the next/previous window. Same with moving the
window.

Of course these keys are already taken so might not work.
2017-12-08 07:31:55 +01:00
Tor Hedin Brønner 15e7f470cb Reset monitors-changed signal on reload 2017-12-06 12:30:10 +01:00
Tor Hedin Brønner 984791d6b7 Make paperActions non global 2017-12-05 01:59:22 +01:00
Tor Hedin Brønner 185b5a867d Move window.paperActions into init()
Since it's not possible to reload action registration it's better to have it in
init where it will never run more than once.
2017-12-05 01:20:02 +01:00
Tor Hedin Brønner 921675dc69 Remove obsolete panelBox hide signal
This didn't get included in 9638c04cae for some
reason.
2017-12-04 21:49:30 +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 9638c04cae panelBox: disconnect signals and reset scale on disable 2017-12-01 22:29:11 +01:00
Tor Hedin Brønner 135b83d6be disable/enable: Move Tiling specific enable/disable to its own module
Use module.enable/disable.
2017-12-01 22:21:44 +01:00
Tor Hedin Brønner 1ef583dfd1 disable/enable: Fully disable stackoverlays
Also just have an enable/disable function in the stackoverlay module.
2017-12-01 21:23:13 +01:00
Tor Hedin Brønner 01a1b8428f Use custom actions for workspace movement
Since we're using mru order on the workspaces it's cleaner to just use our own
actions. In addition this might make it easier to handle enable/disable by
blanking the bindings on disable (not sure if it's possible to set the bindings
without touching dconf/gsettings though).

Schema change, so require recompilation.
2017-12-01 07:52:35 +01:00
Tor Hedin Brønner 4a8b2bb045 Move binding registration to init as there's no way to disable
As far as I know there's no to disable a custom key handler, so it makes sense
to do this in init which is meant to be run only once.
2017-12-01 06:58:49 +01:00
Tor Hedin Brønner 2030138ee7 disable: Disconnect the stack overlays 2017-12-01 06:58:49 +01:00
Tor Hedin Brønner 1fbd12a71e Move screen/display connection back to enable
We need to reconnect on enable, so it's more convenient this way.
2017-12-01 06:58:49 +01:00
Tor Hedin Brønner b4e0858fde disable: Minimal implementation
Adds a enable switch to ensure we never run enable twice in a row. Bindings
aren't disabled yet so we still need the initCount check for those.
2017-12-01 06:58:49 +01:00