Commit Graph
339 Commits
Author SHA1 Message Date
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
Ole Jørgen Brønner f0741fe543 New action: simple tiling of all partially visible windows
Tentative keybinding: <super>t

Probably need some more work to be useful: Almost fully hidden windows
should probably be excluded for instance. Could also utilize
minimum-width per window-class, historic window size, heuristics to
determine how many of the windows to tile.

The name could be better since we're always tiled in some sense.
"distribute", "reallocate", etc.

Might be that a `tile-neighbour`[1] is better, or that a couple more
resize commands would make it quick enough to allocate space more
manually:
- `expand-width`: increase the the width of the current window by the
   amount available from partially visible windows. If/when we make
   resize commands work in "super-mode" one could quickly reallocate
   space without messing up the MRU list too.
- `slurp`: squeeze the fist partially visible window fully into the
   view port, probably stealing at least some space from the existing
   windows.

[1] need two bindings though
2017-10-15 15:59:28 +02:00
Ole Jørgen Brønner 758103d263 Don't move ensured window if it's already fully visible
This avoids situations such as when two windows are tiled, both fully
visible, but in sum a bit too wide to fulfill `minimumMargin` on both
sides. Then switching between them cause movement each time.

Could arguably be solved by setting minimumMargin to ~0 but that has
other effects too.

Note: intentionally ignored the case when _all_ windows are fully
visible. In that case we allow movement.

Note: Assumes window is on primary display
2017-10-15 00:33:03 +02:00
Ole Jørgen Brønner c335cb68a7 New action: cycle-width
Cycle through 3 predefined window widths

Note: if we made this a mini mode, maybe 'center' could be the first
state we cycle through? Without a mode it becomes a bit annoying to
keep track of which state we're in. eg. need to remember the original
size to cycle properly.
2017-10-14 23:54:47 +02:00
Tor Hedin Brønner daad98a383 Use the actual background for minimap backgrounds
Setting `vignette` to true gives the same dimmed lightbulb effect as on the
overview, which is a possibly a better default.
2017-10-13 13:56:05 +02:00
Tor Hedin Brønner e21b19d315 Only set space.moving on ensure_viewport
This fixes a bug where new windows sometimes gets the wrong initial position.
2017-10-13 13:54:59 +02:00
Tor Hedin Brønner 29b62fba83 Show all windows in the stack while folding
The gaps are calculated assuming that all windows but the selected one is part
of the stack, which isn't fully correct, but a decent approximation.
2017-10-12 22:13:23 +02:00
Tor Hedin Brønner 5cbe18f322 Increase the gap size in the minimap
A more robust solution would be to take the increased gap size out of the
clones' size by applying the necessary scaling. Leaving the clone
container at the same scale as the minimap viewport will then make coordinates
from the original windows translate properly.
2017-10-12 20:34:00 +02:00
Ole Jørgen Brønner 78aa4ad46c Calculate selection chrome coordinate transformation manually
For some reason apply_relative_transform_to_point didn't work when changing
workspace. (the _first_ workspace switch when going from only one minimap
visible to all visible)

Even when adjusting for destintationX of minimapActor.. Not really sure why, so
this isn't the most satisfying fix.

A manual transform would be needed if there's multiple actors in the ancestor
chain that is animating though. (ie. to account for destinationX instead of x)
2017-10-12 20:00:04 +02:00
Ole Jørgen Brønner 2c9036deee Base sync on destinationX of clone
No known problems with using plain x, but destinationX is more correct
2017-10-12 20:00:04 +02:00
Tor Hedin Brønner 0be793d08e Update selection highlighting when reording windows 2017-10-12 20:00:04 +02:00
Tor Hedin Brønner d35e5fd1ea Add padding to the minimap wrappers 2017-10-12 20:00:04 +02:00
Tor Hedin Brønner ad94a2256e Add window selection highlighting to the mulitmap 2017-10-12 20:00:04 +02:00
Ole Jørgen Brønner c6f41de0b8 WindowNavigator: Make sure _select is called initially when switching workspace
Omitting this has no ill-effect currently, but in the selectionChrome branch[1]
it results in an empty selection when switching to a workspace out of bounds.

[1] 29d2cdfede0172ea4b420e9cae626a8c5f1bc203
2017-10-12 12:56:36 +02:00
Tor Hedin Brønner b0ed1bec69 Refactor selectSpace(direction, move) out of _doAction 2017-10-12 07:39:22 +02:00
Tor Hedin Brønner 091e83fedd Make Minimap global to enable dynamic re-eval 2017-10-11 22:51:12 +02:00
Tor Hedin Brønner 06e974add6 Minimap: set non-scaled clones above
Fixes scaled windows hiding windows on the viewport.
2017-10-11 22:46:03 +02:00
Tor Hedin Brønner 08f7a9462b Basic window moving between workspaces
Issue: Moving the window isn't actually animated in the multimap.

Note, for some reason doing an ensure on the selectedWindow makes it visible
while we preview the workspace.
2017-10-11 02:43:00 +02:00
Tor Hedin Brønner 1bfab13ddd When changing workspace use _select to ensure the new selected window
This fixes eg. top bar visibility when going from a fullscreen window to a
non-fullscreen window.
2017-10-11 02:05:37 +02:00
Ole Jørgen Brønner 854de22289 Make sure the moving window is on top (in minimap) 2017-10-10 21:31:50 +02:00
Ole Jørgen Brønner e76687b248 Reordering in minimap
Ref: ffdc032e70 (needed to not screw animations
up)
2017-10-10 21:25:37 +02:00
Ole Jørgen Brønner ffdc032e70 Don't relayout the minimap on "allocation-change"
This signal is triggered way too often and there is no realistic scenarios where
its needed atm. (window's doesn't change size at will)
2017-10-10 20:40:46 +02:00
Tor Hedin Brønner 8884617818 Position the minimap around the selected window clone
This fixes the wrong initial position of unselected minimaps (ie. where
ensure_viewport haven't run yet), and won't animate the very start.
2017-10-10 18:24:06 +02:00
Tor Hedin Brønner c774de350f Refactor the Minimap into a proper class
We now recreate the minimaps instead of having the spaces point to them.
2017-10-10 18:23:40 +02:00
Ole Jørgen Brønner dc72257349 Minor refactor Minimap: make helper function non-destructive 2017-10-09 19:53:38 +02:00
Ole Jørgen Brønner c36960f973 Remove redundant MultiMap/switcherlist property 2017-10-09 19:23:23 +02:00
Ole Jørgen Brønner 88e21c353a Enable navigating from empty workspaces
Also allow an empty workspace to be the top mru item. "Non-top" empty workspaces
will always be at the bottom due to how we build the mru list.
2017-10-09 19:09:38 +02:00
Ole Jørgen Brønner 69f817764c Remove unused function 2017-10-09 18:55:19 +02:00