Commit Graph

47 Commits

Author SHA1 Message Date
Tor Hedin Brønner
bc6e4da22f clickoverlays: don't show while the overview is active
fixes #72
2018-07-18 13:49:02 +02:00
Tor Hedin Brønner
a605dc4668 Clip tiled window actors to the monitor
fixes #61
2018-07-04 20:47:04 +02:00
Tor Hedin Brønner
2f27acc789 Hide clickoverlays when showing the overview 2018-07-03 00:08:40 +02:00
Tor Hedin Brønner
3548f219a2 Rename prefs.js to settings.js
prefs.js causes issues as its used to lauch the settings gui from eg. tweaks.
2018-07-02 22:31:55 +02:00
Tor Hedin Brønner
8e67ac3c49 Animate the cloneContainer instead of the clones
The cloneContainer now lives inside a `cloneClip` clipping the cloneContainer
correctly when previewing workspaces.

`ensureViewport` and `move_to` simply moves the scrollContainer instead of
laying out all the clones. The actual windows are only synced up with the clones
position on `Space.moveDone`. Space.layout is run when the actualy clone layout
changes, eg. when a window changes size, or a window is added to the tiling.

`move_to` also computes the windows that should show their MetaWindowActor on
`moveDone` and sets up the clickoverlays at the edges correctly.

`space.cloneContainer`s animation target can be looked at `space.targetX`.
2018-07-02 15:01:03 +02:00
Tor Hedin Brønner
f783a56940 Ovelays are no longer in the window_group, so don't bother raising 2018-06-30 12:01:06 +02:00
Tor Hedin Brønner
3f381b0c5f edge overlays: Add overlays to the uiGroup
There's no reason to deal with stacking problems of the window_group
2018-06-29 13:56:06 +02:00
Tor Hedin Brønner
f011c6e0e9 Cleanup and some comments 2018-06-27 11:28:23 +02:00
Tor Hedin Brønner
be15267cb0 Track monitor overlay 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner
b48ed8b2bd Activate workspace with focus when the mouse enters a monitor 2018-06-27 10:22:07 +02:00
Tor Hedin Brønner
ccc6249283 edge-overlays: Always cover the gap when targets are almost hidden
Instead of removing the gap when we're dealing with fullscreen or maximized
windows we remove it when the overlay is wider than 75 pixels.

Also fully cover all windows that aren't marked as `visible` by the space.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner
a7cc11107f edge-overlays: setTarget(metaWindow) -> setTarget(space, index)
Let the edge-overlays act on columns.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner
fc3628bad4 Refactor space into an array of columns
This sets us up for supporting vertical tiling.
2018-06-25 16:50:43 +02:00
Tor Hedin Brønner
ff17aa1aa3 clickoverlays: destroy any lingering previews on disable 2018-06-17 11:28:57 +02:00
Tor Hedin Brønner
f6c12ae55d clickoverlays: show a preview on hover 2018-06-05 21:23:42 +02:00
Tor Hedin Brønner
5827606a63 Constrain clickoverlays to 75 pixel width
We only replace windows with clones when their position isn't possible, ie. when
they're less than 75 pixels inside the space, they're maximized or fullescreen.

The clickoverlays is now mostly decoupled from the visible status of the window
actor. They now always target the first window with an edge outside the
monitor. The width however is limited to 75 pixels (unless the window isn't
visible) making eg. drag and drop and drop possible while edge clicking will
never send input to the window.

The clickoverlays will now also span the window gap which makes it possible to
click on windows that's just off the monitor.
2018-06-03 14:21:18 +02:00
Tor Hedin Brønner
632ff93ce7 Hide the clickoverlay when unwanted, show again on focus
This should fix the issues with the clickoverlay and the scratch layer, where
the overlay would be inactive after closing the scratch layer.
2018-06-03 00:49:49 +02:00
Tor Hedin Brønner
e0f2d4b12b Fix stupid typo 2018-05-15 19:58:09 +02:00
Tor Hedin Brønner
6942df947f Monitor preference changes
Introduces `prefs.js` with simple `settings::change` signal handling.

Also put workspace colors in the schema and draw them from there.
2018-05-15 16:31:01 +02:00
Tor Hedin Brønner
8dd4fcb82d ClickOverlay: Use button-press-event to activate windows
More reponsive than release
2018-05-08 12:19:09 +02:00
Tor Hedin Brønner
4297c8a6e2 Replace metaWindow.destinationX with moving windows pre-animation
Had to reorder setting the click overlay targets after calling `move`.
2018-05-01 15:40:11 +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
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
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
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
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
b42adca37c Always cover fullscreen windows in stackoverlay 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
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
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
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
2030138ee7 disable: Disconnect the stack overlays 2017-12-01 06:58:49 +01: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
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
dd5545d3c7 Move spaceOf to spaces.spaceOfWindow 2017-10-25 17:01:32 +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
Ole Jørgen Brønner
69f456d1fb Bugfix: this/that 2017-10-18 13:40:55 +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