Commit Graph

7525 Commits

Author SHA1 Message Date
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