Commit Graph

7139 Commits

Author SHA1 Message Date
Jonas Dreßler
8357739ef8 workspace: Stop exporting window actor in the WindowPreview
Having a public property exporting the MetaWindow is enough to get the
window actor, too, so remove the public realWindow property and while at
it, rename that property to _windowActor, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
6bef9334b7 workspace: Initialize WindowPreview using a MetaWindow
MetaWindow is Mutters representation of a window and provides all the
APIs about it, MetaWindowActor is just the ClutterActor that's drawing
that window. So use a MetaWindow to create a WindowPreview instead of
the window actor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
8c49f45ac8 workspace: Set overviewHint on MetaWindow
We want to stop using the MetaWindowActor for things which are actually
related to the MetaWindow, one more thing where we can change that is
the overviewHint, which is currently added to the MetaWindowActor.

So move that hint to the MetaWindow and stop calling
get_compositor_private() in a few more places.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
46600740fe workspace: Stop using WindowPreview.realWindow in the overview
We can simply get the MetaWindowActor by calling
MetaWindow.get_compositor_private(), so stop accessing the realWindow
property of WindowPreview. For this we also have to make _isMyWindow()
and _isOverviewWindow() take a MetaWindow as an argument instead of a
MetaWindowActor.

Since the WorkspacesThumbnails are also drop targets for WindowPreviews
and their WindowClones also have the public metaWindow property, switch
to using the metaWindow property there, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:10:01 +02:00
Jonas Dreßler
c281e868a0 workspace: Only pass MetaWindow to WindowPreviewLayout
Since the WindowPreview class rarely needs to handle the actual actor
painting the window preview, refactor the WindowPreviewLayout a bit to
only pass a MetaWindow to its addWindow() and removeWindow() functions.

Also make the getWindows() function return an array of MetaWindows,
which makes the getMetaWindow() function obsolete, so remove that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:09:54 +02:00
Jonas Dreßler
039431a73f workspace: Stop using clone terminology in WindowPreviewLayout
We're going to remove ClutterClones, so call the parameters to
addWindow() and removeWindow() "actor" instead of "clone". Also make the
destroyIds less confusing and rename the actual actor destroy id to
"destroyId", and rename the window actors destroy id to
"windowActorDestroyId".

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 14:04:10 +02:00
Jonas Dreßler
d4f8ea1c53 workspace: Make some functions in WindowPreview private
Now that the WindowPreview also shows the overlays itself, we can make
some functions private.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
96f5e2b33e workspace: Call _activate() directly when clicking the window preview
We can remove the simply callback function in favour of an anonymous
function here.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
93a542d52c workspace: Set WindowPreview offscreen redirect inside constructor
This can also be moved to constructor, so do it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
f4fcba74ff workspace: Remove slot property of WindowPreview
Since the slot property was only accessed by the old WindowOverlays to
get the position and size of the preview, we can safely stop setting it
and remove that property now.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
cadbf7cd8b workspace: Rename WindowClone to WindowPreview
Since ClutterClones are going to be removed, let's switch the
terminology here to something that's more understandable and rename the
WindowClone class and its layout manager to
WindowPreview/WindowPreviewLayout.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
2020-06-16 13:55:17 +02:00
Jonas Dreßler
c23ad83c59 windowManager: Warn when removing old animationInfo
Now that we properly notify mutter about when a size-change animation
has ended, it should never happen that a new size-change animation is
started without the last one being cancelled (ie. 'kill-window-effects'
being emitted).

This means there should also never be an old animationInfo attached to a
window actor, so warn in case we still find one when starting the
animation.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251
2020-06-15 13:12:03 +00:00
Jonas Dreßler
4a6f550acb windowManager: Use new mutter API to freeze window actors ourself
We're currently using the hack of telling mutter that our effect is
completed (even though it isn't) in order to unfreeze updates of the
window actor.

This causes a bug with detecting the wl_outputs a window is
visible on, because the MetaWindowActor emits its "effects-completed"
signal too early, making Mutter update the wl_outputs while we're doing
the animation.

Now since meta_wayland_actor_surface_is_on_logical_monitor() uses the
transformed position and size of the MetaSurfaceActor and is being
called right after we setup the animation (but before it actually
starts, that happens at the next paint cycle) it will use a "very wrong"
rectangle: The transformation has been set to move the actor back to its
old position, and while we did already unfreeze updates and called
clutter_actor_set_position() in meta_window_actor_sync_actor_geometry(),
the actual allocation is not updated yet; this makes
clutter_actor_get_transformed_position() return a position including in
the new transformation, but not including the new allocation, and the
rectangle ends up being moved to the next monitor or completely out of
the stage.

To fix this issue properly, we need to decouple unfreezing actor updates
from emitting the "effects-completed" signal, which is now possible with
the new meta_window_actor_freeze() and meta_window_actor_thaw() APIs. So
use those new methods to freeze and thaw actor updates ourselves and
make sure to call shellwm.completed_size_change() only after the
animation has finished.

Mutter MR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1250

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/513

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251
2020-06-15 13:12:03 +00:00
Jonas Dreßler
8078d78c30 windowManager: Also clear animationInfo when size-changed wasn't emitted
It might be that we receive a "kill-window-effects" signal between the
emission of the "size-change" and the "size-changed" signal.

In this case we already have the animationInfo attached to the window
actor, so we should also remove it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251
2020-06-15 13:12:03 +00:00
Jonas Dreßler
d7185d71c6 windowManager: Clean up starting of size-change animations a bit
We can do without having two calls to shellwm.completed_size_change() in
there, so use an early return for all cases.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251
2020-06-15 13:12:03 +00:00
Sebastian Keller
522ecba180 workspace: Center overlay close button on border using guide actor
This makes use of the invisible actor introduced in the previous commit
to center the close button on the border.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1313
2020-06-14 21:58:47 +00:00
Sebastian Keller
9b22f6183f workspace: Use invisible guide actor to center overlay title on border
Using CSS to center the title actor on the border is a bit ugly, because
it requires the CSS to match the calculations used in chromeHeights().
Also it is not possible to use CSS margins for cases where the position
of the actor is determined at run time, such as for the close button.

Instead use an invisible actor that spans between the horizontal and
vertical center lines of the border as guide when aligning the title
actor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1313
2020-06-14 21:58:47 +00:00
Florian Müllner
b2c35e4fb0 workspace: Unbreak reposition animation
Commit 1ea22a5281 broke the window reposition animation when it
based the ::size-changed signal on the layout manager's bounding box
instead of the MetaWindow::size-changed signal.

That's happening because of the combination of:

  1. we adjust to window size changes immediately without animations
  2. closing a window triggers a change to a 0x0 bounding box which
     is not treated as a size change

Fix this by addressing the 2nd factor, and don't treat a change to
a 0x0 bounding box as size change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2901
2020-06-14 21:20:36 +00:00
Jonas Dreßler
af543daf1c workspacesView: Only animate on show() when geometries are already set
Animating the window clones of the overview requires the fullGeometry
and the actualGeometry to be set, which they won't be when showing the
overview for the first time. So don't even try to animate the window
clones in that case because the geometries will still be null and
accessing them in workspace.js will throw errors.

The workspace views will still get the correct layout as soon as the
allocations happen because syncing the geometries will trigger updating
the window positions. Since animations are disabled for position changes
when syncing the geometry though, we won't get an animation and the
clones will jump into place. That's not a regression though since before
this change we also didn't animate in that case because the geometries
used were simply wrong (the actualGeometry was 0-sized as explained in
the last commit).

If we wanted to fix the initial animation of the overview, we'd have to
always enable animations of the window clones when syncing geometries,
but that would break the animation of the workspace when hovering the
workspaceThumbnail slider, because right now those animations are "glued
together" using the actualGeometry, so they would get out of sync.

The reason there are no errors happening in workspace.js with the
existing code is that due to a bug in Clutter the fullGeometry of
WorkspacesDisplay gets set very early while mapping the WorkspacesViews
(because the overviews ControlsManager gets an allocation during the
resource scale calculation of a ClutterClone, see
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1181), so it
won't be set to null anymore when calling
WorkspacesView.animateToOverview().

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1119
2020-06-14 14:44:10 +00:00
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
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
Jonas Dreßler
25985868e8 Revert "workspace: Animate window clones using translation properties"
We're going to add a ClutterLayoutManager responsible for allocating the
WindowClones. Since layout managers should only set the allocation of
actors, not the translation or scale, we need to position the
WindowClones using their x, y, width and height properties.

The first step for this is to revert this commit, which switched from
setting fixed positions on WindowClones to using the translation
properties.

This reverts commit 8929c89d1f.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1294
2020-06-02 23:03:06 +00:00
Georges Basile Stavracas Neto
393c6c6805 lookingGlass: Add actor tree inspector
Being able to visualize the actor tree is a handy feature
to have, specially when debugging the hierarchy.

Add a new "Actors" tab to the Looking Glass with the actor
tree inspector. The tree is cleared on unmap to not get
heavy on the number of actors.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1292
2020-06-02 12:44:21 -03:00
Jonas Dreßler
988f996407 workspace: Also hide attached dialogs in WindowClone from picking
As explained in the comment in _init() of WindowClone, we hide the
actual clone from picking so it doesn't interfere with XDND.

This description applies to the clones of the attached dialogs just as
well though, so hide the clones of attached dialogs from picking, too.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1293
2020-06-01 14:01:39 +00:00
Carlos Garnacho
315c8820ca padOsd: Apply specific CSS to Button/Leader SVG classes
Applying a fill operation on the Leader line path seems to close
it, resulting in filled polygon. Bug or not this is not the intended
result here, we can do less ambiguously by not specifying the fill
CSS property to the Leader class.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
8a89de04a2 padOsd: Keep label coordinates in image coordinates
Apply the necessary transforms to map those coordinates to actor
positions in the allocate phase. This all fits since it's the place
where we do know the size the actor will have.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
63abfc163d padOsd: Cache label coordinates/arrangements
This is actually static for a given PadDiagram, as it always represents
a single device.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
f58cb34065 padOsd: Only allocate child labels within allocate vfunc
Make both start/stop edition and label updates queue a relayout, and
only deal with child allocations in the allocate method.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
ece1329145 padOsd: Drop needless call
If we got this far, we are dealing with an already known label.
There's no need for this check.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
989118981b padOsd: Use map to store misc action label data
We'll be adding more stuff here, so it's a bit inconvenient to keep
it an array.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
c511c469fe padOsd: Move all coord/existence checks to _addLabel()
Drops some repetitive code. Also rely completely on the label/leader
elements being found in order to find buttons/rings/strips.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
dac05c7e53 padOsd: Make label coordinates API "private"
This is only called internally, and only needed there.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
c90e7ce258 padOsd: Move button/ring/strip label creation to PadDiagram
It's the natural container of those. We can create all those labels
internally, and only expose the updateLabels() method to update them
wholesome.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
963f96292d padOsd: Fix double styling
We set the StLabel style property, there's no need to re-apply the
large/bold text style via markup. Makes the StLabel text size consistent
across editable state changes.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
989ee6593b padOsd: Disable ellipsizing in title label
We make the label text large and let it ellipsize. It ends up doing
so instead of allowing the label to expand. This title is important
and we don't want it to be ellipsized, so ensure that won't happen.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Carlos Garnacho
2a8eea1ff5 padOsd: Fix .allocate() call
This was not updated to the API change in commit 9a8ced9f5b.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290
2020-05-29 18:06:48 +00:00
Florian Müllner
55c287280b screenshot: Properly clean up if PickColor() is cancelled
We currently only remove the screenshot operation from the shooter
map if the color pick operation completed successfully, but not if
it was cancelled. As a result, we now reject any further requests
from the same sender because we assume that there is an ongoing
operation.

Fix this by moving the cleanup to a finally clause that runs for
both code paths.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1288
2020-05-29 00:52:33 +02:00
Florian Müllner
1fdd4ff313 screenshot: Return an error when operation is blocked
Right now _createScreenshot() returns a tuple that indicates failure
when a sender requests a screenshot operation before a previously
started operation finished.

However that doesn't work for the PickColor() method, as it uses a
different return type than the other methods.

Address this by returning an error instead, which works in any case;
arguably trying to start multiple operations in parallel is an error
by the caller more than it is a failed operation anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1288
2020-05-29 00:52:33 +02:00
Florian Müllner
dc27db0897 iconGrid: Remove fillParent support
This was only used by the frequent view to display as many children
as fit the available space. Now that the view is gone, there's no
need to keep the support ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1286
2020-05-28 00:31:49 +02:00
Georges Basile Stavracas Neto
f09fbb19cf iconGrid: Merge PaginatedIconGrid and IconGrid
Now that the only user of the IconGrid is AppDisplay, and
it only uses the paginated icon grid, there's no point in
having the two classes split anymore.

In addition to that, future commits will introduce a layout
manager that will extend current icon grid features, and
merging PaginatedIconGrid and IconGrid in the same class will
vastly simplify this transition.

Merge PaginatedIconGrid into IconGrid, and adapt AppDisplay
to this change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1267
2020-05-27 19:23:56 -03:00
Georges Basile Stavracas Neto
846fa77b37 appDisplay: Merge AppDisplay in AllView
Now that AllView is the only actor that AppDisplay creates,
we can actually merge them together.

Merge AllView in AppDisplay, remove what used to be AppDisplay,
and rename AllView to AppDisplay.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/880
2020-05-27 21:06:36 +00:00
Georges Basile Stavracas Neto
b57bcf823f appDisplay: Simplify AppDisplay
Inherit St.Widget and remove the custom layout manager. Instead,
override vfunc_allocate(). Also remove the view stack.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/880
2020-05-27 21:06:36 +00:00
Georges Basile Stavracas Neto
548e19a7cd appDisplay: Remove Frequent view
The Frequent apps grid has a few problems:

 * On a fresh install there would be no history of app usage so the
   applications shown in the grid have no relevance it takes time
   to be useful instead of being useful from the start;

 * The grid has far too many items in it to be relevant; 24 apps is
   well beyond the average use case as most people don't frequently
   use that many, so it gets populated with several apps that are
   single use (hello xterm);

 * The position of items in the grid are always changing based on an
   unknown frequency metric (and not by user-intended input) which
   makes it a poor way to quickly launch apps as one would have to
   constantly learn the positions of the items in the grid;

 * Having two app grids is a bit superfluous and needlessly complicates
   the app launching navigation: you have to spend time checking the
   frequent grid and if it's not there you have to switch over to another
   grid and find the app you need in there it's not straightforward.

Remove the Frequent tab and simplify the related code.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1425

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/880
2020-05-27 21:06:36 +00:00
Florian Müllner
4ae04d5aa8 power: Fix icon when discharging at 100%
The special-case for a fill level of 100 introduced in commit 5fd52e99d3
should only apply when charging, for the discharging state there's a
proper battery-level-100-symbolic icon.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2286
2020-05-26 21:27:42 +02:00
Björn Daase
8c909e37e9 panel: fix size of battery percentage label
Adjust the label of the (optional) battery percentage in the top
bar to have the same size as all other text in the top bar.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2652
2020-05-24 16:37:57 +00:00
Florian Müllner
f06223df48 screenshot: Add preview to color picker
With color picking implemented in the compositor, we
can do better than letting the user pick a pixel with
the crosshair cursor, and present them with a preview
of the color that will be selected.

Do this by replacing the cursor with a custom icon and
apply a recoloring effect, where we replace a given color
with the color of the currently hovered pixel (similar
to a green screen).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/451
2020-05-22 16:10:43 +02:00
Jonas Dreßler
9a8ced9f5b search: Remove usage of allocation flags
Allocation flags have been removed from Clutter, and commit
400d045a6a accidentally added their
arguments again which causes a warning, so remove those arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1276
2020-05-22 10:18:24 +00:00
Florian Müllner
48e6a58250 extensionSystem: Don't log error name
logExtensionError() currently saves the error message by calling
toString() on the passed error. That's convenient as it allows to
pass a string instead of a "proper" error, but the result isn't
great for the common Error case: Its toString() method prefixes
the message with the error name, which usually is just "Error:".

The plain message is more suitable for displaying it to users,
so use that for Error objects.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2337
2020-05-21 21:45:04 +00:00
Jonas Dreßler
faaed642a7 js: Listen to notify::allocation instead of allocation-changed
ClutterActors "allocation-changed" signal was removed since it's no
longer needed now that there are no ClutterAllocationFlags anymore.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1245
2020-05-20 15:12:36 +02:00
Jonas Dreßler
9b99b67fea Remove ClutterAllocationFlags
Those flags were removed from Clutter since they're pretty much unused,
so remove them here, too.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1245
2020-05-20 15:12:03 +02:00
Georges Basile Stavracas Neto
693dd79d28 iconGrid: Remove dead code
Remove unused methods from IconGrid.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1265
2020-05-19 16:40:49 -03:00
Georges Basile Stavracas Neto
400d045a6a search: Replace IconGrid from grid search results
Replace the usage of IconGrid in the grid search results by
a custom layout manager that only allocates as many children
as the actor can fit.

This new layout manager does not implement changing the icon
size depending on the screen size.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1265
2020-05-19 16:40:49 -03:00
Florian Müllner
e20cf1ac78 environment: Replace monkey-patched method with Symbol.iterator
This allows using the actor itself as iterator:

  for (let child of container)
      doStuff(child);

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1269
2020-05-19 21:33:31 +02:00
Florian Müllner
8d4e650a95 environment: Monkey-patch iterate_children() generator
This is a small convenience method for using ClutterActor's iterator API
with javascript's built-in iterator protocol, for example as:

  for (let child of container.iterate_children())
      doStuff(child);

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1268
2020-05-19 21:07:20 +02:00
Florian Müllner
82fd68b985 notificationDaemon: Fix grouping by PID
For fd.o notifications, we are taking the sender's PID into
account when associating notifications with sources (mainly
to deal with notify-send).

This broke when the implementation under the well-known name
was moved into a separate service, as the implementation in
gnome-shell will now always see the public notification-daemon
as sender.

Restore the old behavior by resolving the sender PID in the
separate service, and pass it as hint to the implementation
in gnome-shell.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2592
2020-05-19 08:24:07 +00:00
Florian Müllner
6ddd43f361 extensionSystem: Prevent broken updates
Spidermonkey caches imports, which means that uninstalling an
old extension version and installing a new one doesn't work as
expected: If the previous version was loaded, then its code will
be imported instead.

For the last couple of releases this has been a reliable source
of extension bug reports after major GNOME updates. Thankfully
chrome-gnome-shell removed its update support in favor of our
built-in support now, but users may still use older versions
or perform those actions manually, so it still makes sense to
catch this case and set an appropriate error.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1248
2020-05-18 20:41:06 +00:00
Florian Müllner
4e2ae30a47 dateMenu: Remove unused property
This is a left-over from an earlier iteration where the session's
presence status was used rather than the GSetting.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2796
2020-05-18 17:02:57 +00:00
Florian Müllner
32bc064d10 calendar: Fix initial do-not-disturb state
The do-not-disturb button and the contained switch are
tied together via a bidirectional property binding.

However it still matters which objects are used as source
and target, as that will determine the initial state: Right
now the (unchecked) button is used as source, which means
that do-not-disturb is turned off on startup.

We want the state to be preserved, so swap source and target
to let the switch (that is bound to the underlying GSetting)
control the initial state.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2804
2020-05-18 18:55:19 +02:00
Peter Simonyi
87606c6a6b status: Pass scroll events to volume and brightness sliders
Sliders can be operated by mouse scroll, but the mouse has to be over
the slider control.  Make the brightness and volume system menu entries
forward scroll events to the sliders they contain so that scrolling
anywhere on the menu item operates the slider.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2795
2020-05-18 11:30:28 +00:00
Florian Müllner
3309031fd1 extensionSystem: Update canChange on error
Whether or not an extension has errors influences the 'canChange'
property, but so far we only update it for errors that occur when
initializing the extension, not when an extension is enabled later.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1249
2020-05-16 16:33:22 +00:00
Bryan Dunsmore
64a3ecf9b1 dateMenu: Update timezone offsets when timezone changes
Adds a signal handler to update the timezone offsets whenever the
user changes the system timezone.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2209
2020-05-15 20:46:00 +00:00
Michael Lass
a47e0f9845 extensionDownloader: Replace deprecated Soup.SessionAsync
Soup.SessionAsync by default sets timeout and idle_timeout to 0. This
causes connections to hang around in state CLOSE_WAIT forever after the
remote host has closed the connection.

To fix this, we could set timeout and idle_timeout manually. However,
Soup.SessionAsync is marked as deprecated anyway and should be replaced
by Soup.Session. Doing so also sets a default timeout of 60 seconds.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2774
2020-05-14 19:43:56 +00:00
Bryan Dunsmore
0737c8f416 dash: Allow adding favorites out of favorites zone
Previously, you could not add favorites outside of the favorites zone.
This change inserts a placeholder at the end of the favorites zone if
you are outside of it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2777
2020-05-14 18:32:57 +00:00
Florian Müllner
6d5e93b00b extensionSystem: Disable extension before unloading stylesheet
Removing a stylesheet from the theme will trigger a style update. There's
little point in updating the extension actors that are about to be destroyed
(hopefully), so call the extension's disable() function first.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2757
2020-05-13 20:10:56 +02:00
Bryan Dunsmore
f526e592fe mpris: Prevent DBus race when creating media players
Sometimes an MPRIS media player will create and then destroy an object
before the signals that handle the object's destruction can be created.
This verifies that the object still exists after the necessary signals
have been created.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2776
2020-05-13 19:46:24 +02:00
Florian Müllner
137e6c8493 windowManager: Allow xwayland startup to complete without systemd
Since commit 0ecddafc20 gsd-xsettings startup has been made conditional
on the systemd user instance being available at runtime. While that is
correct, it means that completing xwayland startup is also conditional
now.

We always want xwayland startup to go ahead, so wait for the XSettings
plugin to appear on the bus when gsd-xsettings is launched by gnome-session
and complete the task immediately if startup fails.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1252
2020-05-12 18:05:38 +02:00
Alexander Mikhaylenko
e59ca7053b workspacesView: Lower scroll timeout
Looks like 250ms is too high, lower it to 150ms.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2602
2020-05-09 19:27:36 +05:00
Alexander Mikhaylenko
6895592a7b appDisplay: Lower scroll timeout
Looks like 250ms is too high, lower it to 150ms.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2602
2020-05-09 19:27:33 +05:00
Florian Müllner
a9d73b1017 panel: Center app icon
Giving the icon extra space may distort it, so center it vertically.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2578
2020-05-07 14:57:12 +02:00
Carlos Garnacho
0ecddafc20 windowManager: Handle return value/errors from systemd unit calls
These may produce errors, and return a value indicating we should
proceed further. Check for those when starting/stopping gsd-xsettings.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1238
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2755
2020-05-07 12:16:03 +02:00
Bastien Nocera
34da48453e shell-app: Add PrefersNonDefaultGPU support to shell_app_launch()
Read the "PrefersNonDefaultGPU" key in desktop files to figure out
whether the application prefers running on the discrete GPU, or the
default GPU, and apply that.

Update the "Launch..." contextual menu to allow launching on
the default GPU if the application "prefers [the] non default GPU".

See:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1804
2020-05-04 16:22:03 +02:00
Bastien Nocera
3bfa9916da appDisplay: Use global switcheroo-control D-Bus proxy
Rather than creating our own.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1226
2020-05-04 16:22:03 +02:00
Michael Catanzaro
31cd8f738c appFavorites: Add eog to rename list
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1233
2020-05-02 00:16:28 +02:00
Florian Müllner
5e254666b0 messageTray: Add missing property getter
gjs has gotten less forgiving about missing getters/setters, and
commit 6aa1b817 missed the missing getter in the base policy class.

Most notifications use a policy subclass that already provides a
getter, but at least Main.notify() and friends don't; unbreak them
by fixing the base class.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1229
2020-04-30 07:41:38 +00:00
Jonas Dreßler
d3880c0bff main: Unset the right prevFocus actor after the focus stack got shifted
When a modal that's not on top of the modalActorFocusStack gets popped,
we shift the focus stack as described in popModal() to ensure the chain
remains correct. That however destroys the association of a modal actor
and its prevFocus actor on the focus stack, because the prevFocus actors
are now moved to different entries of the stack.

Now when a prevFocus actor gets destroyed, we don't handle that case
correctly and search for the modal actor that was associated with the
prevFocus actor before the stack was shifted, which means we end up
unsetting the wrong prevFocus actor.

So fix that and search the stack for the prevFocus actor which is being
destroyed instead to unset the correct entry.

Thanks to Florian Müllner for figuring out the actual issue and
proposing this fix.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2446
2020-04-29 12:40:13 +02:00
Florian Müllner
2b70151794 keyboard: Minor cleanup
Use the more concise operator shorthand.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1177
2020-04-28 09:04:49 +00:00
Florian Müllner
153b7d525d cleanup: Don't linebreak before closing parentheses
Otherwise recent versions of eslint want "dangling" commas,
which is at least ugly considering that most functions don't
allow adding arguments at leasure.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1177
2020-04-28 09:04:49 +00:00
Florian Müllner
2e80995f19 overviewControls: Remove transitions before updating adjustment value
The workspace switcher blocks state updates while the indicator is
animating. Since commit 9c1940ef9d the indicator is considered to
be animating when the workspace adjustment's value doesn't equal the
active workspace.

There is one case though where this breaks badly: When a workspace
is inserted before the active one, the adjustment's upper and value
properties are changed without transitions. But if that change happens
while there's an ongoing transition to the previously active workspace,
the value gets out of sync with the active workspace and we end up
blocking state updates indefinitely.

Fix this by removing any transitions before setting the adjustment
value.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2625
2020-04-28 01:28:50 +02:00
Florian Müllner
3ba4304da9 keyboard: Add missing setter
We override the :visible property for the keyboard actor, but don't
provide a corresponding setter. The property is therefore read-only
on the javascript level, and any attempt to set it will fail.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2691
2020-04-27 23:48:54 +02:00
Jonas Dreßler
49d6db34b7 altTab: Set allocation before allocating children
Just as with the last commit, we should not break the assumption made by
Clutter that parents have their allocation set before their children get
allocated, so fix that here, too.

In this case we have to fix it by chaining up to the parent vfunc
override and updating the allocation once more before allocating the
`this._label` child.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1615
2020-04-27 19:53:27 +02:00
Jonas Dreßler
63a0e521fd boxpointer: Call set_allocation before allocating child
It's important to update the allocation of the parent before allocating
its children, it's an assumption we make in a lot of places.

This broke resource scale calculation for boxpointers and their
children when multiple monitors with different scales are used and the
primary monitor is not positioned at x=0, y=0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1615
2020-04-27 19:53:20 +02:00
Milan Crha
c00d79bae2 calendar-server: Improve performance by properly using ECalClientView
The previous code always restarted whole ECalClientView when it received
any changes in it, which could sometimes lead to constant repeated restarts
of the view.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1875
2020-04-27 16:14:57 +00:00
Jonas Ådahl
c3646a7642 js/main: Inhibit remote access when depending on session mode
The session mode determines whether the screen casting should work or
not, but until now only dealt with the built in screen cast, not the
ones using PipeWire. Add the newly added API for inhibiting remote
access when the session mode says screencasts are not allowed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1210
2020-04-27 15:18:18 +00:00
Jonas Ådahl
772df91762 shell/global: Add 'backend' property
Replace all Meta.get_backend() with global.backend. Maybe sooner or
later we can further decrease the amount of singletons handled by
libmutter.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1210
2020-04-27 15:18:18 +00:00
Andy Holmes
3dc4f01113
JS: migrate from the global window to globalThis
As of mozjs68 (gjs-1.64) `globalThis` is recommended over `window` and
it makes more sense in this context anyways. Migrate the few instances
of `window` we use and adjust the eslint configuration.

`window` will continue to resolve to `globalThis`, so this won't affect
extensions or other downstream users.

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

closes #2322
2020-04-26 19:07:02 -07:00
Florian Müllner
d94d0f60c8 calendar: Do less work in hasEvents()
getEvents() filters all events for the given range and sorts the result.

That's more than we need when checking whether there are any events,
where we only care that there's at least one event in the range.

Address this by splitting out the event filtering into a generator
function, so hasEvents() can return after at most one iteration.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1192
2020-04-26 16:20:49 +00:00
Florian Müllner
8d79f6f4c8 calendar: Update events on changes
We track messages so that we can account for just added and removed
events instead of having to rebuild the entire list, however it's
also possible that the time or summary of an existing event changed.

Account for that by updating existing messages in-place.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1192
2020-04-26 16:20:49 +00:00
Jonas Dreßler
fb1bb291eb unlockDialog: Call AuthPrompt.addCharacter() directly
The additional function UnlockDialog.addCharacter() is only used at one
place, so we can simply remove it and call AuthPrompt.addCharacter()
directly. The AuthPrompt is shown right before that anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1209
2020-04-25 14:54:07 +00:00
Matthew Leeds
a60d57ea1f screenShield: Don't inhibit suspend during initial setup
Normally, we inhibit suspend while locking the screen. But in the
session mode used for gnome-initial-setup locking is not supported, so
in that case this inhibit call is pointless and should be avoided.
Without this patch you get the following error when you suspend and
resume during initial setup:

JS ERROR: Error getting systemd inhibitor: Gio.IOErrorEnum:
GDBus.Error:org.freedesktop.login1.OperationInProgress: The operation
inhibition has been requested for is already running
_promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:435:45

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1213
2020-04-24 23:47:31 +00:00
Matthew Leeds
527ce66cd4 screenShield: Fix use of null this._dialog
On Fedora 32 if you close the laptop lid during gnome-initial-setup,
gnome-shell hits this error:

JS ERROR: Exception in callback for signal: prepare-for-sleep: TypeError: this._dialog is undefined
_resetLockScreen@resource:///org/gnome/shell/ui/screenShield.js:434:9
activate@resource:///org/gnome/shell/ui/screenShield.js:571:14
lock@resource:///org/gnome/shell/ui/screenShield.js:617:14
_prepareForSleep@resource:///org/gnome/shell/ui/screenShield.js:219:22
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_prepareForSleep@resource:///org/gnome/shell/misc/loginManager.js:198:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:169:19

This is because _ensureUnlockDialog() hit its first early return. So
return early from activate() in that case, so this._dialog doesn't get
used while it's null.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1213
2020-04-24 23:47:31 +00:00
Georges Basile Stavracas Neto
2a9ccf2e2c appDisplay: Return the parent class' result in overrides
StButton returns CLUTTER_EVENT_STOP in various circumstances, but
AppIcon throws that away and returns CLUTTER_EVENT_PROPAGATE even
when it should stop.

Return the parent class' result instead of CLUTTER_EVENT_PROPAGATE.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1211
2020-04-23 19:14:43 -03:00
Georges Basile Stavracas Neto
2909d91c13 appDisplay: Use const instead of let in vfunc_leave_event
The return value of the chain up is not changed, let's use the
proper descriptor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1211
2020-04-23 19:14:40 -03:00
Philip Chimento
6aa1b817c9 messageTray: Make NotificationPolicy properties read-only
These properties are never written; in the base class they are always
their default values, and in the subclasses the getters are overridden.

This will be necessary because GJS is adding checks to make sure that
readable properties always have a getter, writable properties always
have a setter, and that the variations of camelCase/snake_case are
handled correctly. It's supposedly backwards compatible, but that
assumes that code is not doing things like forgetting a setter on a
writable property. (If the missing setter had ever been called, it might
have led to a crash, which is why we've made this change.)

This is the minimally invasive patch which should work with both older
and newer versions of GJS. If you decide to require GJS 1.65.2, then
you'll also be able to remove the getters from NotificationPolicy as
well.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1205
2020-04-20 17:27:48 -07:00
Florian Müllner
5ec5978d4a windowManager: Fix ngettext() call
We don't pass the number that allows gettext to decide on the
correct string, whoops.

Spotted by Alexandre Franke.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2649
2020-04-17 22:25:09 +00:00
Marco Trevisan (Treviño)
f4d90bc127 polkitAgent: Reset the session request timeout when removing it
When handing the resetDialog request we're leaving a source ID alive,
leading this error:

(gnome-shell:22464): GLib-CRITICAL **: 17:46:11.065: Source ID 12934 was not
found when attempting to remove it:

== Stack trace for context 0x55c9246916c0 ==
#0 55c9249151b8 i   js/ui/components/polkitAgent.js:391 (11f71fd544c0 @ 100)
#1 7ffc55140aa0 b   self-hosted:1009 (3062ba49af88 @ 423)
#2 55c924915120 i   js/ui/modalDialog.js:167 (1c9e50ae9880 @ 62)
#3 55c924915098 i   js/ui/modalDialog.js:186 (1c9e50ae9970 @ 12)
#4 55c924915008 i   js/ui/environment.js:75 (1c9e50a8d5b0 @ 98)
#5 55c924914f78 i   js/ui/environment.js:149 (1c9e50a8d9e8 @ 14)

So, reset the source handle to avoid trying to remove it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1203
2020-04-17 16:17:51 +00:00
Marco Trevisan (Treviño)
bfa34914db polkitAgent: Return GLib.SOURCE_REMOVE on timeout callback
resetDialog is used (also) as GLib timeout function, so while just returning
an undefined value will stop the timeout anyways, it's just cleaner to
use the GSource expected return values

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1203
2020-04-17 16:17:51 +00:00
Jonas Ådahl
8d1e4659d1 js/ui: Always use namespace for animation modes
Clutter.Animation doesn't contain any animation modes, they live in
Clutter.AnimationMode. The places we did `Clutter.Animation.WHATEVER`
just evaluated to `undefined`. Thus, use the correct namespace for the
animation mode enums.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1199
2020-04-15 13:59:38 +00:00
Jonas Ådahl
b3b91f1699 js: Drop tweener.js
We're using clutter's animation framework now, so lets drop the old
tweener support layer.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1200
2020-04-15 13:25:14 +00:00
Florian Müllner
3fac0632a8 appDisplay: Look up directory- instead of category translations
Translations are provided by .directory files, so trying to look
up a category name without the suffix will always fail.

Commit 343b3351f1 tried to fix this previously by changing the
saved keys, but that broke existing translatable folders.

Appending the .directory suffix for the lookup instead fixes the
issue without regressing non-custom folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2623
2020-04-13 14:56:34 +00:00
Mariana Picolo
da0c7fc2b6
dateMenu: Update empty weather label
Remove subtitle for the empty weather state
to match world clocks button.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2179
2020-04-09 10:52:44 -03:00
Georges Basile Stavracas Neto
167bc080d9 appDisplay: Reorganize AppDisplay actor hierarchy
Right now, the actor hierarchy is such that the scroll view
does not contain the actual grid. It looks as follows:

              StScrollView
                    ↓
               StBoxLayout
                    ↓
                ShellStack
                ↓        ↓
   PaginatedIconGrid     StWidget

This hierarchy can be slightly reorganized by changing it to be as
follows:

            ShellStack
             ↓     ↓
   StScrollView   StWidget
        ↓
   StBoxLayout
        ↓
 PaginatedIconGrid

This will simplify future work where the PaginatedIconGrid will be
an implementation of StScrollable, in which case we'll be able to
simply remove the StBoxLayout from there.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1191
2020-04-08 21:12:06 -03:00
Philip Withnall
91b13effc8 appFavorites: Hide favourites which are blacklisted by parental controls
If a favourite is set for an app which is blocked by parental controls,
that favourite should be hidden.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/465
2020-04-07 17:47:33 +02:00
Philip Withnall
143ab6ac7f search: Hide search providers which are blacklisted by parental controls
If a search provider is installed by an app which is blacklisted for the
current user by their parental controls, don’t show it or results for
it.

Currently, this only filters ‘remote’ (not built-in to the shell) search
providers. This seems fine for now; in future it could be expanded to
also filter built-in search providers, if any of them end up needing to
be filtered.

No corresponding changes need to be made `remoteSearch.js`, because the
results of `loadRemoteSearchProviders()` are filtered in `search.js`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/465
2020-04-07 17:47:33 +02:00