Commit Graph
761 Commits
Author SHA1 Message Date
Tor Hedin Brønner a3a4b6becc wip 2019-06-23 19:10:31 +02:00
Tor Hedin Brønner 753ae5ccfb monitors-changed: make sure each monitor has a space
If we've run out of workspaces when there's more monitors to populate simply add
new ones.

NB: this only works after startup-complete as we need to listen to
`notify::n-workspaces` first.

closes #116
2019-06-23 18:36:17 +02:00
Tor Hedin Brønner 500ce60973 bug fix: initialize all new spaces
Workspaces created after startup was never actually initialized, eg.
the `window-added/removed` signals were never connected.

Simply run space.init when constructing a space and handle the _startingUp edge
case.
2019-06-23 18:36:17 +02:00
Ole Jørgen Brønner 393365ed05 Bugfix: broken resizing of vertically tiled window in some multimonitor setups
Global y coordinate was used in calculations, breaking things for vertically
stacked monitors.
2019-05-19 19:41:49 +02:00
Ole Jørgen Brønner 7b726753ea fixup! Make cycleWindowHeight work for scratch windows 2019-05-17 10:33:22 +02:00
Ole Jørgen Brønner 66acfc63ef Make cycleWindowHeight work for scratch windows 2019-05-17 10:08:00 +02:00
Ole Jørgen Brønner cd95ad220f Don't resize windows recursively (can cause window freezes)
A freeze can be triggered like this: (might have to run the resize twice)

    metaWindow.connect('size-changed', () => {
        let f = metaWindow.get_frame_rect()
        metaWindow.move_resize_frame(true, f.x, f.y, f.width, 500)
    })
    let f = metaWindow.get_frame_rect()
    metaWindow.move_resize_frame(true, f.x, f.y, f.width, f.height-50)

Fixes #73
2019-05-05 15:47:46 +02:00
Tor Hedin Brønner 65e009815a Fix overview order and animation
Use the tiling to sort the overview. Floating windows are sorted the regular way
among themselves and put before the tiled windows.

We also report the correct coordinates so animation to and from the overview is
correct.

ref #4
2019-04-30 14:11:19 +02:00
Tor Hedin Brønner 3d1b629171 Integrate the default fallback 2019-04-30 13:57:45 +02:00
Tor Hedin Brønner 323112bd46 animateDown: respect space.showTopBar 2019-04-30 13:36:46 +02:00
Tor Hedin Brønner 49c39992cd always show the top bar when navigating the workspace stack 2019-04-30 13:36:46 +02:00
Ole Jørgen Brønner 1e015e5887 space.layout: respect show-top-bar preference
We don't use workarea.y directly as it can cause problems cause problems if eg.
a layout is triggered when a fullscreen window is active. Instead we scale the
panel height with `space.showTopBar`.
2019-04-30 13:36:40 +02:00
Tor Hedin Brønner b19cfccb4f fix revert
No idea why this didn't get reverted...
2019-04-28 19:12:55 +02:00
Tor Hedin Brønner e8a9eea8e9 Revert previous 7 commits
Was not intended for master.

Revert "don't use workarea.y directly"

This reverts commit cb67f451a2.

Revert "space: connect settings"

This reverts commit 3c7ac9509e.

Revert "fixup! workspace menu: add zen toggle"

This reverts commit bff403c134.

Revert "workspace menu: add zen toggle"

This reverts commit 89bae34412.

Revert "Implement"

This reverts commit dd812e5714.

Revert "workspace schema: add `show-top-bar`"

This reverts commit 7dcac8896a.
2019-04-28 10:57:35 +02:00
Tor Hedin Brønner cb67f451a2 don't use workarea.y directly
Can cause problems if eg. a layout is triggered when a fullscreen window is
active.
2019-04-28 10:06:15 +02:00
Tor Hedin Brønner 3c7ac9509e space: connect settings 2019-04-28 10:05:53 +02:00
Tor Hedin Brønner dd812e5714 Implement 2019-04-28 03:09:37 +02:00
Ole Jørgen Brønner f4e91d1e4f Respect workarea.y when laying out the tiling
Ref: #103
2019-04-27 17:50:25 +02:00
Tor Hedin Brønner 72ac302a62 minimumMargin: cap at horizontal-margin
closes #102
2019-04-27 02:12:36 +02:00
Tor Hedin Brønner ff8d8c4d45 Stability: null out destroyed actors
Acting on destroyed actors crashes 3.32 so make sure to null out references.
2019-04-15 21:01:02 +02:00
goodwillcoding f55e1f6ab5 Default workspace switching and moving to wrap around 2019-03-29 20:13:39 +01:00
Tor Hedin Brønner ded14faac5 Space.layout: protect against zero width workarea
Happens on monitors-changed and causes windows to be squeezed.
2019-03-28 19:25:31 +01:00
Tor Hedin Brønner 0b5f415fbb Guard against setting child below itself
This would hang the shell completely when activating a window on another
workspace.
2019-03-26 01:06:02 +01:00
Tor Hedin Brønner f83eb0b839 fix crash: Only destroy mapped clones
This caused crashed on 3.32 when closing scratch windows. Ie. windows where the
clone isn't in the scene graph.
2019-03-24 03:50:52 +01:00
Tor Hedin Brønner f603aae46a Do not set actors above/below themselves
Mutter 3.32 is built with `G_DISABLE_CHECKS` which disables among other things
`g_return_if_fail`.

This makes `set_child_below/above_sibling` remove the child if it's the same as
sibling, but leaves the child with a parent link.
2019-03-24 03:50:52 +01:00
Tor Hedin Brønner 4e09f9832d window-created: Use first-frame signal (show no longer works)
This required some reworking of the showHandler, so that the window actors would
stay hidden properly until under our control.
2019-03-24 03:50:52 +01:00
Tor Hedin Brønner 621b7b728f Port to class in preparation for 3.32
see:
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361

TODO: port the LayoutManager in minimap.js, though it looks like gjs won't
deprecrate Lang.Class yet, so it's probably fine to keep using it for now.
2019-03-24 03:49:36 +01:00
Tor Hedin Brønner 2f1df54739 window actor clip: Use the largest clip possible
This should avoid clipping the window when resizing.
2019-03-24 03:49:36 +01:00
Ole Jørgen Brønner 9185e7d6d4 docs: describe the stage and space coordinate systems 2019-03-17 16:46:14 +01:00
Ole Jørgen Brønner 6cb848a6a1 Fix weird minimize animation of scratch windows with remembered position
The scratch window would first be moved to the remembered position - then
animated "down".

Also ensures that windows minimized when navigating get a proper position.
(restoring a window that was minimized when it was non-placeable results in the
window being out-of-view)

Note: Use 'effect-completed' to detect when a the animation is done - then
resize/move. Could also have stored the target position, but that complicates
all the places we want to preview a minimized window.
2019-03-17 16:37:33 +01:00
Tor Hedin Brønner 945e4cb895 switch workspace: init the workspace stack if it isn't already done 2019-02-27 22:42:52 +01:00
Tor Hedin Brønner c80a8fd7eb workspace label: pick up the correct css for the label
A bit ad-hoc, but should work correctly.

The idea is picking up css rules with this selector:
 `#panel .panel-button StLabel`
2019-02-24 14:33:18 +01:00
Tor Hedin Brønner d7215ba0e1 ensureViewport: prefer last focused position when appropriate 2019-02-22 11:13:39 +01:00
Tor Hedin Brønner 97a7d36781 Refactor ensuredX out of ensureViewport 2019-02-22 11:12:29 +01:00
Tor Hedin Brønner 5f20007ff2 workspace label: react to changes in top bar font changes 2019-02-20 11:15:14 +01:00
Tor Hedin Brønner 48adf04ae7 workspace label: set explicit height
ref #95
2019-02-19 14:02:02 +01:00
Tor Hedin Brønner adcfa414ad preference: add use-workspace-name switch
Defaults to true. If false uses gnome shell's `Activities` text and hides the
workspace labels.

Set to false like this:
```
Extension.imports.convenience.getSettings()
  .set_boolean('use-workspace-name', false)
```
2019-02-15 00:15:54 +01:00
Tor Hedin Brønner 81551d591a Use monitor's workarea to position windows
When eg. using dash-to-dock without autohide we would position windows under the
dock. Use the workarea instead of the monitor to figure out where we can
position windows.

TODO: re-layout on `display::workareas-changed`, unfortunately this is triggered
when focusing a fullscreen window, so we'll need to keep track of the workareas
ourself to make it performant. For now the user will have to «rejigger» the
windows manually.

closes #94
2019-02-14 16:32:33 +01:00
Ole Jørgen Brønner 09950f20a2 Cleanup: MetaWindow have a built-in 'is_override_redirect' method 2019-02-10 14:32:58 +01:00
Tor Hedin Brønner 0c5458a38a workspace menu label: fix width
Taken from gnome-shell's css files.
2019-02-09 16:53:57 +01:00
Tor Hedin Brønner d7336e95fd Fix workspace label position 2019-02-08 19:32:12 +01:00
Ole Jørgen Brønner e268e9ac11 Move winprop related code to settings.js
(leave a shim for backward compatibility)
2019-01-26 21:04:50 +01:00
Ole Jørgen Brønner 571a2d0680 Don't show actors of minimized scratch windows
Specifically fixes bug where whole scratch layer become visible (but only the
actors) when reloading (or disable/enable cycle) when at least on scratch window
was active.

This also sometimes crashed gnome-shell (confirmed on v3.28.3 - ubuntu 18.04)

Also remove some code who seem to partly work around the problem
2019-01-26 14:05:09 +01:00
Tor Hedin Brønner f61d194487 fix bug: actually splice out the window 2019-01-13 12:42:40 +01:00
Tor Hedin Brønner b2f30396b8 Use the clones' stack order to pick the top window
We need to raise one of the focused window neighbours preemptively to get sane
focus after closing a window (ie. one of the neighbours should always get
focus).

However we also use the windows' stacking order to decide eg. which window in
a vertical tiling to select when entering from the side. Raising the neighbours
on focus can easily break this behavior, as the top window no longer is the most
recently selected.

If we use the clones stacking order instead we avoid these issues as it's
unaffected by the unavoidable window raising we do on focus.
2019-01-13 10:40:17 +01:00
Tor Hedin Brønner ef8c8a0df6 registerWindow: fix names, and set meta_window on metaWindow.clone 2019-01-13 10:34:15 +01:00
Tor Hedin Brønner 33431ce808 bug fix: place windows correctly when unmaking scratch
For some reason setting the clone's position before layout doesn't work.
2019-01-12 22:02:33 +01:00
Ole Jørgen Brønner 41a5028b61 Determine focused window in absence of display.focus_window
When a new window is created from the overview [1], `display.focus_window` is
null. This broke our "should-window-be-scratch" logic.

Behavior observed both on X11 and wayland

[1] or the 'switcher' extension. Probably in general if a shell modal is active
when the window is created?
2019-01-12 11:34:09 +01:00
Tor Hedin Brønner 63e74ada44 cleanup: remove spammy logging 2019-01-11 18:59:38 +01:00
Tor Hedin Brønner c349c10c07 Transforms break on 0 sized actors...
eg. transform_stage_point will simply return `[false, 0, 0]`.
2019-01-11 18:57:02 +01:00