686 Commits

Author SHA1 Message Date
Tor Hedin Brønner
fec821033f Only signal move-done if nothing is tweening 2018-12-19 21:40:04 +01:00
Tor Hedin Brønner
2b61a909db Another wrong global.get_pointer() usage 2018-12-19 21:28:47 +01:00
Ole Jørgen Brønner
21039ec6ec Bugfix: Pointer always warped when moving it to the bottom monitor 2018-12-19 21:24:04 +01:00
Ole Jørgen Brønner
0f745e0c86 Kill the built-in workspace animation more reliably (v3.28)
Specifically fixes (only in v3.28) that built-in workspace animation is visible
when moving mouse between monitors (changing the active monitor).

This problem appeared in 18eb343, disappeared in a8b23aa, and
reappeared in 9389d90 (consecutive commits)

I assume that prior to 18eb343 our own animation was active during the workspace
change. 18eb343 prevented a bunch of animations that didn't have any effect from
starting. Eg. ensureViewport and layout when they don't change anything. No
("paperwm") animation is thus run when changing the active monitor.

The workspace animation (v3.28) can also be suppressed by using
wm._blockAnimations prior to changing workspace.

Doing this when the navigator is active is easy, but there doesn't seem to be
suitable signals to catch all cases. (eg. we can't force our "workspace-changed"
handler to run before other handlers)

PS: This fix does not work for dialog windows so they're still
"workspace-animated" on monitor changes.
2018-12-19 21:07:29 +01:00
Ole Jørgen Brønner
1cc4c2f0d6 Regression: Prev commit (af3623e) broke new window animation
Try removing the Navigator.navigating and inPreview checks. In those cases the
clone should be visible.

Without those checks (together with the clone.get_parent check?) dialogs created
during animation is not hidden.

Also note that the unmapped description in af362e was wrong - unmapped is only
true a short period after the window is created.
2018-12-19 20:05:12 +01:00
Ole Jørgen Brønner
af3632e900 Bugfix: dialogs created during animation was hidden
To reproduce: Close a window with a confirmation dialog while the minimap is
open (eg. gnome-terminal with a running program)

A umapped window is either
1. a window that has not yet been inserted into a space/the scratch layer
2. a window we don't manage (eg. dialogs) meaning its clone is unused and should
   not be shown.

Note that it's not unlikely that we'll start to manage dialog-clones in the
future (#92)
2018-12-19 17:10:50 +01:00
Ole Jørgen Brønner
7ade1ef1de Revert "Mark windows as unmapped while changing between monitors"
This reverts commit 48ac0268f6.

Did not seem to resolve the issue and it sometimes causes windows to be stuck in
a "unmapped" state. Eg. when suspending, resuming and unlocking on ubuntu 18.04
gnome 3.28 windowEnteredMonitor is called on the visible windows - marking them
as unmapped.
2018-12-19 16:39:39 +01:00
Tor Hedin Brønner
33db8b137b Fix typo 2018-12-19 13:03:38 +01:00
Tor Hedin Brønner
57cbc3f586 focus_handler: raise the first window in a space too
Starting on the first window in a space, creating a new window and then closing
it would leave the user with the second window active instead of the first as
expected. This happened because we would never fix the stack order of the first
window.
2018-12-18 17:40:22 +01:00
Tor Hedin Brønner
99e15f3a53 Remove any clips on WindowActors when floating 2018-12-18 15:24:14 +01:00
Tor Hedin Brønner
8c086081a0 Get rid of pointer.get_position
pointer.get_position can report the wrong coordinates, use the simpler
global.get_pointer() instead.
2018-12-17 22:21:57 +01:00
Tor Hedin Brønner
529102add1 Add animation-time setting 2018-12-17 22:21:57 +01:00
Tor Hedin Brønner
74dd4bd068 Remove stray log 2018-12-17 20:54:49 +01:00
Tor Hedin Brønner
42f1c7e83e space.removeWindow: update space.visible 2018-12-16 13:56:05 +01:00
Tor Hedin Brønner
a11b0cd5f3 fixup! Revert "moveDone: only move reactive windows"
Lost the tween guard in the previous revert.
2018-12-15 21:53:23 +01:00
Tor Hedin Brønner
39965a2d42 Revert "moveDone: only move reactive windows"
This reverts commit b138e9083e.

Revert "Fix fullscreen reactivity again"

This reverts commit d5bd0cf023.

This would've made it likely to trigger the mouse «freeze» on x11.
2018-12-15 21:43:16 +01:00
Tor Hedin Brønner
d5bd0cf023 Fix fullscreen reactivity again
`unMovable` windows would never become reactive.

fixes b138e9083e
2018-12-14 21:12:55 +01:00
Tor Hedin Brønner
c36cdebc99 Window clones: only allocate when WindowActor is allocated
Before we fixed the clone's position everytime it was allocated, eg. whenever we
would scroll a pixel.

Insetad we listen on the WindowActors allocation signal, which happens far less
as we don't move the WindowActor around much.
2018-12-14 17:51:22 +01:00
Tor Hedin Brønner
b138e9083e moveDone: only move reactive windows 2018-12-14 16:44:46 +01:00
Tor Hedin Brønner
fbd8f439b0 moveDone: record placeable tweening windows as visible
If we start animating before the window's tween is done we're suddenly in an
invalid state.
2018-12-14 16:42:44 +01:00
Tor Hedin Brønner
48ac0268f6 Mark windows as unmapped while changing between monitors
This should fix moving windows between monitors again, and might solve the
scaling issue too.
2018-12-11 15:24:56 +01:00
Tor Hedin Brønner
7a894a9044 remove_handler: run removWindow before cleaning dead windows
Last commit caused a bunch of issues when closing windows as
`removeWindow` accesses the clone which no longer was there.
2018-12-10 21:29:52 +01:00
Tor Hedin Brønner
b38fb8c11f Clean up window clones
This might be unnecessary, as I assume the clones will get garbage collected
automatically, but that does assume it's not part of the scene graph (ie. it
dosen't have a parent). Just as well to do it explicit.
2018-12-10 20:52:54 +01:00
Tor Hedin Brønner
f092bfe642 moveDone: guard against doing anything with tweening windows
On wayland `move_frame` right after a resize might kill the resize for some
reason. We therefor delay moving windows that are tweening.
2018-12-10 20:52:54 +01:00
Ole Jørgen Brønner
8d8591d3c1 Ignore override-redirect windows completely
After a99c151 the we caused lots of
  meta_window_make_above: assertion '!window->override_redirect' failed
warnings in the log.

Most likely best to leave such windows alone.
2018-12-10 19:28:29 +01:00
Tor Hedin Brønner
f59508d69b Partly revert last commit
Selection highlight logic dosen't support setting selectedWindow outside
ensureViewport.
2018-12-10 10:02:21 +01:00
Tor Hedin Brønner
32459be4db removeWindow: cleanup
Let `layout` take of `ensureViewport`.
2018-12-10 09:32:05 +01:00
Tor Hedin Brønner
4b3ff3ac93 Premeptively remove dead windows on focus
`worspace:window-removed` runs after `focus` which means ensureViewport can get
us into a bad state. Remove any dead neighbours while we're fixing the correct
stacking order.

In particular when we had this setup, where the numbers is the stacking order,
and `2` isn't fully visible:
| 3 | 1 | 2 |

closing `1` would focus `2` and `ensureViewport` would start scrolling it into
the view. `layout` would then remove `1` resulting `2` moving further (the width
of `1`) to the left.
2018-12-10 09:23:44 +01:00
Tor Hedin Brønner
65420bf662 layout: don't count dead columns
If all the windows in a column is dead (ie. no WindowActor) we shouldn't update
the position for next column.
2018-12-10 09:12:24 +01:00
Tor Hedin Brønner
1222074722 Rename noAnimate -> inGrab which is what it actually is 2018-12-09 12:06:32 +01:00
Tor Hedin Brønner
d580c3669c insertWindow: don't force animations 2018-12-09 11:56:53 +01:00
Tor Hedin Brønner
68081fa2a3 layout: give unchanged windows a chance to become reactive 2018-12-09 11:56:53 +01:00
Tor Hedin Brønner
c3e0715f8a remove more forced ensureViewport 2018-12-09 11:56:53 +01:00
Tor Hedin Brønner
d4b0022f2b removeWindow: don't force animate on all windows
There's no longer a reason to force `ensureViewport` here. In particular when
closing a window, the windows to the left won't wait for the windows on the
right before becoming reactive.
2018-12-09 11:56:53 +01:00
Ole Jørgen Brønner
2137dddfa0 Bugfix: SSD frame buttons (minimize, ...) stopped working after 5d0f037d3
button-press on these buttons trigger a grab (GrabOp.FRAME_BUTTON).

Our grab handler run startAnimate which tracks the background -> the
button-press is stolen

Only happened for server-side-decorated windows (make sense that the grab is not
triggered for CSD windows)

Regression after: 5d0f037d3
2018-12-09 11:25:17 +01:00
Tor Hedin Brønner
36f21e480d Fix inserting existing windows 2nd take
Syncing clone positions to the frame on addWindow doesn't work for slurp/barf.
Do it in insertWindow before we `addWindow` and run layout.

fixes 6d51bc2c24
2018-12-09 06:02:17 +01:00
Ole Jørgen Brønner
a99c1511dc Make windows not added to the space "always on top"
This avoids some ugly situations where dialog-type windows was very hard to
focus. Windows that lie below the tiling is usually not possible to click so one
would have to use alt-tab, the overview, etc..

Our own preference UI behaved like that :D (but only on X11)

Making them always on top isn't 100% ideal though - especially since transient
windows doesn't move when their parent move. (so they quickly end up above
other windows)

The search dialog of gedit is an example. Prior to this commit it would not stay
on top when gedit was moved away. It did "flash to the top" during animations
though..

Semirelated: #40
2018-12-08 20:29:12 +01:00
Ole Jørgen Brønner
0f7d5930f4 cycle-width: use gap and margin prefs when calculating available width
This ensures two windows of "compatible" width will have room regardless of the
gap and margin values.
2018-12-08 19:26:33 +01:00
Ole Jørgen Brønner
acb9af0789 toggle-maximize-width: more robust detection of "is maximized"
Simply check if the window is currently wide enough to be considered maximized.

Before we used `unmaximizedRect` to track maximized status. That is of course
brittle since the window can change size in many way. We cleared
`unmaximizedRect` in cycle-width (but it has been buggy for along time :P)

Note: using the size-changed signal is not trivial for this purpose: the signal
doesn't provide the previous size and it is async in wayland and synchronous in
X11.. (after running move_resize_frame)
2018-12-08 18:57:58 +01:00
Tor Hedin Brønner
6d51bc2c24 Fix inserting existing windows
We silently relied on a tween being active after layout when inserting existing
windows. Set the clone's initial position in `space.addWindow` before layout to
fix this.
2018-12-08 18:09:26 +01:00
Tor Hedin Brønner
5815f0f3b9 clipping: fix clipping right after resize
Actors width/height aren't updated correctly on windows `size-changed`, use the
buffer rectangle instead which is correct.
2018-12-08 17:12:07 +01:00
Tor Hedin Brønner
9b29a2c1a8 resizeHandler: don't force ensure 2018-12-08 17:12:07 +01:00
Tor Hedin Brønner
7b29fa1c9b layout/moveDone: only resize/move windows when needed 2018-12-08 17:11:53 +01:00
Tor Hedin Brønner
bcd84e5cc8 selectSpace: Improve move window animation 2018-12-08 16:18:51 +01:00
Tor Hedin Brønner
33a04b4a9b Fix fullscreen reactivity
The tween could prevent the window getting activated properly.
2018-12-08 16:16:40 +01:00
Ole Jørgen Brønner
3927af08c3 Cleanup: remove bitrotted tile-visible action 2018-12-08 16:09:40 +01:00
Tor Hedin Brønner
3675770c55 Allow X to select windows while animation is in progress
This should be done for wayland too, but we'll need to figure out the correct
interaction with swiping.
2018-12-08 12:11:51 +01:00
Tor Hedin Brønner
ffabbcb85a layout: better tween guard
Turning off fullscreen would desync `c.targetY` and `c.y`. Simply make the guard
robust by making sure they are synced before foregoing tweening. This should
work better than making sure that we're always syncing the target everywhere.

We also shouldn't need to tween when `widthChanged`, if the clone doesn't move
we should be able to activate the window. If the layout initiates a scroll
`moveDone` won't activate any windows anyways.
2018-12-08 12:09:42 +01:00
Tor Hedin Brønner
4de9d9a3dc Space.layout: only tween if needed
When clones are active windows can't take pointer input. 9389d90cc made it
possible to only activate windows who's clone isn't animating.

We can take advantage of this by not forcing `ensureViewport` when a grab ends
triggering a moveDone activating the grabbed window immediately if it ended in
an already correct position.
2018-12-07 23:10:49 +01:00
Ole Jørgen Brønner
5d0f037d3e Track the background actor during animation (X11)
This ensures all mouse input is redirected to clutter.

As #80 shows, weird things can happen when mouse clicks occurs in the region of
a "visible" X11 window with a hidden actor.

Fixes #80
2018-12-07 22:16:27 +01:00