Commit Graph

7584 Commits

Author SHA1 Message Date
Jonas Dreßler
baeb4079ee workspacesView: Avoid setting invalid geometries on views
The fullGeometry and the actualGeometry of the WorkspacesDisplay are set
from the allocation of the overviews ControlsManager and the
WorkspacesDisplay, that means they're only valid after those actors got
their allocations during Clutters allocation cycle.

Since WorkspacesDisplay._updateWorkspacesViews() is already called while
showing/mapping the WorkspacesDisplay, that allocation cycle didn't
happen yet and we end up either setting the geometries of the views to
null (in case of the fullGeometry) or to something wrong (a 0-sized
allocation in case of the actualGeometry).

So avoid setting invalid geometries on the views by initializing both
the fullGeometry and the actualGeometry to null, and then only updating
the geometries of the views after they're set to a correct value.

Note that this means we won't correctly animate the overview the first
time we open it since the animation depends on the geometries being set,
but is being started from show(), which means no allocations have
happened yet. In practice this introduces no regression though since
before this change we simply used incorrect geometries (see the 0-sized
allocation mentioned above) on the initial opening and the animation
didn't work either.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1119
2020-06-14 14:44:10 +00:00
Jonas Dreßler
c5634335b0 workspace: Remove WindowOverlay in favour of new overlays of WindowClone
Start using the new overlays we introduced in the last commit and remove
the WindowOverlay class and the objects for keeping track of them in the
Workspace.

The new layout which doesn't use the -shell-close-overlap CSS property
anymore sligthly changes the position of the close button to be a bit
further away from the actual window.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:50:08 +02:00
Jonas Dreßler
2b4317349f workspace: Set maxChromeWidth to window clone width
So far we allowed the titles of window overlays to expand their width to
be larger than the actual WindowClone, they could expand to the full
size of the Workspace.

Since we're now going to implement those titles as part of the
WindowClone itself, having this feature is no longer possible as easily
as it was before. That's because the clones are stacked according to the
stacking of the actual windows, and since the overlay-elements are
attached to those clones, they will also be shown underneath other
clones.

So stop allowing the titles to expand and limit their size to the width
of the clone, which makes sure titles never get shown above or
underneath other clones.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:50:08 +02:00
Jonas Dreßler
96bfd1f8be workspace: Adjust for close button side in chromeWidth
When the close button is shown on the left side of the WindowClone, we
also need to return its width in chromeWidth() on the left side instead
of the right side, so do that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:50:08 +02:00
Jonas Dreßler
33ab53068e workspace: Add window overlay to WindowClone
Add the window overlays we're currently showing using the WindowOverlay
class to the WindowClone class and implement them using
ClutterConstraints instead of the old fixed position/size layout, which
had to be used because the workspaces were scaled, and the title and app
icon were kept unscaled using a separate layer.

Specifically, this is done by adding the ClutterClones to a static
container owned by the WindowClone and adding the elements of the
overlay as children to the WindowClone itself. That way the
overlay-elements can use the container as a source for their constraints
and we avoid having to make sure the overlays remain visible above the
ClutterClones.

We're not using the new overlays yet, they're hidden by default and
showOverlay() isn't called anywhere yet.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:50:06 +02:00
Jonas Dreßler
40123ae6da workspace: Close windows using new layout manager API
Now that we have a new API to get all the windows and metaWindows from
our layout manager, implement the deleteAll() method of the window clone
using that API instead of looping through the children of the actor and
using the source of the ClutterClone.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:49:31 +02:00
Jonas Dreßler
df149524d4 workspace: Add API to get windows and metaWindow to WindowCloneLayout
This will allow us to remove the remaining parts of the WindowClone
looping through children in favour of simply getting an array with the
windows or metaWindows and looping through that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:49:31 +02:00
Jonas Dreßler
f0ee9cdcf8 util: Remove unused class CloseButton
This looks like it was used to create the close buttons in the overview
at some point, we're no longer using it nowadays though, so remove it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
2020-06-11 20:49:31 +02:00
Chingkai
d2cf13eff4 unlockDialog: Set Switch User Button via _updateUserSwitchVisibility
This commit will set the button invisible when the user's can_switch
is false (e.g. when the session is remote) or user-switch-enabled is
disabled.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2687
2020-06-10 23:02:55 +08:00
Georges Basile Stavracas Neto
0561af66e7 overview: Adapt to MetaBackgroundContent
The properties are now defined in MetaBackgroundContent.
Animate the ClutterContent properties.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1309
2020-06-09 20:10:52 +00:00
Georges Basile Stavracas Neto
1e9b170d87 background: Adapt to MetaBackgroundContent
The properties are now part of MetaBackgroundContent, so set
the properties there instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1309
2020-06-09 20:10:52 +00:00
Georges Basile Stavracas Neto
be02f76aa7 iconGrid: Trivial comment cleanup
There's no PaginatedIconGrid anymore

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:30 -03:00
Georges Basile Stavracas Neto
687928e7b7 appDisplay: Don't fade icons when a folder dialog is open
The folder dialog itself now has a background, there's no
need to fade the icons anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:30 -03:00
Georges Basile Stavracas Neto
ffdf3feb04 appDisplay: Fade the dialog background
As a last step towards the better app grid, add a semi-transparent
black background to the folder dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:30 -03:00
Georges Basile Stavracas Neto
a60b8b3b50 appDisplay: Set minRows to 3 in folder dialog grid
It gives the folder dialog a better layout overall. This is
going to be replaced in the future by the new icon grid code,
but it's a good improvement to have until there.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:30 -03:00
Georges Basile Stavracas Neto
3d6add68c7 appDisplay: Hide folder icon when dialog is open
In such a way that gives the illusion of the icon becoming
the dialog itself.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:30 -03:00
Georges Basile Stavracas Neto
85e055ffe3 appDisplay: Don't change search entry's reactive state
The folder dialog eats all events now, there's no need to
disable the search entry anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:29 -03:00
Georges Basile Stavracas Neto
1691e422e7 appDisplay: Remove unused variable
As the title says.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:29 -03:00
Georges Basile Stavracas Neto
f442c9510e appDisplay: Fix misnamed variable
This should have been renamed to "displayingDialog" by
commit 7781f973f2.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:29 -03:00
Georges Basile Stavracas Neto
0de98eb772 appDisplay: Don't connect to 'space-closed'
This signal doesn't exist anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:14:29 -03:00
Georges Basile Stavracas Neto
30172b5625 appDisplay: Popdown folder dialog on DnD
So that we're still able to drag icons out of folders, and to the
Dash. Wait 600ms (MENU_POPUP_TIMEOUT) before popping it down.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:13:30 -03:00
Georges Basile Stavracas Neto
8ae99a6898 appDisplay: Remove event blocker
It is unused now.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
5cfe5bf8c8 appDisplay: Move click action to dialog
Now that the folder dialog covers the whole primary
monitor, it eats all input events, and doesn't allow
the event blocker to detect clicks.

Move the click action to the folder dialog itself, and
popdown the dialog if a click is triggered on the dialog
(but not on any children).

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
c790c01a3b appDisplay: Move adaptToSize call to FolderView
There is absolutely no need to handle this in the dialog
itself.

Move the call to adaptToSize into FolderView.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
d4a947b475 appDisplay: Zoom dialog child in and out
Instead of zooming the dialog itself, zoom its only
child, which is the "actual" user-visible dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
60d7999b6a appDisplay: Make AppFolderDialog subclass St.Bin
It'll simplify things a bit.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
c040d08b97 appDisplay: Make folder dialog cover the whole screen
Future commits will improve input handling of the folder
dialog, and they'll require the dialog to cover the whole
primary monitor.

Add another internal, center-aligned container to the
folder dialog, and make it cover the whole available area.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
3a53b25873 appDisplay: Constrain dialog to primary display
Much like the overview controls themselves are tied to the
primary display, constrain the folder dialog to the primary
display as well.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Georges Basile Stavracas Neto
d8e6f654a3 appDisplay: Add folder dialog to overview group
Right now, the app folder dialog isn't really a dialog,
since it is actually added to the AppDisplay. Furthermore,
having it added in AppDisplay may mess up with its sizing
calculations, since AppDisplay has a ClutterBinLayout and
the folder dialog has a fairly large minimum size.

Add the folder dialog to the overview group. Next commits
will adjust various actors to be able to better handle it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
2020-06-09 16:01:08 -03:00
Florian Müllner
fdd9def922 dateMenu: Add "Events" section
Events have a clear and obvious connection to the calendar, and similar
to the Clocks and Weather sections there's a strong link to a particular
application.

Adding them as another section to the right-hand side of the calendar
therefore presents a viable alternative to the old events section.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1282
2020-06-06 01:04:09 +02:00
Florian Müllner
771050f4d7 messageList: Remove setDate() method
Since the events section has been removed and visibility no longer
depends on the date, it's not used by anything anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1282
2020-06-06 01:04:09 +02:00
Florian Müllner
8451df977c calendar: Simplify placeholder
Without the events section in the message list, the placeholder can only
reflect whether or not there are notifications.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1282
2020-06-06 01:04:09 +02:00
Florian Müllner
ff55cf017e calendar: Don't restrict section visibility by date
The idea behind hiding the notifications and media section on days
other than today was that they represent present activity together
with today's events, in contrast to past and future events from
other days.

After events were moved out of the message list, that behavior is
no longer useful: We just guarantee that the left-hand side of the
calendar will always be empty when browsing the calendar.

Adjust to that by removing the limitation by date.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1282
2020-06-06 01:04:09 +02:00
Florian Müllner
d36a180852 calendar: Remove events section from message list
While treating notifications as a type of present event was a neat
concept, there are some issues with it that we never managed to
address (not least the inability to "open" an event).

So remove the current events section from the message list; we'll
bring back events in a different form later.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1282
2020-06-06 01:04:09 +02:00
Jonas Dreßler
4582d7a183 workspace: Remove no longer valid comment
This comment is no longer correct, we're not inserting any actors here
to adjust for the window border, but we're modifying the allocation of
the children to adjust for that border.

Since that happens in the layout manager anyway, remove the comment
here.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1297
2020-06-04 17:40:09 +00:00
Jonas Dreßler
cc5ed2fbf5 workspace: Use generic _addWindow function to add new clones
Now that we handle all ClutterClones belonging to the WindowClone pretty
much the same, we can add a generic _addWindow function to WindowClone
which creates the ClutterClone and adds it to the layout manager.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1297
2020-06-04 17:40:09 +00:00
Jonas Dreßler
a2545d186a workspace: Implement windowCenter using bounding box
This isn't quite the same as the allocation, but it's what the workspace
actually wants to use given that we use the bounding box of the
WindowClone for all the layout calculation.

So instead of calculating the windowCenter in the WindowClone, make use
of the bounding-box property of the layout manager and return the center
point of that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1297
2020-06-04 17:40:09 +00:00
Jonas Dreßler
1ea22a5281 workspace: Use bounding-box property from layout manager
Make use of the new bounding-box property we introduced for the
WindowClones layout manager in the last commit.

With this we can remove all the bounding box calculation code from the
WindowClone class and simply use the "notify::bounding-box" signal to
notify changes to our size. To make sure users of the WindowClone don't
break, we now have to convert the layout managers ClutterActorBox in our
getter function to a JS object.

Since we now also don't have to connect to the "destroy" signal of the
attached dialogs anymore, we can remove _disconnectSignals() and only
listen to "destroy" of the toplevel window.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1297
2020-06-04 17:40:09 +00:00
Jonas Dreßler
090057d2df workspace: Track windows in WindowClone layout manager
Move the tracking of the bounding box and all the layout related things
out of the WindowClone class and into the layout manager. This allows
the layout manager to keep track of its windows itself and simply notify
the new bounding-box property in case that box changes.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1297
2020-06-04 17:40:08 +00:00
Georges Basile Stavracas Neto
8154728d09 environment: Add Math.clamp
The good old clamp function, now part of the Math family.
Clamp is happy after so many years of loneliness.

This is a strict implementation of the draft ECMAScript
proposal.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
2020-06-03 12:55:53 -03:00
Georges Basile Stavracas Neto
5569090d1c viewSelector: Make sure it's invisible when overview is hidden
Instead of overriding the hide() method, use the vfunc to
reset, and hide the workspaces display too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
2020-06-03 12:55:45 -03:00
Georges Basile Stavracas Neto
fc3bc7678d viewSelector: Rename show to animateToOverview
The same reasoning as the previous commits.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
2020-06-03 12:55:45 -03:00
Georges Basile Stavracas Neto
8914a46669 workspacesView: Override vfunc_hide
Override the hide vfunc instead of the plain hide() method.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
2020-06-03 12:55:42 -03:00
Georges Basile Stavracas Neto
e7ec373aee workspacesView: Rename show to animateToOverview
WorkspacesDisplay is a ClutterActor subclass, and overriding
the show and hide methods require chaining up, otherwise the
actor isn't actually shown or hidden.

To avoid clashing with the pre-existing show method, rename
to animateToOverview.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
2020-06-03 12:54:05 -03:00
Jonas Dreßler
fe131f926d workspace: Increase window clone fade duration to 200 ms
The current value of 100 ms is barely noticable and looks very abrupt,
use 200 ms instead which make it feel like an actual transition.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1296
2020-06-02 23:43:52 +00:00
Florian Müllner
b487846c0a notificationDaemon: Try harder to find a matching app
Unlike the desktop-entry hint, the app name is not optional. That
doesn't mean that we'll be able to match it to a .desktop file,
but we can at least try if we fail to match on PID or desktop-entry.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1291
2020-06-02 23:17:24 +00:00
Jonas Dreßler
7bbce1d5ad workspace: Position clones using width and height instead of scale
Since we now have a layout manager for the WindowClone that allows
allocating it a size that isn't the absolute size of the window, we can
now give the WindowClone an artificial size and it will get scaled
accordingly.

So make use of that and stop positioning WindowClones using fixed
position and scale and use a fixed position and fixed size instead. This
will make it easier to use a ClutterLayoutManager to allocate the
WindowClones, because layout managers should only set the allocation of
their children, not the scale.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
2020-06-02 23:03:06 +00:00
Jonas Dreßler
bf40d96a83 workspace: Use boundingBox to get absolute width and height of window
Since we're going to override the fixed width and height of the
ClutterActor the WindowClone is subclassing, remove those confusing
getter methods for width and height and switch to the public boundingBox
for getting that information.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
2020-06-02 23:03:06 +00:00
Jonas Dreßler
2d650e51a5 workspace: Use boundingBox instead of getOriginalPosition()
The getOriginalPosition() API of WindowClone can easily be replaced by
using the existing boundingBox property, which reflects the windows
bounding box in absolute coordinates. This property is also used
everywhere else in the Workspace object, so we can use it here, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
2020-06-02 23:03:06 +00:00
Jonas Dreßler
85d2837466 workspace: Allow allocating smaller sizes for window clones
Change the preferred size functions of the layout manager of window
clones to allow allocating smaller sizes, too. Also scale down the
allocation sizes of the ClutterClones our allocate implementation so
the ClutterClones will scale their texture accordingly.

This will enable us to position the window clones using their allocation
size instead of their scale, which is necessary when introducing a new
ClutterLayoutManager that positions the window clones.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
2020-06-02 23:03:06 +00:00