Commit Graph

7647 Commits

Author SHA1 Message Date
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
Amr Ibrahim
7d60f418e7 systemActions: Use 'system-log-out-symbolic' for logout
Changing the icon to 'system-log-out-symbolic' has no visual
change in a default GNOME setup since both 'system-log-out-symbolic'
and 'application-exit-symbolic' are the same in adwaita-icon-theme
(at the time of writing), however, other icon themes differentiate
between the two icons so pointing to the appropriate icon name
is the right thing to do.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2751
2020-05-07 19:19:32 +00: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
Ting-Wei Lan
e08a4acd06 ibusManager: Fix the panel after porting to Promises
Commit 764527c8c9 not only ports this file
to Promises but also changes the behavior of _initPanelService method.
Instead of always calling _updateReadiness when _panelService is ready,
it only calls it when get_global_engine_async succeeds.

The only callers of _updateReadiness are _initEngines and
_initPanelService. Assume that _initEngines completes first. Its
_updateReadiness call keeps _ready as false and it is expected for
_initPanelService to change it to true. However, since
get_global_engine_async fails because there is no active engine,
_initPanelService never calls _updateReadiness. Therefore, all setEngine
calls do nothing because _ready is false, and the input method panel
never shows. Users are unable to use any input method even if they can
see that ibus-daemon is already running.

Fix the issue by changing it back to the old behavior.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1235
2020-05-03 23:26:39 +08: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
8d139bbd95 authPrompt: Grab key focus when making entry sensitive
We currently let the entry of the autoPrompt grab the key focus inside
setQuestion(), which is called from _onAskQuestion(), which is the
callback of the "ask-question" signal.

It seems that the "ask-question" signal isn't emitted again right after
the password-check failed, but a few seconds after that. Since we get
the "verification-failed" signal earlier than "ask-question" (right
after we know the check failed) and we also get a hint whether the entry
should be usable again with the canRetry argument, we can also grab key
focus to in the same step.

So do that by grabbing key focus when making the entry sensitive.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2655
2020-04-25 14:54:07 +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
Will Thompson
3199620a83 systemActions: include ASCII alternatives in search index
With this change, "eteindre" matches "éteindre" (the French translation
for "power off"), consistent with search for applications where "e"
matches "é".

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2688
2020-04-25 13:55:20 +01: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
Xiaoguang Wang
be12c71534 loginDialog: Get resource scale by get_resource_scale
To shut up 'Getting invalid resource scale property' warnings in the log.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1206
2020-04-21 13:48:56 +02: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
b191e9ef91 authPrompt: Fix spinner alignment
We want the spinner to be centered with regard to the entry, but
constraining the height breaks that:

 1. clutter_actor_allocate() is called with the available size
 2. clutter_actor_update_constraints() then adjusts that according
    to the constraints
 3. clutter_actor_adjust_allocation() applies the margin/expand/align
    properties.

The issue there is that 2. reduces the allocation to the desired size,
so there is no more extra space to distribute in 3.

We can fix this by either constraining everything (and rely on the
cancel button's alignment) or limit the constraint to the width. The
latter seems more appropriate, given that the constraint is only used
to center the entry horizontally.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2628
2020-04-17 22:35:31 +00: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
Philip Withnall
3e5b90dbba js: Add support for parental controls filtering to the desktop
Filter the apps shown on the desktop and in search results according to
whether they are blacklisted by the user’s parental controls.

This supports dynamically updating the filter during the user’s session.

This adds an optional dependency on libmalcontent. If that’s unavailable, no
parental controls filtering will occur.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/465
2020-04-07 17:47:29 +02:00
Florian Müllner
21de88c3ba bluetooth: Do not update hadSetupDevices on adapter changes
While we now deal more gracefully with adapter removals, we can
still mess up the hadSetupDevices tracking:

As adapters become available before any devices, we'll always
reset the setting to false when Bluetooth is turned on. And if
no set up device happens to be in range, it will still be false
when Bluetooth is turned off again.

To address that, only update the setting if we have an adapter
(like we do now) and we had one before (so it wasn't the adapter
itself that changed).

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1174
2020-04-07 15:44:50 +02:00
Florian Müllner
456ca3d3e0 bluetooth: Do not sync() immediately on model changes
Our intended behavior when bluetooth is turned off is to keep
the menu visible if devices had been set up previously.

However since gnome-bluetooth@c437c729, devices are removed
first before removing the default adapter, so we now end up
always setting the property to false before checking for it.

Fix this by deferring all model changes to an idle, so that
we can process them as a unit. Do the same for proxy property
changes, as those may trigger a row-removal.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1174
2020-04-07 15:44:50 +02:00
Florian Müllner
f4ba3e4ab8 bluetooth: Fix showing menu when devices were set up
Since commit 26c2cb9f65, nDevices is always the actual number of
paired/trusted devices. So when bluetooth is turned off, it is
now 0 rather than forced to 1 if devices were set up previously.

Fix this by checking the property that tracks set up devices instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1174
2020-04-07 15:44:50 +02:00
Georges Basile Stavracas Neto
53a24e6ddd animation: Set size through CSS
Pretty much the same case of the previous commit: we want this size
to be scale-dependant, and using the width and height properties of
ClutterActor doesn't automatically update.

Use CSS to set the width and height.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 11:24:30 -03:00
Georges Basile Stavracas Neto
b27c89f836 appDisplay: Set the folder icon geometry through CSS
The CSS engine is scale-aware, whereas simply setting the
width and height properties directly isn't.

Use CSS to set the folder icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 11:24:30 -03:00
Georges Basile Stavracas Neto
402fd8ec29 iconGrid: Downscale icon size when comparing to defaults
The return value of st_theme_node_lookup_length() is scaled according
to the scale factor. IconGrid.ICON_SIZE is not. However, when BaseIcon
tries to fetch the CSS value for "icon-size" (which returns a scaled
value), it uses it as-is, mixing the two coordinate systems.

Use a single coordinate system (unscaled sizes) in IconGrid.BaseIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1175
2020-04-03 16:04:40 -03:00
Florian Müllner
fbe2e30f38 screenShield: Wake up on deactivate()
Usually the screen is woken up before the shield is deactivated, but
it is also possible to unlock the session programmatically via the
org.gnome.ScreenSaver D-Bus API.

The intention is very likely not to unlock a turned off screen in
that case. Nor does it seem like a good idea to change the lock
state without any indication.

Waking up the screen is more likely to meet expectations and is
more reasonable too, so do that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1158
2020-04-03 14:44:50 +00:00
Florian Müllner
fb6ead2881 screenShield: Switch lightboxes off before unlock transition
There is no point in animating a transition with fullscreen black
rectangles stacked on top, so switch them off before rather than
after the transition.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1158
2020-04-03 14:44:50 +00:00
Florian Müllner
8030d9ad32 extensionUtils: Add openPrefs() convenience method
Opening their own preferences is a reasonable desire for extensions,
so make up for breaking it by adding a convenience method for that
action.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1163
2020-04-03 15:27:37 +02:00
Florian Müllner
45bc850715 extensionSystem: Add method for opening extension prefs
Extension that want to expose their own preferences (for example as menu
items) do that by passing their UUID to gnome-shell-extension-prefs.

But since 3.36.1 the app is optional and no longer accepts arguments on
the command line. To adjust, extensions now need to make a D-Bus call
the extensions portal, just like the app and gnome-shell.

We will add a convenience method for that purpose, so it makes
sense to share the existing code. As it's extension-related, the
extension manager looks like the right place ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1163
2020-04-03 15:23:26 +02:00
Florian Müllner
51a913730e workspace: Fix chaining up
Gah, accidentally dropped the 'vfunc' prefix :-(

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1172
2020-04-03 12:57:01 +00:00
Florian Müllner
1666fa195d js: Account for promisified call() method
A promisified method expects the callback parameter to be either
a function (in which case the original method is called normally)
or omitted altogether (in which case a Promise is returned).

The call to open application details in Software does neither and
passes null instead, which will result in a warning (because no
function argument means a promise will be used, but not omitting
the parameter means we end up with too many arguments).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2551
2020-04-03 02:02:40 +00:00
Jonas Ådahl
a9df4e7516 appDisplay: Don't clear signal handler id before emitting
Otherwise we won't clear the 'view-loaded' handler after it was emitted.

Also move field initialization to the correct place, i.e. the init
function of the base class.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1169
2020-04-02 20:53:20 +00:00
Florian Müllner
5067bda61a bluetooth: Fix infinite loop
Bailing out early of the loop means the iter is never increased,
resulting in an infinite loop.

Fixes 26c2cb9f6.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1165
2020-04-02 12:08:00 +00:00
Mariana Picolo
9bc9d5165f bluetooth: Update bluetooth submenu title
- "Bluetooth" to "on/off" labels
  to match with other menus

- Display single connected device name
  to show more relevant information

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2340
2020-04-02 00:15:37 +00:00
Mariana Picolo
26c2cb9f65 bluetooth: Add getDeviceInfos function
In case where only one device is connected, we want to display its name
in the menu. For that we will need more than the number of known/connected
devices, so change the function to return an array of device infos instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2340
2020-04-02 00:15:37 +00:00
Marco Trevisan (Treviño)
a0def23940 main: Don't override DesktopAppInfo desktop if already GNOME
During the shell initialization we call the (deprecated) function to
override the Desktop environment in Gio DesktopAppInfo to make sure that
applications are correctly shown (as per commit b2fbf5a2), however this
might break the cases in which $XDG_CURRENT_DESKTOP is already set and
contains GNOME (given that is now a list).

In Ubuntu this is in fact set to: ubuntu:GNOME.
Now, if an application contains NotShowIn=ubuntu, the key will be ignored by
the shell, and the application is still listed everywhere.

So, override the DesktopAppInfo desktop environment only in the case that
the current desktop is not already GNOME.

At the current date I think we could just safely get rid of this override at
all, but there could be still cases where it still might be useful, like when
running as nested in some other environment, so keeping it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1156
2020-03-31 20:27:12 +02:00
Jonas Ådahl
f49b58cf97 appDisplay: Clear animateLater callbacks when unmapping
In some situations we could end up not with lingering 'view-loaded'
handler. This could result in delayed spring animate-in being initiated,
e.g. after a minute after the activities overview was already closed.

Fix this by removing any lingering signal or later handlers when
unmapping.

Fixes: 5c33fe4a0a

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1155
2020-03-31 19:05:15 +02:00
Florian Müllner
764527c8c9 js: Promisify async operations
Promises make asynchronous operations easier to manage, in particular
when used through the async/await syntax that allows for asynchronous
code to closely resemble synchronous one.

gjs has included a Gio._promisify() helper for a while now, which
monkey-patches methods that follow GIO's async pattern to return a
Promise when called without a callback argument.

Use that to get rid of all those GAsyncReadyCallbacks!

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1126
2020-03-31 05:43:40 +00:00
Jonas Ådahl
5c33fe4a0a appDisplay: Don't start animation from the 'paint' signal
Starting the animation from the actor 'paint' signal has various
unwanted consequences, such as sometimes trigger a
clutter_actor_queue_relayout() during the paint phase. One unwanted
consequence was that an offscreen actor effect was disabled during
painting, meaning the effect would begin being active, but later during
the post-paint processing being disabled. The caused said effect to push
an offscreen framebuffer to the paint context, but then just destroy it
instead of popping it. When this happened, we'd end up trying to operate
on a framebuffer that may had been finalized, or not, depending on the
garbage collector. Sometimes, for some users, this caused a segmentation
fault when trying to pop a matrix from the framebuffer matrix stack.

Deal with this more properly, by using the 'view-loaded' signal to wait
with animation until the view is loaded, as well as using MetaLater to
schedule the start of the animation.

For when a view was signalled to be ready, we're in a state where we can
start animation before the next frame as the layout is ready, but when
not, we have to add back the "hack" where we must wait for one frame for
the target icon positions to be up to date. Do this by adding a
MetaLater IDLE callback that starts the animation *after* the next
frame. This also needs the old 'opacity = 0' work around to not show an
incorrect first frame.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2418

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1154
2020-03-30 16:24:31 +00:00
Florian Müllner
4f427f4e0d js: Do not set entries' ClutterText:editable property
The property influences the text's (and thus entry's) minimum width[0],
which is generally not what we want. And as we now prevent text from
being entered in non-reactive entries by other means, we can simply
drop it.

[0] https://gitlab.gnome.org/GNOME/mutter/-/blob/master/clutter/clutter/clutter-text.c#L2940

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2423
2020-03-29 22:12:57 +02:00
Florian Müllner
34c4627db9 st/entry: Bind ClutterText reactivity to entry
The text is part of the entry, so it is surprising that it can
still be edited when the entry itself isn't reactive. Address
this by setting up a binding instead of expecting all consumers
to handle the case themselves.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2423
2020-03-29 22:12:57 +02:00
Luke Yelavich
16f4e4dc4c checkbox: Improve accessibility of check boxes for Orca users
Set the label actor, so Orca presents the label text when the check box
has focus. Also change the role to ATK_ROLE_CHECKBOX.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2517
2020-03-29 12:56:33 +00:00
Luke Yelavich
454e3fd39a calendar: Improve the accessibility of the "Do Not Disturb" switch
Set the do not disturb label as the label actor for the do not disturb switch,
so that Orca speaks the do not disturb label when the user moves
keyboard focus to the do not disturb switch.

Also enable toggle mode for the "Do Not Disturb" button and bind it's checked
state to the state property of the switch. This makes sure that Orca presents
thecorrect state of the do not disturb switch to the user.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2508
2020-03-29 11:07:32 +11:00
Florian Müllner
f3fcc4adb7 shellDBus: Return error from ReloadExtension
The method has been deprecated because it generally doesn't (and
can't) work. Clarify that by returning an error instead of
apparently doing nothing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2510
2020-03-28 22:14:44 +00:00
Jonas Dreßler
867587ef4c keyboard: Hide keyboardBox after destroying the keyboard
It seems there is a weird race condition between Clutter trying to
destroy the keyboard actor and Clutter trying to hide the keyboardBox
container actor: If the keyboardBox is hidden before destroying the
keyboard actor, Clutter doesn't repaint anything and the keyboard
remains visible until something else draws over it.

To fix this issue until we find the underlying Clutter bug, simply
destroy the keyboard actor before hiding the keyboardBox. The order in
which we call these doesn't matter anyway since hideKeyboard(true) hides
the keyboard immediately without an animation.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
2020-03-28 20:45:32 +00:00
Jonas Dreßler
b68fb35783 layout: Use translation_y of 0 to hide keyboard
Since we show the keyboard using a translation_y of -keyboardHeight, the
keyboard will be moved down far enough to be out of sight by setting
translation_y to 0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
2020-03-28 20:45:32 +00:00
Jonas Dreßler
8dfed7e762 keyboard: Don't include keyboard devices when updating lastDevice
We're dealing with attached keyboards now using the touch_mode property
of ClutterSeat: If a device has a keyboard attached, the touch-mode is
FALSE and we won't automatically show the OSK on touches, also the
touch-mode gets set to FALSE when an external keyboard is being plugged
in, so that also hides the OSK automatically.

With that, we can now ignore keyboard devices when updating the last
used device and no longer have to special-case our own virtual devices.

Because there was no special-case for the virtual device we use on
Wayland now, this fixes a bug where the keyboard disappeared after
touching keys like Enter or Backspace.

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
2020-03-28 20:45:32 +00:00
Florian Müllner
97fe4f761a volume: Cancel before checking state
Since commit 2894085c45 we omit sound feedback on volume changes
if something is already outputting sound. Unfortunately that
"something" may be our own feedback (from a previous volume
change).

In that case we do not want to omit the new feedback, so instead
cancel the previous one.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1147
2020-03-28 19:03:12 +01:00
Jonas Dreßler
ba8210ea98 keyboard: Run dispose manually on virtual input device when destroying
We want to make sure any buttons that are still pressed on the virtual
input device used by the OSK are released immediately when destroying
the OSK. Do this by calling run_dispose() on the destroy() function of
the KeyboardController, which makes sure we don't have to wait for the
garbage collection to dispose the object and a still pressed key remains
being pressed until the GC kicks in.

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

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

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1141
2020-03-28 17:31:04 +00:00
Carlos Garnacho
8378c9c9e0 inputMethod: Protect for running with older mutter versions
The offset argument is changing from uint to int. Which means we
might would pass a negative offset and trigger an "out of bounds"
error. Make it work more or less alright with older mutters, by
clamping the offset to 0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1146
2020-03-28 16:38:10 +00:00
Florian Müllner
de16fe8dff dateMenu: Only use nearest city when appropriate
Since commit 784c0b7e4 we use the name of the nearest city rather
than the weather station, as the latter tend to have unwieldy
and weird names.

However the nearest city may not be that near after all, in which
case the result is again surprising.

Address this by not using the nearest city name unconditionally, but
only if it appears in the station name.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2468
2020-03-28 16:24:03 +00:00
Georges Basile Stavracas Neto
bea34da289 unlockDialog: Only cancel AuthPrompt if it exists
AuthPrompt is created on demand, and this._authPrompt is
expected to be null except on very strictly controlled
occasions. The idle monitor callback isn't one of them.

Check if AuthPrompt exists before cancelling it.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2371
2020-03-27 23:40:08 +00:00
Florian Müllner
39e6375aff extensions-app: Move Extensions app to new subproject
The Extensions app code is now independent enough from the rest of the code
base to move it to its own subprojects, like we did for the extensions-tool.

This allows for stand-alone builds of the app, which we are about to use
for distributing it as flatpak.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1133
2020-03-27 23:33:30 +00:00
Florian Müllner
ed21a4e5c1 extensionPrefs: Fake Config module
We include config.js because it is a dependency of ExtensionUtils,
but it's not actually used in the code paths we exercise.

As we want to allow stand-alone builds of the app, it is much easier to
fake the module than to either include a generated file from elsewhere
in the tree or generate it ourselves.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1133
2020-03-27 23:33:30 +00:00
Jonas Dreßler
702417ce83 appDisplay: Only use dragMonitor for one icon at a time
Instead of adding a dragMonitor for every icon in the grid as soon as
one icon is getting dragged, only add a dragMonitor for the icon that is
currently being dragged over (ie. the current drag-target). With a large
number of icons in the iconGrid, this should significantly reduce lags
while dragging.

We can do this by detecting the DnD-entering of an icon or folder using
the `handleDragOver()` callback of drag-targets, adding the dragMonitor
because we know an icon is hovering above the drag-target and then
detecting the DnD-leaving of the drag-target by using the `dragMotion()`
handler, where we remove the dragMonitor again as soon as the
targetActor is no longer our actor (ie. the drag-target).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/849
2020-03-27 22:38:41 +00:00
Jonas Dreßler
766e9034e2 appDisplay: Remove dragMonitor when FolderIcon is destroyed
While it should be impossible to destroy a FolderIcon while a DnD action
is still going on, there might still be rare cases where this happens
(ie. when a folder is removed because an app got deleted during DnD).

So make sure we're on the safe side here and don't potentially leave
dragMonitors around after the icon is destroyed by removing the
dragMonitor inside the onDestroy handler of the FolderIcon, just like we
do for AppIcons.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/849
2020-03-27 22:38:41 +00:00
Takao Fujiwara
6170bea283 inputMethod: Fix delete-surrounding-text signal
Forward the arguments at the 'delete-surrounding-text' signal
from IBusInputContext to clutter_input_method_delete_surrounding()
so that ibus-typing-booster use the deleting surrounding text function.

Input method engines can delete the output text in applications
with this function.

This change will require a change of mutter of mutter!517
because the first arguemnt of the 'delete-surrounding-text' is INT
to express the offset of the current cursor position but
the first one of clutter_input_method_delete_surrounding() is UINT
since the Wayland spec accepts UINT in delete_surrounding()

mutter will change the type of the first one to INT in
clutter_input_method_delete_surrounding() to work with this change.

https://gitlab.gnome.org/GNOME/mutter/issues/539
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/477
2020-03-27 19:42:07 +00:00
Florian Müllner
660a2b6e62 extensionSystem: Require Extensions app for updates
While we don't technically need the app to download and apply
updates, we do require it for notifying the user about available
updates and listing extensions with pending updates.

So instead of intransparently applying updates in the background
without the user noticing, disable updates altogether if the
Extensions app is not installed.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2346
2020-03-27 13:28:41 +00:00
Florian Müllner
cc347bf6d8 extensionDownloader: Stop handling 'blacklist' operation
Blacklist support was added all the way back in commit 1e286e43, but
the code had been defunctional until recently. While uninstalling an
extension that has been blacklisted makes sense off-hand, unfortunately
we don't know if an extension was *actually* blacklisted:

The website returns that operation for any extensions for which it
doesn't find any versions that match the shell version. That is, the
most likely reason is that the user updated to a new GNOME release
which the extension doesn't support yet.

It doesn't look like the website is going to change that behavior any
time soon[0], so drop the 'blacklist' handling for the time being.

[0] https://gitlab.gnome.org/Infrastructure/extensions-web/-/issues/95

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1132
2020-03-27 12:41:57 +00:00
Florian Müllner
26ffeaae47 js: Add missing chain-ups in vfuncs
Commit 55b57421d changed signal handlers to the corresponding vfuncs,
but didn't always chain up as necessary. In most places this doesn't
matter, but at the very least the commit broke activating message list
items via the keyboard.

Add all (hopefully) the missing chain-ups to get the expected behavior
back.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2319
2020-03-27 10:39:58 +01:00
Florian Müllner
01a57206bc messageTray: Don't create notification policy on demand
This was changed in commit 8f15193b4 as a work-around for an ES6
class limitation, but now that Sources are GObject subclasses, we
no longer need to use that somewhat surprising pattern.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1131
2020-03-26 18:52:10 +00:00
Florian Müllner
279072795f messageTray: Only destroy policy after emitting ::destroy
Destroying the policy invalidates it, so accessing it from a
Source::destroy handler (for example to disconnect signal
handlers) currently results in warnings like:

Object .Gjs_ui_messageTray_NotificationApplicationPolicy
(0x7f8c7c0a64a0), has been already deallocated — impossible
to access it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2238
2020-03-26 18:45:45 +00:00
Florian Müllner
512862f2d7 extensionPrefs: Export parent window for prefs dialog
Now that OpenExtensionPrefs()'s parentWindow parameter is actually
supported, export the main application window so it can act as
transient parent to the prefs dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1087
2020-03-26 18:32:30 +01:00
Florian Müllner
a90fcb7ddb dbusServices/extensions: Handle parentWindow parameter
Now that the service implements the preference dialog, it's time
to support OpenExtensionPrefs()'s parentWindow parameter and make
the dialog a transient of the external window if specified.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1087
2020-03-26 18:32:30 +01:00
Michael Catanzaro
83c6b2ab48 Fix prompt for updates on end session dialog
Since PackageKit 1.11.1, the prompt to install updates on the end
session dialog has been (mostly) broken. The problem is that it only
works if PackageKit is running at the time the end session dialog is
opened; otherwise, our GDBusProxy has invalidated all of its properties,
which we read to see if update is possible. We need to autostart
PackageKit before reading its properties to fix this problem. That would
be easy if we were calling a method to see if an update or distro
upgrade were available, but since we're just checking a property, using
cached properties won't suffice. We'll have to manually check the
property value to ensure we autostart PackageKit.

Most of the code is written by Florian. Thanks Florian!

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2276
2020-03-26 14:45:05 +00:00
Daniel van Vugt
24742f3566 layout: Show system background and animate on the same frame
Previously we'd show the system background and then wait till the
main loop was idle before beginning the shell startup animation.
This resulted in one initial frame that was always just the system
background.

Now we try to get both the system background and the startup animation
begun on the same first frame.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1102
2020-03-25 22:41:54 +00:00
Marco Trevisan (Treviño)
03a46be5c7 telepathyClient: Use proper Object to wrap different tpl messages
In telepathyClient we consider messages both Tpl.TextEvents and
Tpl.Messages, and we manually create JS objects to copy the properties we
care for each one. This may lead to objects not matching the interface we
want.

Instead, use an object with construct-only properties and two factory static
methods to initialize it.

Unfortunately we need to use the ChatMessageClass for the class name or
calling the static methods would trigger a gjs error as per [1].

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1113

[1] https://gitlab.gnome.org/GNOME/gjs/-/issues/310
2020-03-25 22:22:49 +00:00