Commit Graph
366 Commits
Author SHA1 Message Date
Ole Jørgen Brønner 51fd7c1930 Set workspace name utility function
Arguments ordered for convenience for now since the repl is the UI atm.
2017-10-29 11:39:04 +01:00
Ole Jørgen Brønner f2ef36ed87 Sync workspace names on workspace-removed
Since workspace names are associated by index the list need adjustment when a
workspace in the middle of the list is removed. (dynamic workspaces)
2017-10-28 22:11:33 +02:00
Tor Hedin Brønner c18190c3a4 Make spaces local
`var spaces = Tiling.spaces` in minimap.js doesn't work for some reason.
2017-10-28 01:37:22 +02:00
Tor Hedin Brønner a72767bfd2 Make primary local
We want to reference primary through `Tiling` as it can change on
`monitors-changed`.
2017-10-27 21:47:29 +02:00
Tor Hedin Brønner fb360b5695 Everything but primary and spaces should be local now 2017-10-27 21:32:18 +02:00
Tor Hedin Brønner d8e6cb32ad Make debug local
Add `Extension` and `debug` to all the module scopes for convenience.

(also add var to non-used function)
2017-10-27 21:23:46 +02:00
Tor Hedin Brønner d9d3ab3241 Make stack_margin local 2017-10-27 21:16:32 +02:00
Tor Hedin Brønner 1a4e2271f3 Add owner object to as_key_handler
Some more globals that can go away :)
2017-10-27 21:12:36 +02:00
Tor Hedin Brønner e260fc25b7 Always pass an owner object to dynamic_function_ref
This way we can remove a bunch more globally declared variables.
2017-10-27 21:03:53 +02:00
Tor Hedin Brønner bfb4414cb9 Make most globals module local
Functions which are called from signals is left alone for now since
`dynamic_function_ref` depends on looking up things in `window`. `debug` is
also still a global.
2017-10-27 19:55:15 +02:00
Tor Hedin Brønner 5eba2cbe87 Fix hanging re-enabling in 3.26
Seems like init is only called once in 3.26, so enable will be recalled, which
kills the actionIds. This 'fixes' the problem.
2017-10-27 19:24:41 +02:00
Tor Hedin Brønner 0539a87ac1 Use a proper Map to store spaces 2017-10-26 13:50:10 +02:00
Tor Hedin Brønner 5306e6c1e4 Add minimap padding 2017-10-26 13:17:08 +02:00
Tor Hedin Brønner ee4b30f90c Don't look up workspace_index on _previewWorkspace
fixes #38 Removing workspaces while the multimap is active can cause crashing
2017-10-25 18:50:30 +02:00
Tor Hedin Brønner faf15c1ceb Index spaces with workspace instead of workspace_index
PreviewedWindowNavigator used `spaces.length` and the multimap used
`spaces.forEach` when using stable workspace order. That should be the last
usage of `spaces` as an array.

At the moment this doesn't improve things much as array indexing worked before.
And the multimap will still crash gnome-shell when going to removed workspaces.
2017-10-25 17:01:32 +02:00
Tor Hedin Brønner 687c541e04 Add spaces.spaceOf as an abstraction over spaces[index]
This sets us up to use a hash map instead of an array of spaces, which is much
more robust since `workspace_index` isn't well suited as an identifier for a
workspace.
2017-10-25 17:01:32 +02:00
Tor Hedin Brønner dd5545d3c7 Move spaceOf to spaces.spaceOfWindow 2017-10-25 17:01:32 +02:00
Tor Hedin Brønner 3f106cb559 Make spaces an object which can handle eg. adding/removing spaces 2017-10-25 17:00:39 +02:00
Tor Hedin Brønner 0af2f199d3 Force ensure on maximize 2017-10-25 14:20:08 +02:00
Tor Hedin Brønner 62ff5001ce Support dynamic workspaces
Fixes #35

Use n-workspaces signal to create/destroy new workspaces.

We're still using the workspace_index to lookup spaces. But indexes line up
since we're removing the space at index n when the workspace with index n was
removed.
2017-10-24 14:24:56 +02:00
Tor Hedin Brønner 63dd855fbb Fix the multimap when moving a window from/to an empty workspace 2017-10-23 20:39:16 +02:00
Tor Hedin Brønner 4f6330c025 Always force previewWorkspaceDone on finished alt tab
If we've previewed a workspace and then move onto another window in the same
workspace `_finish` will trigger a new workspace animation that we aren't
cancelling.
2017-10-23 11:53:41 +02:00
Tor Hedin Brønner 83ef703e3e Use the frame coordinates for fullscreen windows
(0, 0) is only correct if the monitor is aligned with the screen origin.
2017-10-22 14:14:13 +02:00
Tor Hedin Brønner 68389af07d Position maximized windows properly
We can just take the coordinates from the frame since it's not possible to
actually move a maximized window.
2017-10-22 14:08:18 +02:00
Ole Jørgen Brønner 2021b584e4 Put scratch windows first in LiveAltTab (when scratch is active)
(in scratch windwo MRU order of course)

Ideally the scratch layer would somehow mutate the MRU itself on
activation, but it seems the only way to do this is to actually focus
the windows in turn. That might be slowish(?) and also messes with the
stacking order (I think). Ie. would need to restore the stacking order
after doing the focus dance.
2017-10-19 18:16:57 +02:00
Tor Hedin Brønner 9824bae0f4 Move window-added/remove signal connection to Space
Cleaner and makes it obvious to store the signal id on the space.
2017-10-19 16:33:45 +02:00
Ole Jørgen Brønner e956a0d2b5 Load ~/.config/paperwm-rc.js if present 2017-10-19 15:06:37 +02:00
Ole Jørgen Brønner bd8f2c6fee Keep an explicit "isStacked" flag on metawindows + stackoverlay fixes
onCompleted of the tween of the active window didn't always finish before all
other windows was done animating (seemingly at least). This caused a wrong
overlay position/width since it used `is_scaled` to find the top of the stack.

In general it's probably useful to be able to know which windows are stacked
before animations are done. Windows might be scaled for other reasons too.

Also fixes a bug where the left overlay was active even though the neighbor
fully obscured the left stack. (that caused a small region of the left most
unstacked window to unresponsive). (due to setting negative width being a noop)
2017-10-19 14:51:46 +02:00
Tor Hedin Brønner b68e79e372 Revert "Make the stack protrude the same amount on the right as left"
This reverts commit 3e8415f104.

This wasn't actually correct.
2017-10-19 11:57:33 +02:00
Ole Jørgen Brønner eb9ac72d4c Reset pivot point of ensured windows
Certain gnome-shell/mutter animations expect default pivot point.
Fullscreen for example looks weird with other pivot points.

It would be more correct to reset pivot point of all non-stacked
windows, but it's unlikely that eg. fullscreen animation will be
triggered on a window that hasn't been ensured since focus calls
ensure.

NB: Resetting before the tween is done causes subtle artifacts if the
window is stacked to begin with.
2017-10-18 23:54:08 +02:00
Tor Hedin Brønner 6e24596a42 Use staggered scaling when folding the minimaps 2017-10-18 19:09:23 +02:00
Ole Jørgen Brønner 1031767832 Naming: More descriptive name 2017-10-18 15:54:25 +02:00
Ole Jørgen Brønner df85ba89c6 Workspace labels in multimap 2017-10-18 15:16:29 +02:00
Ole Jørgen Brønner 69f456d1fb Bugfix: this/that 2017-10-18 13:40:55 +02:00
Tor Hedin Brønner 78fd7c4e66 Never move windows that are fully visible 2017-10-18 13:35:57 +02:00
Tor Hedin Brønner 79359d7ffb Use exact pixels for the width and height of minimap selection
Floating point width can cause the right border to become smaller than
intended.
2017-10-18 13:35:57 +02:00
Ole Jørgen Brønner 037a3394fb Size and position stack overlay exactly above the _visible_ portion of the stack
We have to do this since mutter/gnome-shell does not account for stacking order
when handling mouse input. Ie. the overlay region ask to receive mouse input
from mutter. It does this even when it's below a window actor. (Only affects
X11, not wayland)
2017-10-18 13:27:13 +02:00
Ole Jørgen Brønner e84e2d93e3 Working stackoverlay (incl. semi-broken icon support)
Turned out to be a bit more difficult than expected to make icons
visually pleasing. Mainly during animations. Icons are thus disabled.

Problems:
- The overlay prevents the cursor from changing shape to "resize" when
  hovering the left/right side of the left/right-most non-stacked
  window. It still works to resize though.
- Icon support semi-broken and ugly during transitions.

Ref: #10
2017-10-18 13:27:13 +02:00
Ole Jørgen Brønner 8a63404c1e Proof of concept: stackoverlay
Some code to manually create overlays

Ref: #10
2017-10-18 13:27:13 +02:00
Tor Hedin Brønner 46bb92240a Animate the label width in the minimap
Need to make a new label every time so that we can access the required width to
display the whole text.
2017-10-18 11:49:20 +02:00
Tor Hedin Brønner 3e8415f104 Make the stack protrude the same amount on the right as left
There's `clone.length` - `around` windows to the right of `around`.
2017-10-18 10:16:03 +02:00
Tor Hedin Brønner 79d65273b3 Select the whole viewport with chrome on empty workspace 2017-10-18 10:04:37 +02:00
Tor Hedin Brønner aca9d73c47 Actually scale the minimap background instead of setting size 2017-10-18 09:24:30 +02:00
Ole Jørgen Brønner 2af91c789d Notes: clutter/mutter input tracking gotchas 2017-10-18 03:10:00 +02:00
Tor Hedin Brønner 934286db1f Label on bottom with increased minimap height
Also put the border chrome on the minimap wrappers
2017-10-17 18:43:44 +02:00
Ole Jørgen Brønner 241a46c999 Prototype: Add a window label to selection-chrome in minimap/multimap
Also increased the minimap scale - otherwise there's almost no space for the
label.
2017-10-16 22:02:08 +02:00
Ole Jørgen Brønner 340b8201dd Notes: z-index/stacking 2017-10-16 18:58:03 +02:00
Ole Jørgen Brønner 31a14520ea Support most of our own actions in "supermode"
As a consequence the metawindows now keep track of their destination
when animated by `move_to`.

Ideally the minimap/multimap should listen for changes to the space
and react accordingly instead of doing a manual sync like this.

"most actions" means actions that is registered as PER_WINDOW and
doesn't mutate the space.
2017-10-16 07:49:53 +02:00
Ole Jørgen Brønner 32ff62d59b Keybinding actions: Keep track of action handler (+refactor)
Mutter don't share that info(??)

In anticipation of supporting more actions in "supermode".
2017-10-16 07:17:32 +02:00
Ole Jørgen Brønner ee3fe3433b Cleanup: Remove actors argument from Minimap.layout
Unlikely that we'll need to specify anything else. Direct motivation
was to make it less awkward to layout after external changes trying to
integrate resize actions with "supermode".
2017-10-16 05:54:32 +02:00