Commit Graph

60 Commits

Author SHA1 Message Date
Tor Hedin Brønner
5456036e69 edge: Put into window group
This fixes a rather annoying bug where we're not able to interact with windows
floating above the edge overlays. (doesn't work on X11 I think).

It also makes the interaction with a fixed dock on the edges better.
2019-02-14 16:30:59 +01:00
Tor Hedin Brønner
1c5f5d9bad pressure barrier: position on monitor edges until workarea is fixed 2019-02-12 23:52:47 +01:00
Tor Hedin Brønner
98ea1ccb9b edge: Allow moving the pointer to other monitors after pressure
Mostly taken from dash-to-dock.

We remove the edge barrier after pressure is triggered, allowing the pointer to
move across monitors.

ref #94
2019-02-12 21:23:15 +01:00
Tor Hedin Brønner
2546b0d9e3 edge overlays: On fullscreen, only show with applied pressure 2019-02-05 10:39:26 +01:00
Ole Jørgen Brønner
19dd7b7ea2 Prevent clicks from reaching non-placable windows (X11)
When window_gap is largish it was possible to click on the non-placable
metawindow (between the stackoverlay and the neigbour window) - triggering #80.

L: left non-placable (clone)
R: right non-placable (clone)
G: gap/2
A/B: placable window

LGGAA..BBBGGR

Allocate `LGG - "guaranteed-resize-edge-width"` to the stackoverlay to ensure
it's impossible to click on the non-placable window below.

Ideally we'd only allocate L or maybe LG to the overlay. Note: We could add
special logic for wayland since #80 only affects X11.
2019-01-20 15:16:36 +01:00
Tor Hedin Brønner
cf5df363bf bug fix: always cover non placeable windows with overlay fully
fixes c8603d961a
2019-01-20 14:44:00 +01:00
Tor Hedin Brønner
a76bf3f2c8 edgeoverlays: react to button release
This is good practice as it gives the user a way to «undo» the action by moving
the pointer away.
2019-01-13 15:10:14 +01:00
Tor Hedin Brønner
d3e6e6ff61 edgeoverlays on-enter: only act on the target window 2019-01-11 17:12:31 +01:00
Tor Hedin Brønner
c8603d961a edgeoverlays: make it possible to mouse resize full width windows
Make sure the overlay is always at least 1 pixel wide, otherwise just cover the
windows at the edges.
2019-01-10 17:12:34 +01:00
Tor Hedin Brønner
0c79e8955b workspace overlay: add some negative padding
Interacting with a shared monitor edge could be pretty jarring as it was very
easy to trigger a workspace change.

We add some (10px) negative padding to decrease the problem.
2018-12-05 06:08:28 +01:00
Tor Hedin Brønner
6a6cc6699b workspace overlay: activate the highest stacked window on monitor
Ideally we wouldn't change window focus at all when moving the pointer to
another monitor. Unfortunately windows on a unactive workspace doesn't react to
pointer input (eg. scroll).

When the activate window is «stuck» we can preserve focus however. Otherwise we
select the top window on the newly active monitor.

An alternative would be to wait for button events to change workspace. This
could work okay, but the pointer wouldn't react to eg. window edges.
2018-12-05 06:03:23 +01:00
Tor Hedin Brønner
e1c92b5b6f workspace overlay: use motion-event
squash! workspace overlay: use motion-event

The motion-event is better suited to making sure the pointer is always able to
interact with the windows on a monitor.

Activating another workspace when moving scratch windows across monitors will
now cause issues. For instance moving a scratch window to another monitor with
they keyboard would reset focus back to the original monitor. So we simply let
the motion-event always take care of this.
2018-12-04 10:16:40 +01: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
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