Commit Graph

7599 Commits

Author SHA1 Message Date
Sebastian Keller
c01973055f workspace: Ensure that _createBestLayout() always returns a layout
When opening a large number of windows, the computed space and scale for
a layout can become negative due to the per-row/per-column spacing. This
is smaller than the initial values of lastSpace and lastSpace, leading
to a null return which then causes all sorts of other issues resulting
in the workspace becoming invisible.

This change ensures that the function always returns a layout, even if
it may look a bit broken and does not conform to the scale/space
requirements which are impossible to fulfill for the given number of
windows. It's better than displaying nothing, since it allows users to
move/close windows and restore this to a more usable state.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3730

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1685>
2021-02-16 21:24:27 +00:00
Jonas Dreßler
e65e5edee6 appDisplay: Use icon-size instead of width/height for system actions
When creating an icon for the system actions search provider, set the
icon size using StIcons own icon-size property instead of ClutterActors
width and height property. That ensures the scale factor is applied and
the icon will be properly scaled on hiDPI screens.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1686>
2021-02-16 13:56:20 +00:00
Jonas Dreßler
8f9d6a4c13 appDisplay: Use new indentation style
Otherwise eslint will complain about the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1686>
2021-02-16 13:56:20 +00:00
Sebastian Keller
1bd2b0123e windowPreview: Consider chrome overlaps when offscreening for opacity
The icon and close button might be overlapping the window actor but
were not considered in has_overlaps() which gets used to decide whether
to offscreen the actor for transparency. Since currently the icon is
visible when the preview is dragged and the whole actor is turned
transparent, the opacity will not be applied to everything as a whole
but the child actors individually. This leads to the window becoming
visible behind the icon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1684>
2021-02-16 13:29:00 +00:00
Sebastian Keller
8d5fb73695 workspacesView: Don't invalidate allocation before using it for gesture
Calling startTouchGesture() on the workspacesViews can change the
visibility of the workspaces if not all of them are already shown, such
as when there are more than 3 workspaces or for 3 workspaces if we are
not on the central one. This invalidates the allocation and the width
used as distance for the gesture would become 0, resulting in drag
gestures immediately jumping to the first or last workspace due to a
division by 0.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3721

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1682>
2021-02-16 03:50:52 +01:00
Sebastian Keller
629b7394f7 dnd: Set dnd actor size instead of scaling it when reparenting
Previously the actor could end up using its natural size and then get
scaled down to its allocation before reparenting. This however could
affect the layout of the widget due to the larger size. To ensure the
widget looks the same after reparenting set the size to its original
size.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3717

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1680>
2021-02-16 01:07:23 +01:00
Carlos Garnacho
863ba76675 messageTray: Drop hack to keep track of X11
This is here to cater for lost events while the pointer wanders
into untracked shell UI (thus not part of the input region under
X11). Let mutter handle this situation instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
2799760244 windowManager: Drop sync_pointer() after relayouts
We should trust the Clutter machinery here, as it has code to trigger
focus changes triggered by relayouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
2445212e35 messageList: Drop sync_pointer() after relayouts
We should trust the Clutter machinery here, as it has code to trigger
focus changes triggered by relayouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
cbde13fc65 overview: Avoid sync_pointer after pop_modal()
This is only necessary for the X11 backend (as grabs triggered by other
clients leave GNOME Shell oblivious of the actual pointer position), but
is now handled inside Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
0141b66d23 grabHelper: Avoid sync_pointer after pop_modal()
This is only necessary for the X11 backend (as grabs triggered by other
clients leave GNOME Shell oblivious of the actual pointer position), but
is now handled inside Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
f1437506ea dnd: Avoid sync_pointer after pop_modal()
This is only necessary for the X11 backend (as grabs triggered by other
clients leave GNOME Shell oblivious of the actual pointer position), but
is now handled inside Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1556>
2021-02-14 13:57:56 +00:00
Carlos Garnacho
28f73a175c windowManager: Do not set Wacom LED state through g-s-d
This piece of machinery is going away, in favor of the own kernel's
support.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1075>
2021-02-13 15:52:55 +01:00
Lucas Werkmeister
bbf1fc28ca lookingGlass: Let history trim input
Checking whether the item is empty is now the history’s job, per the
previous two commits. The history also trims the input for us.

The effect of this is that we call _history.addItem(), and thereby move
to the end of the history, even if the input is empty (or consists only
of whitespace); clearing the input field and pressing Enter becomes a
quick way to jump back to the end of the history. (The current history
item is not overwritten if the input is empty.)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>
2021-02-13 08:58:20 +00:00
Lucas Werkmeister
df94055c58 runDialog: Let history trim input
Checking whether the item is empty is now the history’s job, per the
previous commit. The history also returns the trimmed input for us, so
we can avoid doing that work twice.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>
2021-02-13 08:58:20 +00:00
Florian Müllner
2beca14b8d windowPreview: Tie icon scale to overview state
Scaling the icons all the way from/to 0 is a relatively big transition,
which is fairly distracting when playing simultaneously for multiple
previews after reaching the WINDOW_PICKER state.

Instead, tie the scale to the overview state itself, so that the animations
runs in parallel.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1654>
2021-02-12 19:48:43 +00:00
Georges Basile Stavracas Neto
c0a4d90847 overviewControls: Limit Dash height to 15% of the overview's
Back when the Dash was vertical, the size of each item was calculated
solely based on the available height. After making the Dash horizontal,
this was swapped by the available width. However, when the height of the
Dash decreases, the current code results in never scaling them up ever
again.

Fix that by making ControlsManagerLayout explicitly pass the maximum Dash
sizes. Remove the 'notify::width' handler that served the same purpose.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3651

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1638>
2021-02-11 22:31:50 +00:00
Georges Basile Stavracas Neto
1b51ae150d searchController: General cleanup
Fix style issues, such as indentation and == → ===. Simplify
getTermsForSearchString() by removing one variable.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1667>
2021-02-11 21:14:36 +00:00
Georges Basile Stavracas Neto
c8f1dca3c7 Rename ViewSelector to SearchController
Rename ViewSelector to SearchController, since ViewSelector now effectively
only handles search. Rename the file correspondingly as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1667>
2021-02-11 21:14:36 +00:00
Georges Basile Stavracas Neto
27627bd40a viewSelector: Cleanup pages
Remove the dummy applications page that was introduced as a temporary
step. Replace the 'page-changed' and 'page-empty' signals with a 'search-active'
boolean property.

Remove ViewSelector.ViewsPage since it's now unused, and all the page handling
mechanism. At last, since we don't use any ShellStack features anymore, simply
make it a St.Widget with a ClutterBinLayout as the layout manager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1667>
2021-02-11 21:14:36 +00:00
Jonas Dreßler
3510b88bdc screenshot: Remove shooter from sender in finally block
We do this in both the try{} and the catch{} block, so we might as well
put it into a finally{} block.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
2021-02-11 18:51:40 +00:00
Jonas Dreßler
c1bfdd74d8 screenshot: Fix slow audiovisual feedback on when taking screenshot
Add a "screenshot-taken" signal from the screenshot service's internal C
implementation, and use that to trigger the camera flash visual effect
and the click sound, allowing them to run in parallel with the PNG
compression instead of waiting until the file is complete to start.

This significantly improves perceived latency on high res setups such as
4K, 5K, or dual 4K screens.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/512

Co-authored-by: Brion Vibber <bvibber@wikimedia.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
2021-02-11 18:51:40 +00:00
Jonas Dreßler
461c65c93b screenshot: Replace template strings with .format()
CI will complain when we add screenshot.js to the POTFILES in the next
commit because gettext doesn't like template strings, so make CI happy
and switch to .format() instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
2021-02-11 18:51:40 +00:00
Brion Vibber
f9652aab82 Fix for screenshots when pictures path is unavailable
On my local jhbuild setup some local stuff is not set up and
there's no pictures folder. This fixes a regression where it
blew up instead of saving to the home dir in this situation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
2021-02-11 18:51:40 +00:00
Georges Basile Stavracas Neto
86cefd906b workspace: Disable overlay for inactive workspaces too
In addition to disabling the overlay when the state is not 1,
disable it also when not in the active workspace.

Make the Workspace class track the workspace's active state,
and resync the overlays when it changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1645>
2021-02-11 17:21:48 +00:00
Georges Basile Stavracas Neto
2e817d3fa8 workspace: Always leave overview when in app grid state
The behavior of workspaces is different depending on whether
the overview is in window picker state, or app grid state.

When in window picker state, clicking on adjacent workspaces
should only activate them, without hiding the overview; and
clicking on the active workspace hides the overview. When in
app grid state, clicking on a workspace must always hide the
overview.

Pass the overview adjustment to Workspace, and leave overview
if the overview state is bigger than WINDOW_PICKER.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1645>
2021-02-11 17:21:48 +00:00
Georges Basile Stavracas Neto
bf1fa3879f workspacesView: Interpolate against relative workspace boxes
The overview transition consists of getting the initial and final
states of the overview adjustment, derivating various other internal
states from them (such as the fit mode, opacities, translations, etc),
and finally interpolating the allocation boxes.

When interpolating between the fit mode, WorkspacesView uses the current
allocation box to derivate the SINGLE and ALL fit mode boxes. However,
that creates a curved path during overview transitions. What we really
want to do here is calculate the fit mode box relative to the corresponding
overview state. For example:

 +----------------+----------+------------------------+
 | Overview State | Fit Mode | Workspaces geometry    |
 +----------------+----------+------------------------+
 | HIDDEN         | SINGLE   | Cover entire screen    |
 | WINDOW PICKER  | SINGLE   | Between minimap & Dash |
 | APP GRID       | ALL      | 15% screen height      |
 +----------------+----------+------------------------+

Using the table above as the reference, when the overview transitions
between WINDOW PICKER and APP GRID, we must interpolate between
(SINGLE fit mode @ between minimap & Dash) and (ALL fit mode @ 15% screen
height). That way, we always interpolate the final boxes, which corrects
the odd path that workspaces follow during this transition.

Make the WorkspacesView of the primary monitor use these cached boxes
when the overview is in the middle of a transition, and the fit modes of
the initial and final state differ, to calculate the workspaces positions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
9c6d8e2aad overviewControls: Cache workspaces boxes
Next commit will need to access the allocated workspaces boxes, so
cache them at allocation time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
ca066a4ba6 workspacesView: Use calculated workspace state for progress
It works just like before, except that this has the nice side effect
of not changing the workspace mode when leaving the overview from
the app grid state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
87645652e5 overviewControls: Make AppDisplay rise from the bottom
It makes more sense in a spatial overview that the app grid
comes and goes to somewhere in the screen, instead of fading
in and out into the void.

Make the app grid rise from the bottom of the screen.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
a9f11b1f5a workspacesView/workspacesDisplay: Remove parent opacity hack
Now, we set WorkspacesDisplay's opacity directly, so there's no
need to have this parent → child glue code anymore. Remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
c09c070b15 overviewControls: Incorporate ActivitiesContainer
Move AppDisplay, WorkspacesDisplay, and ThumbnailsBox from ViewSelector to
ControlsManager. This allows to always allocate the correct size for AppDisplay,
and will enable for a plethora of further improvements. The end goal is to
completely remove ViewSelector, and let ControlsManager handle the layout of
everything that's visible in the overview.

For now, replace the apps page with a dummy actor in ViewSelector.

Adjust various callers around the codebase to not access the ViewSelector
directly from the overview anymore.

Bind the opacity of the primary workspace to WorkspaceDisplay's opacity. This
allows removing the parent opacity hack in place, which will be done by the
next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
83127bf805 overviewControls: Use specialized class for Overview adjustment
It'll be useful for the next commits to have a handy 'getState' method
that calculates the progress of any particular transition.

Move the St.Adjustment to a specialized subclass.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
4cf5898d85 viewSelector: Remove pinch gestures
It'll be replaced by a 3 finger gesture that sticks to fingers
and progressively transitions between states.

Remove both pinch and touchpad pinch gestures from ViewSelector.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
cbe0180f47 viewSelector: Drop edge drag gesture
It doesn't use any ViewSelector's API anymore, and its functionality will be taken
over by the 3 finger gesture.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
80d258b20f viewSelector: Move 'toggle-applications-view' to ControlsManager
Move the shortcut handling into ControlsManager, and reimplement
the callback in such a way that it behaves correctly with the
current overview machinery.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
b32f414919 viewSelector: Remove showApps()
Now that Overview is able to ease into any state, be it window
picker or app grid, we can move this ViewSelector method to
Overview itself, which is its rightful place to live.

Remove ViewSelector.showApps(), and make all callers call
Main.overview.show(ControlsState.APP_GRID). Also make sure the
show apps button is correctly toggled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
8089d7cbf7 overivew: Propagate target state when animating to overview
Next commits will requires ControlsManager to animate to different
states, depending on how Overview is called. Add a new 'state'
parameter to ControlsManager's, and OverviewActor's animateToOverview,
and Overview.show().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
bce67a27cc viewSelector: Move 'toggle-overview' shortcut to overview
It is handled there already, there's no reason for it to continue
to be in ViewSelector.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
22f4a6b7f6 workspace, workspacesView: Cleanup animation methods
Remove Workspace.zoomTo/FromOverview(), they're unused now. Rename
everything up to ControlsManager to prepareToEnter/LeaveOverview(),
since these classes don't run the animation anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
d221215ab6 workspacesView: Derive workspace mode from overview state
WorkspacesView uses the floating layout when the overview is in window
picker mode, and the session layout when the overview is in app grid
mode. Up until now, the fit mode adjustment was used to derive the
workspace mode, but it is incomplete as it doesn't have the full range
of workspace states.

Make ViewSelector cascade the overview adjustment to WorkspacesDisplay,
and use the overview adjustment itself to derive the workspace mode.

Extra workspaces don't have to account for the fit mode, and thus are
basically a clamp(state, 0, 1) of the overview state. However, don't
call animateTo/FromOverview() anymore, since they ease the workspace
mode adjustment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Florian Müllner
741d6abb97 workspacesView: Add primary view to workspaces display
Boy, does this commit feel good.

While the workspaces view on the primary monitor *appears* as part of
the overall overview hierarchy, this hasn't actually been the case
until now. We synchronized its size and (stage) position to match
the workspaces display, but actually kept in a separate layer for
the transitions to and from the overview.

But now that the new layout manager slides out completely during the
overview transitions, the workspaces display starts out covering the
entire work area, which is exactly what we need for the transition.

So finally stop faking it, and actually make the primary workspaces
view a child of the workspaces display.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
1ad1db406e overview: Don't fade OverviewActor
Now that the workspace display is properly allocated for each frame,
we don't want to fade the entire overview anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
b6337a7bf1 overviewControls: Ease main adjustment when animating to/from overview
Instead of delegating it to ViewSelector, make the transition to and from
overview ease the main state adjustment.

This commit temporarily breaks these animations, but on the other hand
introduces an important feature: ViewSelector is always allocated to the
actual size. This will finally allow for adding WorkspacesView as a child
of WorkspacesDisplay, and finally remove the actual geometry hack, which
is what next commit is about.

This commit also effectively reverts b64103efc.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
0a8aeebd30 overview: Reorganize animateTo/FromOverview()
Instead of directly accessing ViewSelector and calling these methods
there, cascade the calls to OverviewActor, ControlsManager, and finally
ViewSelector. Also move the opacity transition to OverviewActor.

This commit has no functional change.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
e6e5a93dec viewSelector: Use state adjustment for apps page
Currently, ActivitiesContainer reacts to showAppsButton and
transitions between app grid and window picking states on
its own. In the future, we want full control over this.

ControlsManager already has a state adjustment that represents
all possible overview states. Propagate this adjustment up to
ActivitiesContainer, and use it to drive the transition.

This requires moving the callback to the showAppsButton to
ControlsManager, since now it control the state adjustment
itself, not ActivitiesContainer's adjustment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
3887253823 overviewControls: Use adjustment to control layout
Right now, the adjustment is fixed at ControlsState.WINDOW_PICKER,
but soon it will be propagated to ViewSelector to control the
transitions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
55510e9cdf overviewControls/controlsManager: Use a custom layout manager
In the future, we want to tightly control the state of the
layout throught gestures, which requires hooking everything
together with adjustments. This is the first step in this
direction.

Add a new custom layout manager for ControlsManager that
allocates the search entry, the view selector, and the Dash,
vertically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Georges Basile Stavracas Neto
301686ee5f overview: Move search entry to ControlsManager
Next commit will tie all these widgets up with a single
layout manager, and we need to control the search entry
position.

Move it to OverviewControls.ControlsManager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
2021-02-11 15:50:31 +00:00
Pascal Nowack
d02612e790 ui/windowManager: Fix horizontal scrolling when smooth events are used
Currently, gnome-shell uses the wrong scrolling direction for
horizontal scrolling events.
When dx < 0 for a smooth scroll event, then the scrolling direction is
supposed to be Clutter.ScrollDirection.LEFT, instead of
Clutter.ScrollDirection.RIGHT, as dx is smaller than 0.

Fix this issue by swapping the values LEFT and RIGHT.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1665>
2021-02-11 15:43:19 +01:00
Florian Müllner
21faae480e polkitAgent: Ensure cleanup if dialog wasn't shown
It is possible for an initiated session to complete without
a request if polkit can authenticate the action without user
input. We fail to clean up after ourselves in that case, as
the cleanup is done after the dialog is closed.

The dialog can still be shown when the code that hides existing
dialogs while the screen is locked shows it on unlock. But as
the session was closed, the dialog is now defunct and cannot
be dismissed by the user.

Fix this by running the cleanup on close() when the dialog
wasn't shown.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3701

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1662>
2021-02-11 13:48:54 +01:00
Florian Müllner
3a9acb9602 dash: Re-fittsify
Now that the dash is no longer attached to a screen edge, it lost
its "infinite width" (Fitts' law). Restore it by moving the visible
bar into a separate layer underneath the actual icons, extend the
icons to the bottom edge, and replace the margin around the dash
with padding inside the icons.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/89

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1660>
2021-02-10 15:46:00 +00:00
Florian Müllner
5c31ef6ae2 dash: Reindent some more code
Again we're about to touch it.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/89

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1660>
2021-02-10 15:46:00 +00:00
Florian Müllner
73b94c3901 overviewControls: Remove DashFader
By now there is so little left of the old sliding controls that the
split from the actual dash makes little sense.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/89

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1660>
2021-02-10 15:46:00 +00:00
Florian Müllner
9aa25eaa0b dash: Consider additions for separator visibility
The children variable holds the icons that were originally in
the dash. For the separator visibility, we should consider the
icons that are in the dash after the update, so we must consider
additions as well as removals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1659>
2021-02-10 09:09:34 +00:00
Abderrahim Kitouni
9aae1df7a6 workspacesView: Fix off-by-one error
This is basically 9f0e7632a6 ported over ed1170906b which was dropped this
fix when copying things around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1655>
2021-02-09 09:40:29 +00:00
Alexander Mikhaylenko
2b9cf73309 workspacesView: Enable long swipes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1647>
2021-02-08 22:20:26 +00:00
Alexander Mikhaylenko
16f74ebc57 swipeTracker: Add allowLongSwipes property
Since we now have the ability to support swiping through multiple pages,
expose it as a property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1647>
2021-02-08 22:20:26 +00:00
Alexander Mikhaylenko
10cafc55c1 swipeTracker: Rework end point calculation
Previously we used a bunch of heuristics for this. We checked if velocity
was directed towards the nearest snap point and its value was larger than
a threshold. If it is, we completed the swipe, otherwise we cancelled it.

This was good enough at the time, because this code was originally written
for back/forward swipe. Since then, the swipe tracker was extended to
handle arbitrary snap points and not just 0 and 1, or -1 and 0, depending
on text direction. After that it was iterated on, but never significantly
redone.

This worked well enough, but had two problems:

1. In some cases, notably overview, it may be wanted to be able to swipe
   through multiple pages at once. This wasn't really possible because we
   always picked the adjacent snap point.

2. Since we can't do that well, we want to restrict swipes to one page at a
   time. It was done in a rather hacky way by clamping the position into
   [-1, 1] range from the place where we started the swipe. This works
   if we start the swipe from idle position, but if an animation was
   already going, the range would be clamped to arbitrary values, and very
   likely containing only one snap point, which we already swiped past at
   this point. In this case, finishing the swipe would cancel it regardless
   of velocity. This means that if one tries to quickly move through
   carousel pages via swiping, half of the swipes will be inexplicably
   cancelled.

We'll use the deceleration formula from
https://medium.com/@esskeetit/how-uiscrollview-works-e418adc47060#10ce
to calculate then projection point, then pick the nearest snap point and
calculate the duration as we did before. It works well enough for short
distances, but has two problems:

1. It caps the maximum distance at a pretty low value - about 5 pages in my
testing.

2. With how we pick the nearest snap point, it's too easy to accidentally
cancel the swipe,

To combat the first problem, we can modify the curve: only use linear
function at small distances, and smoothly transition it to a parabola
further.

For the second problem we can add two special cases: first, if the swipe
ended up between the initial snap point and the next one, we always prefer
the latter. Second, a good old velocity threshold for cancelling.

We'll also use a slightly smaller deceleration value for touchpad: 0.997
instead of 0.998.

Now that we can pick any snap point, the [-1, 1] clamping doesn't make
sense anymore, so instead let's replace it with a more flexible
mechanism: if we're near a snap point, pick its adjacent snap points.
Otherwise, take the two nearest snap points, and take their adjacent
snap points. This way we have 3 snap points to choose from when
starting a swipe from an idle position, and 4 if we start during an
ongoing transition.

This way, if we've just swiped from snap point n to n+1, the transition
will pick snap points n-1, n, n+1, n+2 and if we swipe again, we will
likely land on n+2. During that transition, if we swipe again, it will
likely have already passed the snap point n+1, so this time the available
snap points will be n, n+1, n+2, n+3, so we can swipe again and it will
still complete, and so on.

This will make it easy to allow multi-page swipes as well, by just
removing the clamping.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1647>
2021-02-08 22:20:26 +00:00
Alexander Mikhaylenko
cf87ab04aa swipeTracker: Calculate velocity using scroll history
In some cases we may get anevent with very low delta at the end of the
swipe. While we can't completely ignore them, we can smooth them using a
scroll history, similarly to what GTK kinetic scrolling does: keep track
of the last 150ms of events, and sum their deltas when calculating the
velocity.

The logic is based on what GTK does in GtkGestureSwipe and
GtkEventControllerScroll.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1647>
2021-02-08 22:20:26 +00:00
Lucas Werkmeister
6ac32f1fc0 runDialog: Trim input before processing
This way, whitespace-only (nonempty) input gets the same treatment of
not being added to the history (see previous commit), which seems nice.

Part of https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3183.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1442>
2021-02-08 08:14:46 +00:00
Lucas Werkmeister
cb26a636e8 runDialog: Don’t add empty input to history
If the input is empty, there’s no point in adding it to the history –
it’ll just be mildly annoying when the user has to skip past it next
time they consult the history.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3183.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1442>
2021-02-08 08:14:46 +00:00
Lucas Werkmeister
7bea63ae4b runDialog: Don’t treat empty input specially
Let empty input result in an error, just like other invalid commands
(bad syntax, nonempty whitespace, etc.). GLib already has an error
message “Text was empty (or contained only whitespace)” which it shows
for whitespace-only input, so letting that message apply also to empty
input makes sense.

This requires some tweaks further down the file to avoid interpreting
empty input as an empty path (relative to the home directory) and then
opening the home directory.

Part of https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3183.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1442>
2021-02-08 08:14:46 +00:00
Bastien Nocera
512016dcb5 main: Show welcome dialogue on first start
This hooks the recently added welcome dialogue to be shown the first
time a new session is started, and disabled after that.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3632
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1619>
2021-02-05 13:41:26 +00:00
Bastien Nocera
af4e54bfc9 welcomeDialog: Add “welcome” dialog
As designed at:
https://gitlab.gnome.org/Teams/Design/os-mockups/-/blob/master/greeter/welcome-dialog.png

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3632
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1619>
2021-02-05 13:41:26 +00:00
Florian Müllner
29e2b15236 data: Rename custom close icon
Resource icons are added to the fallback icon theme, so they won't
get used if a matching icon is found in the configured theme.

That includes fallback names, so Adwaita's "window-close-symbolic"
takes precedence over "window-close-24-symbolic" in hicolor.

Fix this by using a custom name for a custom icon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1640>
2021-02-05 01:01:09 +01:00
Sebastian Keller
c61e1e5c2c mpris: Hide unused elements to leave more space for the title
The Message class this is derived from unconditionally adds a close
button with 0 opacity that only gets shown on hover for messages that
can actually be closed. The MPRIS MediaMessage however can never be
closed and having a close button can cause the title to be cut short
unexpectedly.

Similarly the secondary text which other notifications use to display
the notification time is always left empty here as well.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3664

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1632>
2021-02-04 22:42:08 +00:00
Marco Trevisan (Treviño)
e641547ddf appDisplay: Do not bind popdown call to grabHelper onUngrab
grabHelper is passing a boolean argument to onUngrab() callback function
and since commit 1acbdcc9b3 we'd end up adding it to to the callback list or
we'd try to invoke it:

 (gnome-shell:3490851): Gjs-CRITICAL **: 17:19:20.460: JS ERROR:
  TypeError: func is not a function
  onComplete/<@/media/M2/GNOME/gnome-shell/js/ui/appDisplay.js:2407:56
  onComplete@/media/M2/GNOME/gnome-shell/js/ui/appDisplay.js:2407:40
  _makeEaseCallback/<@/media/M2/GNOME/gnome-shell/js/ui/environment.js:85:13
  _easeActor/<@/media/M2/GNOME/gnome-shell/js/ui/environment.js:170:64

Use an arrow function so that we can control the parameters we pass
to popdown.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1635>
2021-02-04 21:55:34 +01:00
Razze
ed628b90d7 accessibility/keyboard: Align the panelMenu button style
This get's rid of the single-indicator introduced in one of the latest
commits. This was causing the accessibility pill in the top panel
 to have different padding from the keyboard layout pill.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1615>
2021-02-04 20:08:29 +00:00
Florian Müllner
7aa36ad239 windowManager: Allow switching workspaces with super-scroll
So far, we couldn't allow workspace scrolling outside the overview
because scroll events were always sent to clients. However mutter
was changed recently to pass on scroll events when the mouse button
modifier (usually super) is pressed, which allows us to enable the
same workspace scrolling as in the overview now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1612>
2021-02-04 20:04:15 +00:00
Florian Müllner
ac8246050d swipeTracker: Optionally require modifiers for scrolling
The design now calls for super-scroll for workspace switching
in the session, however it is currently only possible for
SwipeTracker to either handle scroll events or not.

In order to support the new use case, add a new :scroll-modifiers
property that allows specifying modifiers for which scroll events
are handled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1612>
2021-02-04 20:04:15 +00:00
Florian Müllner
26a39bdf78 workspacesView: Move workspace scroll code to windowManager
This will allow sharing the code for the new super-scroll functionality.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1612>
2021-02-04 20:04:15 +00:00
Sebastian Keller
96d66def8c dnd: Update actor position after scaling even when animations are off
The code to update the actor position based on the cursor and current
scale was run in a 'new-frame' handler. This is working fine when
animations are enabled, but when they are turned off this does not work.
This is because the 'new-frame' signal is emitted before the changes for
that frame are applied. So with animations off the position was only
ever updated with the starting values. As a result the shrunk actor was
not being dragged by the position where it was clicked, but by where it
was clicked in the original size, which is likely not even on the shrunk
actor.

This change now also updates the position in the onComplete handler
which gets run with the final scale, even if the duration is 0.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1699

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1627>
2021-02-04 16:39:55 +00:00
Georges Basile Stavracas Neto
1adcbaab46 workspacesView: Derive workspace state from fit mode
Derive the workspace state WorkspacesView's workspaces from the fit mode.
Extra workspaces still run the zoom animations as before.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
176ea3b1ef workspace: Split preparation steps from zoomFromOverview
Next commit will bind the workspace state adjustment to the snap
adjustment in WorkspacesView, and we'll need the preparation
steps but not the easing of the state adjustment.

Split preparation steps from zoomFromOverview() into a new method
prepareToLeaveOverview().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
4cf5b4a6d8 workspacesView: Scale inactive workspaces
As per the latest mockups, then horizontally snapping, the active
workspace should be highlighted. Because WorkspacesView clips to
allocation, we cannot simply scale up the active one. Instead,
scale down the inactive ones.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
b64103efca workspacesView/workspacesDisplay: Don't sync geometry when animating
Synchronizing the actual geometry while animating from / to the overview can
break the animation. Let's prevent that. This code will go away soon anyway,
but to not lose bisectability, it's better not to leave it misbehaving until
then.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
ed1170906b workspacesView: Center active workspace in allocation
When vertically snapping, WorkspacesView currently allocates workspaces
side-by-side, then applies an extra step of translation to center to
the active workspace. This extra step, however, gets in our way because
now we need tighter control of the workspaces positions in allocation,
in order to properly interpolate them.

Move the translation of workspaces to the allocation code itself, and
remove the extra translation step.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
1359b272a4 viewSelector: Tie workspace fit mode to adjustment
Tie the fit mode adjustment of WorkspacesDisplay to the
state adjustment of AppPagesContainer, and transition to
the ALL fit mode when the app grid is visible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Georges Basile Stavracas Neto
26c5434222 workspacesView: Use side-by-side layout
Currently, WorkspacesView positions each workspace on a
per-page layout, each page with the allocated width and
height of WorkspaceView. This layout doesn't work well
with horizontal workspaces.

Layout workspaces side by side, instead of per page. The
layout is influenced by a "fit mode", which reflects the
different behaviors exposed in the mockup. This fit mode
represents whether a single or all workspaces will fit
available geometry.

The single fit mode is always used for now. Next commits
will make it switch to the all fit mode when in the app
grid state.

The translation_{x,y} also needed to reflect the switch to
a side-by-side layout, and use the geometry of the workspaces
to determine the offset. Notice that, when the fit mode is ALL,
there's no translation applied.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Florian Müllner
3abfc25858 workspacesView: Always use ZOOM transition
Workspaces are now always shown, so the code path to fade windows
instead of zooming out is dead now; remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1613>
2021-02-03 20:30:30 +00:00
Florian Müllner
252f2f5144 cleanup: Define GObject accessors in camelCase
gjs is smart enough to match a propertyName getter/setter to the
corresponding property-name GObject property, so use that and get
rid of the eslint camelcase rule exceptions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
2021-02-03 20:19:29 +01:00
Florian Müllner
0f1b566918 js: Use gjs-defined GObject accessors where possible
Nowadays gjs allows to omit get/set accessors for read-write properties,
and will define reasonable defaults in that case. In many cases we don't
need anything more than the default handling, let gjs handle those props.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
2021-02-03 20:19:29 +01:00
Florian Müllner
a41e294e21 workspaceThumbnails: Remove obsolete property
Since commit f55ff01239, the property has been replaced by
an adjustment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
2021-02-03 20:19:29 +01:00
Florian Müllner
0064412359 appDisplay: Remove obsolete property
Since commit f09fbb19c, all app grids use pagination and the old
property is meaningless.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
2021-02-03 20:19:29 +01:00
Florian Müllner
3ff71ac40e iconGrid: Use correct default values in pspecs
The defaults are set in the code right now, but this is about to change.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
2021-02-03 20:19:29 +01:00
Florian Müllner
a9cbbd8017 pageIndicators: Remove animated indicators
Nothing uses them anymore, so clean out the code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1629>
2021-02-03 09:55:29 +01:00
Georges Basile Stavracas Neto
5c7436be3e appDisplay: Never use animated indicators
The app grid itself now is horizontal, and is displayed beneath
workspaces, above the dash. This makes the indicator animations
out of place, as they're not coming from the edge anymore.

Use PageIndicators for both FolderView and AppDisplay.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1629>
2021-02-03 09:55:14 +01:00
Sebastian Keller
454394a267 workspace: Handle window-added and removed signal after window tracker
The new window preview overlay requires getting the app icon for a
window from the window tracker when it gets initialized. The window
tracker listens for the same 'window-added' signal on the MetaWorkspace
that the gnome-shell Workspace listens for to add the window preview.

The window tracker however reconnects all its signal handlers whenever
the number of workspaces changes, which means that its signal handlers
get called after the ones in Workspace ones. So by the time the
'window-added' handler in Workspace is called, the window tracker does
not have an app associated with the window.

To fix this ensure that all window related signal handlers in Workspace
are run after the ones in the window tracker.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3656

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1625>
2021-02-02 23:11:06 +01:00
Alexander Mikhaylenko
9ce666ac13 workspaceAnimation: Move background to WorkspaceGroup
Make each wallpaper have a wallpaper and clip it. Add a separate background
to MonitorGroup and add spacing between each workspace

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3635,
      https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/945,
      https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/948

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
ae4dab761e workspaceAnimation: Disable unredirection during the gesture
Make sure fullscreen apps can't block the animation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
bca654851c workspaceAnimation: Support multiple screens
Currently, there's one animation for the whole canvas. While it looks fine
with just one screen, it causes windows to move between screens when
switching workspaces. Instead, have a separate animation on each screen,
and sync their progress so that at any given time the progress "fraction"
is the same between all screens. Clip all animations to their screens so
that the windows don't leak to other screens.

If a window is placed between every screen, can end up in multiple
animations, in that case each part is still animated separately.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1213

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
8eba759932 workspaceAnimation: Group sticky windows and moving window
Since the transitions consists of window clones now, all the clones appear
above sticky windows. Clone sticky windows as well, and treat them same as
moving window instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
ee5564015a workspaceAnimation: Use a workspace strip
Currently, the workspace swipe transition only has one workspace in each
direction. This works until you try to do multiple swipes in quick
succession. The second swipe would continue the existing transition, which
only has 2 or 3 workspaces in it, and will hit a wall.

To prevent this, take all workspaces and arrange them into a column or row,
depending on the layout, and use that as a transition.

For the transition that happens when focusing a window on another workspace
(for example, via Alt+Tab), still use only two workspaces instead of all of
them.

Since we don't support layouts other than single rows/columns anymore,
diagonal transitions aren't supported anymore, and will be shown as
horizontal or vertical instead.

Since nw alt-tab and gesture transitions are different, don't allow to do
both at once, that is, disable swipe tracker when a programmatic transition
is going. This will also conveniently cancel a gesture transition if a
programmatic one is initiated while a gesture is in progress.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2612

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
9cf300c972 workspaceAnimation: Use window clones
Instead of reparenting windows, clone them. This will allow to properly
support multi-monitor setups in subsequent commits.

Block window mapping animation while the animation is running to prevent
new windows appearing during the animation from being visible at the same
time as their clones.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/929

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
0f99d46f87 workspaceAnimation: Add a background
In future we will need to use window clones to better support multiple
monitors. To avoid having to hide every window, show wallpapers behind
the workspace transition: one per monitor.

Put the wallpaper into a separate class right away, later it will be
useful to make the animation per-monitor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
2f78d32921 workspaceAnimation: Add to uiGroup insead of window_group
This will allow to hide window group completely in the following commits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
e32ec73315 workspaceAnimation: Extract WorkspaceGroup
Simplify the code a bit. The workspace group is relatively self-contained,
so split it from the general animation. Reimplement _syncStacking().

This will help a lot later, with workspace strip and multi-monitor support.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
269c5ca957 workspaceAnimation: Stop depending on shellwm
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Alexander Mikhaylenko
bebd612a8f workspaceAnimation: Split from WindowManager
It's already too complex, and will get more complex in future, split it
out. Update the code style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1326>
2021-02-02 19:35:07 +00:00
Florian Müllner
42c2bf709e windowPreview: Overhaul chrome style
- increase close button size
 - use custom close icon that's better suited
   for the non-default 24pxp size
 - use translucent light gray for both close button
   and window caption

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-02 10:06:23 +01:00
Florian Müllner
30f27412c2 windowPreviews: Replace border with scale effect
We currently use a thick border to indicate the hovered/focused preview. It
works well for that purpose, but is a bit in the face. Slightly scaling up
the preview still provides a clear indication, but in a more subtle and
elegant way.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
27a427421e workspace: Add some padding around window previews
Commit 059ea64 removed the workspace padding after moving the
background into the workspace. However some whitespace around
window previews is still a good idea, and will be necessary
soon as we are about to indicate focus by slightly scaling up
the active preview, and don't want previews to be clipped by
the workspace in that case.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
2bd91e738e workspace: Adjust spacing
Icons are always visible, so in order to not have overlays overlap
with other previews, we need to consider the sum of top- and border
oversizes rather than the maximum.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
56c118de87 windowPreview: Keep borderCenter always visible
We need it to position the icon now, which isn't hidden with the
border.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
efa3585bcc windowPreview: Add (back) application icons
The overview is less visually-busy nowadays, so add back application
icons to make identifying window previews easier.

Fun fact: Removing the icons was part of my very first gnome-shell
contribution!

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
5e10bed458 windowPreview: Allow titles to overlap other previews
We are about to add additional chrome, but still want to use
as much space as possible for the previews. Allowing titles
to overlap other previews should help keeping the additional
whitespace requirement low.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
bc6849c7a2 windowPreview: Track overlay state separately
We currently express the state as a combination of border visibility
and the eventual transition state. That's tedious, in particular if
we want to use the state outside the show()/hide() methods.

Just track the requested visibility in a separate property.

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/81

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1605>
2021-02-01 21:06:13 +01:00
Florian Müllner
de299f0a90 workspaceThumbnails: Center thumbnails in workspace navigator
We always request a natural width based on the maximum thumbnail scale,
but may very well use a smaller scale when allocating. This currently
results in thumbnails being off center, fix this by distributing any
extra space evenly before allocating thumbnails.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1620>
2021-02-01 16:34:37 +01:00
Guilherme Silva
779e66ae88 notificationDaemon: Fix icon-choosing logic
'image-data' (or 'image-path') should take precedence over 'app-icon',
even when both are sent by the application (e.g. Google Chrome).

Fixes #3616.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1616>
2021-02-01 13:58:20 +00:00
Jonas Dreßler
6ae49092c1 workspace: Use Util.lerp() instead of own _interpolate()
Use the utility function we newly introduced instead of having our own
private _interpolate() in workspace.js.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
959639bdc9 windowPreview: Cache the boundingBox of the layout manager
Accessing GObject properties from JS has proven to be quite slow because
of the JS->C->JS roundtrip involved. With the WindowPreview this
actually has an impact since we're accessing those properties very often
while creating new layouts.

So cache the boundingBox and the windowCenter properties of the
WindowPreview using a this._cachedBoundingBox JS object. This might
speed up opening the overview with lots of open windows significantly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
a4bf44734d workspace: Don't store strategy on layout object
We're making the layout object fully owned by the layout strategy, so
store the current strategy somewhere else, that is as a private property
of the class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
39e844ac0c workspace: Refactor layout scale and space calculation
Make computeScaleAndSpace() return an array including scale and space so
we no longer have to access the layout object from outside.

With this we also no longer need to set layout.space, since only the
scale property is needed in computeWindowSlots().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
8d9a92fe98 workspace: Make computeLayout() return a layout object
Start cleaning up the whole mess around the layout object a bit and
return a new object in the LayoutStrategies computeLayout()
implementation. This object is supposed to be opaque to the API user and
will only be passed to the layout strategy.

For now, keep setting a few things on that object from outside, we'll
clean that up later.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
ac7dc62da6 workspace: Move more things to LayoutStrategy subclass
Only keep computeLayout, computeWindowSlots, computeScaleAndSpace and
the contructor in the superclass, the rest is actually layout specific
and won't apply anymore when we introduce the new vertical layout
strategy.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Jonas Dreßler
c635ff490a workspace: Pass params object to LayoutStrategy
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1617>
2021-02-01 13:12:43 +00:00
Florian Müllner
add6dfe2e4 status/dwellClick: Remove menu arrow
This was missed in commit db9a008.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1618>
2021-02-01 11:40:03 +00:00
Abderrahim Kitouni
698e67c486 workspacesView: Fix scroll direction in RTL locales
Scrolling up or down (using the mouse wheel) should scroll to right
or left respectively (rather than the other way around).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1608>
2021-01-30 11:45:22 +00:00
Florian Müllner
151a104f9a dash: Only show separator when there are running apps
The separator is only really needed to distinguish favorite apps
from running apps, the show-apps button is distinct enough already.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1610>
2021-01-30 09:44:11 +00:00
Florian Müllner
9062d5dc78 workspace: Clip background
So that windows don't overflow the workspace background.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
2021-01-29 21:56:05 +00:00
Georges Basile Stavracas Neto
8eb81ae649 overview: Move background to Workspace
Move the background to the Workspace class by introducing a new container
called WorkspaceBackground, which handles clipping the background to the
workarea.

Move the click action from WorkspaceDisplay into each workspace.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
2021-01-29 21:56:05 +00:00
Georges Basile Stavracas Neto
cfc1f1fd9c background: Add option to not use background content size
Will be used by next commit to draw workspaces at a different size of the
background itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
2021-01-29 21:56:05 +00:00
Georges Basile Stavracas Neto
862b5be7a2 background: Trivial style cleanup
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
2021-01-29 21:56:05 +00:00
Florian Müllner
b84eb2437d workspaceThumbnails: Expand workspaces before scale-in animation
When the original animation was implemented, workspaces would only
ever be added at the end. We therefore got away with not having a
separate EXPANDING stage corresponding to the existing COLLAPSING
one when animating out.

Since support for creating in-between workspaces via DND was added,
this is no longer the case. And now that the thumbnails are centered,
the jump is quite noticeable.

Address this by adding new transitional states, so that we can
expand new thumbnails before scaling them in.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1609>
2021-01-29 17:55:44 +01:00
Florian Müllner
ac3faac38c overviewControls: Remove intermediate box
Now that the workspace switcher moved into the view selector, the
box only holds a single child. Cut out the middle man and add that
directly to the parent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1609>
2021-01-29 17:49:52 +01:00
Georges Basile Stavracas Neto
9db9445b0f workspaceThumbnail: Scale workspaces in and out
Make the slide property control the workspace scale, so that new workspaces
scale up, and destroyed workspaces scale down. The scale is done horizontally,
and only slightly vertically, as per design direction.

Rework the state tracking mechanism to remove the COLLAPSING state, since there's
no split between sliding out and collapsing anymore. Also remove the corresponding
'collapse-fraction' property from WorkspaceThumbnail.

Make ThumbnailsBox.vfunc_get_preferred_width() consider the slide-position property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
df2181c913 workspaceThumbnail: Use current number of workspaces for sizes
There are situations where MetaWorkspaceManager and ThumbnailsBox disagree
on the number of workspaces, for example when animating them out. It's more
important to follow the visible number of workspaces while they're updated.

Make vfunc_get_preferred_width() and vfunc_get_preferred_height() use the
current number of workspace thumbnails to calculate their sizes, instead of
MetaWorkspaceManager's n-thumbnails property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
d368bae503 workspaceThumbnail/thumbnailsBox: Set pivot point
Set the pivot point at the center of the ThumbnailsBox so that scaling
in and out looks better.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
451ba5b03a workspaceThumbnail: Remove wallpaper
They'll be replaced by a stylized background color to make them look
symbolic.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
0d4bce9fa7 workspaceThumbnail: Reduce maximum scale to 5%
As per design direction, reduce the maximum workspaces thumbnails to 5% of the
primary monitor size.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
9980c80619 workspaceThumbnail: Allocate final thumbnail sizes
ThumbnailsBox currently allocates each workspace thumbnail using their
porthole size, and scales them down using scale-x and scale-y. This is
slightly problematic since it doesn't allow for properly styling these
thumbnails through CSS.

Rework ThumbnailsBox to allocate workspace thumbnails at their actual
sizes, and scale down the '_contents' actor inside WorkspaceThumbnail.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
3ad7b85e25 workspaceThumbnail: Make it horizontal
Allocate workspace thumbnails horizontally. This requires introducing code
to handle the RTL direction. Do a small rewrite of the DnD hover method to
be simultaneously simpler and easier to follow, and work correctly on RTL.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
99d1529e8c overviewControls: Simplify DashFader
Merge FaderControl and DashFader, since it's the only subclass, and
remove all overview connections that aren't useful for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
f17d9676f8 overviewControls: Move workspaces thumbnails to ViewSelector
This is now all centralized in the apps page, so move the workspaces
thumbnails to ViewSelector's apps page. This allows us to remove
all the slider controls too, since they're now unused.

The transition between showing the workspaces, and the app grid, is
based on the most recent mockups: scale and move it down, and fade it
out.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
456b446394 viewSelector: Rework Ctrl+Alt+Tab support
Now that there's only a ACTIVITIES and a SEARCH page, the old method of handling
keyboard tabbing (extra parameters to ViewSelector._addPage()) limits what we can
do.

Manually set up the Ctrl+Alt+Tab support for each element.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
de15eb3bbc viewSelector: Merge WINDOWS and APPS pages
Add them both in a StBoxLayout subclass with a vertical layout. This
new ActivitiesContainer class already contains an adjustment controlling
the transition between workspaces and app grid states, and althought it
is internal to it, it'll be easy to integrate with gestures in the
future.

Notice that AppDisplay is added before WorkspacesDisplay. That's because
we want the paint order to paint WorkspacesDisplay on top of AppDisplay.

Switch the ViewsPage enum to call this page ACTIVITIES, and adjust the
only caller in OverviewControls to it. At last, rename '_appsPage' to
'_activitiesPage' to also reflect the name change.

The usefulness of organizing this code in pages is lost here, but this
is a transitional state, and pages will be removed in future changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
a29e002a41 workspacesView: Add API to hide workspaces without destroying
This will be used by the next commit to hide workspaces when ViewSelector
switches to the search page, without destroying the workspaces so their
state is preserved.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Georges Basile Stavracas Neto
78f886f42c windowManager: Switch to horizontal workspaces
Do so by removing the workspace override.

Requires https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1684

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>
2021-01-29 15:01:03 +00:00
Florian Müllner
55d85cd55b dash: Add separator between favorite and running apps
Only the area used by favorite apps can be used as drop targets, it
is not possible to add new favorites between the running apps at the
end. While that behavior makes sense, it is currently impossible to
distinguish the two areas with confusing results.

Address this by adding a visual separator between favorites and
running apps.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1606>
2021-01-29 00:30:20 +00:00
Florian Müllner
fec745ffb8 screenshot: Clean up when creating stream failed
Otherwise the tracked screenshot operation will block all future
requests from the same sender.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3618

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1589>
2021-01-28 21:47:50 +00:00
Florian Müllner
0efa82acf0 screenshot: Return error if stream creation failed
When we fail for some reason to open a stream to write the screenshot
to, we currently return `false` to the sender. That's not wrong, but
doesn't provide any hints on what caused the failure, so return the
underlying error instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3618

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1589>
2021-01-28 21:47:50 +00:00
Florian Müllner
1aee0516d6 screenshot: Use separate error when disk writes are locked down
The most likely reason for rejecting a screenshot request is that
there's an ongoing operation from the same sender. Still, we shouldn't
assume that that is the case and return an appropriate error when
writing to disk is disabled via lockdown settings.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3618

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1589>
2021-01-28 21:47:50 +00:00
Georges Basile Stavracas Neto
08ac3c7750 workspacesView/workspacesDisplay: Handle smooth events
On X11, the scroll handler can receive smooth events, which should
trigger a workspace switch. Handle smooth events by checking their
scroll delta, and adjusting the direction depending on these deltas.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1614
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1603>
2021-01-28 15:11:56 +00:00
Georges Basile Stavracas Neto
cffad8b749 workspacesView/workspacesDisplay: Scroll on horizontal layouts
WokspacesDisplay simply remaps the scroll direction into the next
workspace, but that doesn't account for the new horizontal layout.

Scroll horizontally on horizontal layouts when scroll direction is
on the vertical axis.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1603>
2021-01-28 15:11:56 +00:00
Sebastian Keller
0882074ecc screenshot: Still remove select/pick actor if grab promise was rejected
If the grab promise is rejected due to for example on X another app
already having the grab, an error is thrown and the code that would
revert the cursor and hide the actor is not run. This actor then
prevents all mouse interactions with the shell and the windows beneath
it.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2869

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1600>
2021-01-28 02:49:13 +00:00
Florian Müllner
9f0e7632a6 workspacesView: Fix off-by-one error
The scroll adjustment's upper value corresponds to the number of
workspaces, not to the last workspace index. We want the latter
when mirroring the layout in RTL locales, so subtract 1.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1598>
2021-01-26 22:07:15 +01:00
Florian Müllner
ddc2e0f4cb extensionSystem: Fix opening Extensions app from notification
Launching the app is implemented by the source's open() method, but
only external notifications are hooked up to call into the source
when no default action was provided.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1595>
2021-01-26 17:12:04 +01:00
Doan Nam Long Vu
db9a008e8a panel: Remove drop down arrows from standalone indicators
The keyboard/language selector area is the smallest element
on the panel. Additional margin about 6px inside the a11y
and language items to make them comfortable to click targets.

With that, we can remove the remaining arrows.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3567

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1583>
2021-01-26 16:53:42 +01:00
Doan Nam Long Vu
022cd683c4 panel: Remove drop down arrows from AppMenu and AggregateMenu
Following #3567, the design team decided to remove the drop down arrows
from both AppMenu and AggregateMenu.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3567

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1583>
2021-01-26 16:53:42 +01:00
Florian Müllner
55439713f4 appDisplay: Handle dropped app favorites
Now that apps either appear in the dash or the app grid, it makes
sense to allow DND between the two components to add and remove
favorites.

Currently this only works for adding items to the dash, update the
app grid code to also accept drops from the dash.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1594>
2021-01-26 11:36:34 +01:00
Florian Müllner
9f1eb6da2b dash: Replace custom actor with layout manager
We use a custom actor to make sure that the show-apps button remains
visible even when there's not enough space to show all icons.

We can achieve the same result with much less code, by using a custom
BoxLayout layout manager for the icons to override the minimum width.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1592>
2021-01-25 22:53:34 +00:00
Georges Basile Stavracas Neto
62baf524af appDisplay/appFolderDialog: Don't constrain to workarea
With the transparent top bar in the overview, constraining to the
primary monitor's workarea causes the (now visible) area beneath
the top bar to not have the darker background, which causes a visual
discontinuity in the layout.

Don't constrain to the primary monitor workarea.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1590>
2021-01-25 13:10:37 -03:00
Georges Basile Stavracas Neto
eb4f6740c3 workspacesView: Center workspaces of primary display
Currently workspaces are left-aligned to the allocation, which looks
odd after moving the Dash to the bottom.

Allocate workspaces centered both horizontally and vertically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1587>
2021-01-24 10:52:24 -03:00
Razze
bc2cb9d910 appDisplay: Animate opening app icons menu
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2335

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1585>
2021-01-23 20:44:11 +01:00
Sebastian Keller
18cd24e6f4 appDisplay: Fix app folder icon subicon spacing
The code previously was using CSS to define row/column spacing and
padding which was combined with a subicon size computed in code relative
to the requested icon size.

In smaller icon sizes it was possible for the CSS spacing+padding + the
size of the two subicons to exceed the requested icon size. This then
would lead to the label being pushed down for app folders compared to
other icons.

Another more severe issue caused by this would happen if the first item
in an icon grid was an app folder. Then the calculation for the maximum
allowed icon size could be off, leading to all icons in the grid
becoming smaller than actually necessary.

This commit changes this to use homogeneous row and column layouts to
evenly distribute the remaining spacing instead of using a fixed CSS
value.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3069

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1581>
2021-01-21 21:05:30 +00:00
Florian Müllner
8c792969bb appDisplay: Do not duplicate app favorites
With the new position, the dash is now stronger connected to the
app grid than it used to; reflect that by showing apps either
in the grid or the dash, not both (except for non-favorite
running apps).

https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/88

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1580>
2021-01-21 17:17:47 +00:00
Sebastian Keller
c57a299d57 workspacesView: Disable swipe tracker when animating from overview
It was possible to switch workspaces by quickly dragging the workspace
immediately after clicking on a window during the transition from the
overview. This is unlikely something that is intentionally used but can
be confusing and look bad when triggered accidentally.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2993

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1578>
2021-01-21 02:44:13 +01:00
Florian Müllner
a5730d7b30 overviewControls: Make sure dash is positioned at the bottom
We don't want the dash to expand, but if it's given more space
than requested, we want it to be positioned at the bottom.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1577>
2021-01-20 11:34:43 +00:00
Sebastian Keller
353483b052 automountManager: Remove unused volume queue
This is some leftover from code that was used to keep track of volumes
added/removed while the screen was locked before the move to a
components system in 2a800e4c. All that the remaining code does is
filter devices from an empty list.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1579>
2021-01-19 20:55:11 +00:00
Florian Müllner
b3c13d6128 overviewControls: Simplify dash placement
Now that the dash is always visible, it doesn't make sense to keep
it in a separate layer from the main overview group and use a
separate spacer actor as a placeholder.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1575>
2021-01-19 15:06:58 +01:00
Georges Basile Stavracas Neto
1e2532cf25 dash/dashIcon: Popup menu above the icon
Now that the Dash is horizontal, the popup menu of the Dash icons must
show up, instead of left/right.

Make AppIcon.popupMenu() receive an optional parameter with the side
to show the menu, using St.Side.LEFT as default. Override this method
in DashIcon to always pass St.Side.TOP.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
2021-01-19 13:47:06 +00:00
Abderrahim Kitouni
0a23721364 dash: Fix 'All apps' button position in RTL locales
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
2021-01-19 13:47:06 +00:00
Georges Basile Stavracas Neto
97eb4560ef Make Dash horizontal
And move it to the bottom of the overview. Change the height-based calculation
of the icon sizes to be width-based. Put the DashFader in a vertical box, and
make all corners of the Dash equally rounded.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
2021-01-19 13:47:06 +00:00
Georges Basile Stavracas Neto
bd850c3110 overviewControls: Split FaderControl from SlidingControl
The Dash will need only the fading aspect of SlidingControl in the
next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
2021-01-19 13:47:06 +00:00
Georges Basile Stavracas Neto
ea02aa399d overviewControls: Show DashSpacer in apps page as well
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
2021-01-19 13:47:06 +00:00
Razze
f87f9848c3 status/volume: Allow changing input volume by scrolling
Previously scrolling on the volume or input indicator would always
change the volume. This change lets you change the input volume if
you scroll over the input indicator.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3273

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1566>
2021-01-14 01:13:17 +01:00
Jonas Dreßler
87103374fd overview: Increase SHADE_ANIMATION_TIME a bit
The SHADE_ANIMATION_TIME variable sets the duration of the animation of
the background shading that is done when showing the overview. As
explained in the code-comment, that value must be smaller than the
animation time of the overview.

Now since we're going to start animating the background color of the
panel when showing the overview and we're going to use the overviews
animation time for that, we want to make sure the shading of the
background image and the animation of the panel are kept "in sync",
otherwise the transitions would look bad.

So slightly increase the value of SHADE_ANIMATION_TIME to 240 (the
overviews animation time is 250) to make sure those happen in the same
timeframe.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1397>
2021-01-13 23:06:48 +00:00
Jonas Dreßler
0cbccf7403 panel: Animate opacity changes of the panel corner
This is a requirement for fading the transparent panel in and out
smoothly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1397>
2021-01-13 23:06:48 +00:00
Jonas Dreßler
c894ec95cd panel: Indicate focus using a pill-shaped background
The current way of indicating focus of elements in the panel does not
work very well with a fully-transparent panel, a line at the bottom of
the panel doesn't make too much sense if there is no real panel, but
only the text and icons.

To make the indicators look better in this case, switch to a pill-shaped
background color to indicate the focus of items in the panel.

For this to look good, there has to be a small black border above and
below the background, this also requires increasing the height of the
panel (from 1.86em to 2.2em) for visual purposes.

Also, since we now no longer need to color the lower bottom of the
panel, we can remove the custom drawing code for the border of the
panels corner, so do that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1397>
2021-01-13 23:06:48 +00:00
Ivan Molodetskikh
d82dcd6f67 workspace: Don't unfreeze layout during overview animation
During overview closing animation the allocation expands more or less
every frame. Unfreezing the layout then leads to windows snapping to
their new position if e.g. a window was closed which doesn't look nice.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3216

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1550>
2021-01-13 21:40:22 +00:00
Jonas Ådahl
1685c77931 workspacesView: Update scroll position but not workspace on allocate
Not updating the scroll position on allocate caused a glitch, where a
window on a workspace that is not the first one would would be
transparent for one frame when showing the overview.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3507
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1545>
2021-01-11 17:23:26 +01:00
Georges Basile Stavracas Neto
35d8041656 swipeTracker: Switch to 3-finger gestures
As per design feedback, it's time to switch to 3-finger gestures.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3528

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1562>
2021-01-08 14:28:39 -03:00
Georges Basile Stavracas Neto
1134afd12a swipeTracker: Use AFTER trigger edge for TouchSwipeGesture
Otherwise, we can get stray 'begin' signals from the touch gesture.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1562>
2021-01-08 14:27:02 -03:00
Florian Müllner
c5019dbf62 screenShield: Tie LockedHint to locked state
Currently the hint reflects the `active` state, which effectively
corresponds to the screen blank. That's a bit surprising considering
the name, plus the `active` state is already exposed by the ScreenSaver
D-Bus interface for anyone interested.

It seems reasonable that the `LockedHint` property reflects the lock
state, so change the handling to do exactly that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/351

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1561>
2021-01-07 22:43:42 +01:00
Florian Müllner
543261e6eb appDisplay: Disable built-in mouse scrolling
We want to either handle a scroll event ourselves, or delegate it
to the swipe tracker. What we never want is StScrollView's default
handler that doesn't have any knowledge of pages, so disable it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1560>
2021-01-07 14:04:03 +00:00
Georges Basile Stavracas Neto
57f96b28ab workspacesView: Make sure to destroy non-existing workspaces
Even if they're in the end of the list. So far we've managed to not be affected
by this bug because until GNOME 3.38, workspaces didn't have a background, and
there was no way to navigate to these leftover workspaces, but with the proposed
overview changes for GNOME 40 it'll be very much visible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1560>
2021-01-07 14:04:03 +00:00
Georges Basile Stavracas Neto
499af2dd81 workspacesView/workspacesDisplay: Ignore emulated events
When handling all scroll directions, it is imperative to ignore emulated
events. Otherwise we may get the wrong scroll direction, e.g. when natural
scrolling is enabled.

Ignore pointer emulated events in WorkspaceDisplay._onScroll().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1560>
2021-01-07 14:04:03 +00:00
Georges Basile Stavracas Neto
47cd3c5b57 appDisplay: Cleanup BaseAppView
All subclasses of BaseAppView now are horizontal, thus we
don't need to deal with the vertical case anymore.

Remove the corresponding parameter from the BaseAppView
constructor, and move the StBoxLayout that both AppDisplay
and FolderView have in common into the base class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1554>
2021-01-04 15:37:45 +00:00
Georges Basile Stavracas Neto
be279abe9e appDisplay: Make the app grid horizontal
Horizontal pagination is more natural than vertical, but for
historical reasons we ended up with a vertically paginated
app grid.

Make the app grid horizontal.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1554>
2021-01-04 15:37:45 +00:00
Ivan Molodetskikh
c401759c1a workspacesView: Fix copy-paste error
Calling both window-drag handlers on drag begin messes up our tracking,
and prevents the swipe tracker from being disabled during drag operations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1551>
2020-12-27 22:12:08 +01:00
Sebastian Keller
eb95f6a0fa networkAgent: Use VPN specific method to add VPN secrets
Use the method introduced in the previous commit to add VPN secrets
instead of adding them as regular secrets/passwords. This ensures
correct serialization of these secrets.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2105

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1535>
2020-12-25 11:43:13 +01:00
Florian Müllner
e85d127ae3 dateMenu: Fix temperature edge case
We currently format the temperature with a precision of 0, that is
with no digits after the decimal-point. As a result, a temperature
like -0.2 shows up as -0.

Math.trunc() has the same effect as `%.0f` and handles that edge
case correctly, but while at it, we can just as well round the
value properly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3441

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1548>
2020-12-22 09:27:45 +00:00
Joonas Henriksson
a7c343292e theme: Don't draw border around symbolic user-icon
Recent commit [1] added a strong light border around user avatar
icons, in accordance with design mockups.

As a probably unintentional side-effect, the border was also added
around the symbolic fallback icon, which is displayed whenever the
user avatar is not available. This doesn't work well with the current
design, as the strong border makes the subtle fallback icon
background indistinguishable. Additionally, it doesn't match the
design mockups for the symbolic avatar icon [2].

Correct this by adding a style class for when avatar image is used,
and apply the border only for that case.

[1] 498710c2ec
[2] https://gitlab.gnome.org/Teams/Design/os-mockups/-/blob/master/lock-login/username-based-login.png

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1490>
2020-12-17 21:46:41 +01:00
Georges Basile Stavracas Neto
e3542d5849 dash: Allow icon sizes equal to the available space
When checking for a suitable icon size, Dash currently checks which
of the hardcoded icon sizes is smaller than the calculated available
size.

On some circumstances, however, when the calculated available size
is exactly equal to the hardcoded icon sizes, Dash selects a smaller
size. This cascades (the next icon size is exactly the smaller size,
etc) and ends up with always Dash selecting smallest size available,
even with plenty of available space.

Check if the calculated available size is smaller or equal to the
hardcoded icon sizes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1533>
2020-12-11 17:42:56 +00:00
Georges Basile Stavracas Neto
99b78d3ee8 Revert "appDisplay/baseAppView: Cleanup animate()"
This reverts commit cd8269185. It turns out this seemingly
harmless cleanup introduced a regression:

 * Open overview
 * Press Meta+A twice
 * Close overview
 * Press Meta+A
 * Enjoy an invisible grid

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3451

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1532>
2020-12-11 13:24:28 -03:00
Georges Basile Stavracas Neto
0c6df924be lookingGlass: Port to paint nodes
Override vfunc_paint_node(), and add paint nodes to the
root node instead of directly calling CoglFramebuffer APIs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1339>
2020-12-10 16:15:49 +00:00
Jonas Ådahl
78d6b13c29 workspacesView: Don't update scroll position when allocating
Updating scroll position may have significant side effects, e.g.
switching workspace; this should never happen during allocation, as
we're in the middle of painting a frame. So, put it in an idle callback
if we're doing it from an allocation to have the side effects happen the
right time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1527>
2020-12-09 22:09:39 +01:00
Florian Müllner
af5aff3251 dbusServices/screensaver: Split out public ScreenSaver service
Commit 799bbdb50 split out the public Fdo notification service, so
that any app with permission to talk to org.freedesktop.Notifications
will in fact be limited to that service.

To a somewhat lesser extent this applies to the org.gnome.ScreenSaver
service as well, which some applications still use instead of the
Inhibit portal.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3452

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1520>
2020-12-07 16:24:19 +00:00
Florian Müllner
adfcd45bff workspace: Lower maximum window preview size again
In commit 1218e68 we allowed full-sized window previews under the
assumption that we had enough other clues (like the vignette effect)
to differentiate the overview from the regular session.

That didn't hold up in testing, so make the maximum preview size
slightly smaller again.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3464

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1525>
2020-12-07 15:24:37 +01:00
Florian Müllner
cb8b19939d magnifier: Stop exposing D-Bus interface
Screen magnification is the compositor's business, not that of "random"
unprivileged tools. And for cases where a more specialised behavior is
wanted, an extension likely does a better job than a consumer of the
D-Bus API.

In addition to that, exporting the interface has been broken for an
unknown time, because the object that holds the implementation isn't
referenced and thus ends up being garbage collected, whoops.

And last but not least, this gets rid of the last public D-Bus name
that isn't clearly in the system namespace (org.gnome.Shell,
org.gnome.Mutter, org.gtk).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3452

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1523>
2020-12-06 06:18:07 +01:00
Florijan Hamzic
659df23ad3 lookingGlass: Sort extensions alphabetically
Extensions are currently listed in random order, which is hardly
user-friendly. Instead, sort them alphabetically to make the list
easier to parse.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1516>
2020-12-04 02:29:44 +00:00
Georges Basile Stavracas Neto
aca61ad3ee appDisplay/baseAppView: Reinstate fade effect
Bring back the fade effect that was dropped by commit 4e05bcd3b6.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1519>
2020-12-03 14:27:51 -03:00
Georges Basile Stavracas Neto
9c10c34b07 appDisplay/baseAppView: Also consider its own content box when adapting
Otherwise setting margins and paddings from CSS may result in the grid
being adapted to the wrong size.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1519>
2020-12-03 14:24:18 -03:00
Georges Basile Stavracas Neto
cd82691859 appDisplay/baseAppView: Cleanup animate()
Simplify the opacity dance to simply setting it to the initial value
before animating (0 when animating in, and 255 when animating out),
and to the final value after the spring animation is done (vice-versa).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00
Georges Basile Stavracas Neto
b730875012 iconGrid/iconGrid: Wait for icon sizes before running spring animation
To run the spring animation, IconGrid uses the transformed position and size
of the icons. This works okay when IconGridLayout doesn't need to update the
icon sizes, but looks bad when IconGridLayout selects a different icon size.

Wait for the icon sizes to be recalculated, and the icons  beallocated, before
running the spring animation. If no icon size update is pending, run the spring
animation directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00
Georges Basile Stavracas Neto
10d91b52e7 appDisplay/baseAppView: Update page indicators on page-changed
The number of pages doesn't depend on the allocated size anymore. Move updating
page indicators from BaseAppView.adaptToSize() to a IconGrid::pages-changed
callback.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00
Georges Basile Stavracas Neto
b120b17d01 iconGrid/iconGridLayout: Simplify _findBestIconSize()
The 'bestSize' variable isn't necessary anymore, remove it in favor of
simply returning the 'size' or, if no suitable size found, IconSize.TINY.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00
Georges Basile Stavracas Neto
7d4ac04a78 appDisplay/baseAppView: Use a separate flag for animated indicators
In the future, both AppDisplay and FolderView will be horizontal, and thus
using the orientation to determine whether to use animated indicators won't
be enough.

Use a different flag to control that, and make FolderView not use animated
page indicators.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00
Georges Basile Stavracas Neto
3f09876463 pageIndicator/animatedPageIndicators: Implement vertical animation
It is basically the same of animating horizontally, except on the Y axis, and
based on the height of the indicators.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
2020-12-02 22:43:04 +00:00