Commit Graph
1144 Commits
Author SHA1 Message Date
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
Tor Hedin Brønner 2483c0b04e prefs: Add hot corner and overview toggles 2018-12-07 07:14:15 +01:00
Tor Hedin Brønner 9389d90cc4 Fix last commit, tweens are still active on onComplete...
Apparently the tween isn't tecnically done when onComplete is run, so
`tweenCount`/`isTweening` isn't correct.

Checking `isTweening` the clones does work, probably since they're queued
before cloneContainer.
2018-12-06 21:47:08 +01:00
Tor Hedin Brønner a8b23aa451 regression: Fix new window animation
Removing `space.moving` broke a silent assumption used by `insertWindow`.

The problem is caused by not detecting layouts that doesn't scroll the space.
Detect it by guarding against any active tweens.
2018-12-06 21:27:21 +01:00
Tor Hedin Brønner 18eb343af3 Avoid getting stuck in preview state after swiping
`space.moving` is obsolete so remove it. We already guard against starting new
animations with the same target in `move_to`, which means keeping track of the
«moving» window is unnecessary.

I also cleaned up the code a bit, removed a bunch of unused parameters.

The bug is a good indication why `space.moving` was pretty ad-hoc and bad:

Returning when `space.moving == metaWindow` assumed there was already a tween
running, which we didn't want to replace. Swiping breaks this assumption by
removing any existing tweens. So a swiping to a already «moving» window would
result in ensureViewport returning early, never calling moveDone.
2018-12-06 20:32:16 +01:00
Tor Hedin Brønner d0c253f892 Drop explicit support of 3.26
I have no idea if things work on 3.26 so drop support, I'm also guessing that
3.26 is rarely used. 3.28 is pretty common, eg. through Ubuntu LTS.
2018-12-06 12:18:36 +01:00
Tor Hedin Brønner aa124d20b9 shell.sh: reset config on start
Also fixed a typo
2018-12-06 10:10:07 +01:00
Tor Hedin Brønner 719d01e1f9 Add only-scratch-in-overview setting, defaults to false
Only show scratch windows in the overview, toggled by `only-scratch-in-overview`
setting.

see discussion:
https://paperwm.zulipchat.com/#narrow/stream/174110-design/subject/limit.20overview.20to.20scratch.20windows
2018-12-06 10:02:54 +01:00
Tor Hedin Brønner fc40aaa6ae kludges: add some save/restore method nicery 2018-12-06 09:56:09 +01:00
Tor Hedin Brønner 7593ba0aa4 readme: add zulip badge 2018-12-05 10:14:24 +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 ba75b68445 topbar: fix visibility when changing to an empty monitor
If the topbar is hidden, moving to an empty workspace on another monitor will
result in the top bar still being hidden.
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 7f45a59673 init: also catch syntax errors in our own modules
Also add some high level descriptions of the various modules
2018-12-02 15:38:54 +01:00
Ole Jørgen Brønner d3bf076c2f Bugfix: paperwm crashed on gnome-shell < 3.30 due to uninitialized workspace_manager
utils.js imports tiling.js which cause tiling.js's local workspace_manager
reference to be set before it's pollyfilled

Regression after: 8c931438cd
2018-12-02 15:33:50 +01:00
Tor Hedin Brønner bea3dd88a9 init: don't bail if user.js has syntax errors
We need to wrap the initial evaluation of user.js too.
2018-12-01 05:02:46 +01:00
Tor Hedin Brønner e888de6c59 Space: Only block tracking of the background on X11
This doesn't fix the stuck mouse cursor issue, but doesn't hurt either.
2018-11-30 05:18:24 +01:00
Tor Hedin Brønner 9f10ccf9d5 Fix moving from empty spaces 2018-11-27 17:13:36 +01:00
Tor Hedin Brønner 8c931438cd cleanup: let -> var, remove global PaperWM
Such globals are better to have in user.js
2018-11-27 14:23:02 +01:00
Tor Hedin Brønner 8837800384 Don't call utils init
Calling into another module before all modules are evaluated once is bad
practice and can cause weird bugs.
2018-11-27 14:23:02 +01:00
Tor Hedin Brønner 877726a2a2 Move keybind init to keybindings.js 2018-11-27 14:23:02 +01:00
Tor Hedin Brønner e701bd48f0 extension: wrap all init/enable/disable in try blocks 2018-11-27 14:23:02 +01:00
Tor Hedin Brønner 8ccf065444 navigator: allow focusing the tiling while scratch is active
The intention here was to preserve a any focus on a open scratch windows while
switching workspace. This also goes for any «stuck» windows.
2018-11-26 23:00:49 +01:00
Tor Hedin Brønner 82505dac7b cleanup 2018-11-26 23:00:49 +01:00
Tor Hedin Brønner 88630c9cb6 Move fullscreen windows to the correct monitor
When a workspace is moved to another monitor fullscreen windows also needs to be
moved.
2018-11-26 18:33:51 +01:00
Tor Hedin Brønner 3c22876180 alt-tab: let shift-super-alt select most recent scratch window
closes #64
2018-11-26 17:50:56 +01:00
Tor Hedin Brønner 5a4fefe536 gestures: don't use weird average velocity
This didn't seem to do much good.
2018-11-26 17:50:41 +01:00
Tor Hedin Brønner 2bfe8357a5 Guard against moving newly created windows 2018-11-26 16:26:02 +01:00
Ole Jørgen Brønner 8356a31602 set-recommended-gnome-shell-settings: Support gnome-shell 3.3x 2018-11-24 18:59:52 +01:00
Ole Jørgen Brønner bc28def87a Missing recommended setting (attach-modal-dialogs=false) 2018-11-24 17:53:50 +01:00
Ole Jørgen Brønner 4fd50f594c Minor documentation changes 2018-11-24 17:36:16 +01:00
Ole Jørgen Brønner 93a4bca406 Add a "set recommended gnome-shell settings script" 2018-11-24 17:23:34 +01:00
Ole Jørgen Brønner c260a69d52 Bugfix: Dragging a scratch window to another monitor did not activate it
- User drags scratch window from monitor A to B
- The B monitor overlay is not triggered and thus not removed (The grab seems to
  prevent it)
- Not possible to interact with windows on monitor B until the mouse is moved
  back to A and into B again

Note: The special check for is_on_all_workspaces is not strictly needed -
metaWindow.change_workspace seemes to have the same end-effect, but it seemed to
be more jumpy. Did not investigate further.

Note: Sometimes the moving window jumps just as it crosses over to the other
monitor - not sure why - but it might make sense to delay the monitor-workspace
activation until the grab ends.
2018-11-24 17:00:33 +01:00
Tor Hedin Brønner e795dcf90d Fix no hot corner
When there's several monitors it's possible for the first corner in `hotCorners`
to be null.
2018-11-24 01:37:16 +01:00
Tor Hedin Brønner 68d28e4ac4 kludges: properly disable the native workspace animation (3.30) 2018-11-24 01:18:30 +01:00
Tor Hedin Brønner 0b75e92e50 3.30: fix workspaces-on-primary-dislay-only
'org.gnome.shell.overrides' is no longer used in 3.30 in favor of general per
desktop settings.
2018-11-23 20:37:56 +01:00
Tor Hedin Brønner 3283c7bfbf Layout when a space changes monitors 2018-11-23 18:13:11 +01:00
Tor Hedin Brønner 448078d9b9 gitignore: ignore .config 2018-11-23 17:54:32 +01:00
Tor Hedin Brønner 6bc1e2a490 Block monitor window movement while changing monitors
Try to avoid any unintended window movement while transitioning between monitor
setups.
2018-11-23 17:50:40 +01:00
Tor Hedin Brønner f9e1c99368 readme: add links and fix up a few sentences 2018-11-19 21:04:00 +01:00
ganthern 29c17dc73e Slurp now pushes the active window into the column to the left
if there is no column to the right and the rightmost column contains
only one window.
This allows freshly created windows to be stacked without
having to change focus.
2018-11-19 20:57:30 +01:00
Ole Jørgen Brønner da04d5526a Bugfix: Space.targetX was sometimes set to null
space.targetX = Math.round(clone.targetX) + ...  resulted in null when
clone.targetX was undefined. This could happend on extension startup and caused
the space to be unusable.

Initialize clone.targetX and remove duplicated space.targetX initialization.
2018-11-11 16:24:05 +01:00
ganthern 9ad6ee605d added default background to preferences UI 2018-11-04 19:01:01 +01:00
Tor Hedin Brønner b295e9d00d Add default-background preference
Not exposed in the preference ui yet.

Can be set with dconf or in `user.js` like this:

var settings = Extension.imports.convenience.getSettings();
settings.set_string('default-background', '/path/to/image.jpg');

ref #83
2018-10-19 11:16:36 +02:00
Tor Hedin Brønner 4b9c8df3ab background: Use 'zoom' style on picture wallpapers
Zoom is the default option in gnome when using pictures as the background image.
This is a much better default then what we've been using.

When using color backgrounds with noise we need to use the `wallpaper` style, as
the noise isn't designed for stretching.

ref #83
2018-10-19 10:43:02 +02:00
Tor Hedin Brønner 4dbc77de78 Only redirect newly created windows
When moving an existing window to another workspace via. eg. the overview we
shouldn't redirect it to the selected workspace.

fixes #82
2018-10-18 16:53:22 +02:00
Tor Hedin Brønner a0c352d085 Add shell.sh utility to run nested X11/wayland sessions
Runs X11 by default, pass in -w to run a wayland session. The dbus address is
copied to clipboard, so it's easy to connect to the new sesssion from emacs
using `gnome-shell-set-dbus-address`.

Depends on Xephyr in the case of x11, and xclip is used to copy the dbus
address.
2018-10-16 11:22:51 +02:00