8752 Commits

Author SHA1 Message Date
Julian Sparber
7d6f465a47 GTKNotificationDaemon: Use ShellApp methods to activate apps
`ShellApp` gained the ability to activated actions and it sets the correct
platform data. Therefore drop the current implementation in favor for it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7409
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5239
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:35:38 +01:00
Julian Sparber
3abf7e4662 status/backgroundApps: Use ShellApp.activate_action() to quit apps
`ShellApp` gained the ability to activated actions, therefore drop the current
implementation in favor for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:28:06 +01:00
Julian Sparber
d6779f34da status/network: Use ShellApp.activate_action() to launch settings panel
`ShellApp` gained the ability to activated actions and sets the correct
platform data, therefore drop the current implementation in favor for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:28:06 +01:00
Julian Sparber
54bc3aa4f5 shell/app: Add method to activate an action via FDO DBus activation
There are multiple different places where we activate an app action,
but none set the correct activation token. Therefore this adds an async
method to to call `ActivateAction` on `org.freedesktop.Appliaction`
with the correct activation token/startup id as platform data.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:27:40 +01:00
Florian Müllner
9af81e44bc notificationDaemon: Fix auto-closing FDO notifications
We auto-close FDO notifications when the sender leaves the bus,
given that the protocol was created without persistency in mind
and any action will become invalid.

However that broke when moving the public-facing implementation
into a separate service, as we now track the (always running)
service instead of the original sender.

Fix that by forwarding the sender to the internal implementation
via a private hint, just like we already do for the PID.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3204>
2024-02-20 21:09:32 +01:00
Florian Müllner
f0b1cf5f8d notificationDaemon: Namespace private sender-pid hint
The hint is a private implementation detail between the public
and internal services, not something anybody else should set
(*cough* libnotify *cough*).

Prefix the name to hopefully make that clearer.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3204>
2024-02-20 21:09:32 +01:00
Julian Sparber
a80e0bba5c components/networkAgent: Fix small mistake
Fixes: c1ff00c01 ("notification: Use the same Source for showing system notifications")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3200>
2024-02-20 11:55:06 +01:00
Florian Müllner
d6651706fe sessionMode: Use property spread to sync mode
The parameters here come from a fixed set of mode definitions rather
than a function parameter, so the additional check performed by
Params.parse() isn't relevant here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 12:02:25 +01:00
Florian Müllner
fe1eab1b3c cleanup: Also replace Params.parse(..., true) with spread
This is what Params.parse() boils down to when accepting extra
parameters, so we can just as well use standard syntax here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 12:02:25 +01:00
Florian Müllner
8eec7ac3f4 cleanup: Use spread properties instead of Object.assign()
It's more concise and has been around long enough to embrace it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 11:53:43 +01:00
Bilal Elmoussaoui
5ce991749d lg: Replace remaining Color.init_from_4ub usage
Fixes cd33baff7d285af26475777fab1f59537c517cb5

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3197>
2024-02-17 10:46:37 +00:00
Florian Müllner
3b0e1a6b5a main: Remove timestamp parameter from popModal()
It has been unused since the move to Clutter.grab() in commit
f4cae72d17af.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
96471b9d19 main: Remove unused parameters from pushModal()
Both timestamp and options parameters have been unused since
the switch to Clutter.grab(), so remove them.

Stop using Params.parse(), so that code that still passes the
parameters doesn't throw an error.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
3f72a04a1b modalDialog: Remove timestamp parameter from open()
It is now unused.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
0ae285cc82 modalDialog: Remove onPrimary parameter
It was added in commit 48fb16b570 for the lock screen, but that
hasn't been based on ModalDialog for a long time.

It doesn't appear that anything else ever used the parameter,
so just remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
a17f4a6cb8 modalDialog: Don't pass timestamp to popModal()
Just like in the pushModal() case, the parameter doesn't do
anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
3574c5246a modalDialog: Stop passing timestamp to Main.pushModal()
Since the move to Clutter.grab() in commit f4cae72d17af6, the
parameter doesn't do anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
0432623fc8 unlockDialog: Stop passing timestamp to Main.pushModal()
Since the move to Clutter.grab() in commit f4cae72d17af6, the
parameter doesn't do anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
fbc7290bcf appDisplay: Remove shellWorkspaceLaunch()
It was deprecated in commit 942758bb308 back in 2019.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Automeris naranja
e5e427a315 calendar: Add a11y label to the "Clear" button
The button that clear notifications is labeled as
"Clear". When using a screen reader, this label
doesn't provide enough context about the action
that will happen.

Fix that by adding an a11y label to this button.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3192>
2024-02-16 11:13:36 +00:00
Florian Müllner
c170d6c956 extensionSystem: Support locking down extension installation
Currently extensions can only be locked down completely by
restricting the `enabled-extensions` key via dconf.

This is too restrictive for environments that want to allow users
to customize their system with extensions, while still limiting
the set of possible extensions.

To fill that gap, add a new `allow-extension-installation` setting,
which restricts extensions to system extensions when disabled.

As the setting is mainly intended for locking down by system
administrators, there is no attempt to load/unload extensions
on settings changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3180>
2024-02-14 16:20:59 +00:00
Julian Sparber
810a137f07 status/network: Fix small mistake
After introducing the system source this mistake was introduced.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3188>
2024-02-13 16:02:56 +01:00
Julian Sparber
502a592362 status/thunderbolt: Small style cleanup
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3188>
2024-02-13 16:02:56 +01:00
Julian Sparber
2bbe03c473 status/thunderbolt: Fix small mistake
After introducing the system source this mistake was introduced.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3188>
2024-02-13 16:02:56 +01:00
Carlos Garnacho
412081a689 magnifier: Keep accounting of own cursor unfocus inhibition
Do not rely on global state since there may be more users of it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3028>
2024-02-13 11:49:28 +00:00
Jonas Dreßler
5c0c1b15f8 screenshot: Also do pipeline fallback on screencast crashes during startup
Since the last commit, we have infrastructure in place in the ScreencastService
to blocklist pipelines which crashed the recorder.

If such a crash happens a few minutes into a screencast, we can't do any better
than telling the user about the problem and encouraging them to try again (with
the faulty pipeline now blocklisted).

If the crash happens while starting the recording though, we can actually do
better: We can try to auto-restart the ScreencastService ourselves, and the
recording might still succeed without the user noticing anything. So retry
that start of the recorder for two more times, and then finally give up.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
2024-02-11 12:36:23 +01:00
Jonas Dreßler
b6bfe07137 screenshot: Blocklist the current screencast pipeline if recorder failed
When gstreamer crashes during recording, it pulls the whole screencastService
down with it.

These crashes are typically caused by the gstreamer pipeline that's in use,
so to avoid running into them again and again, we can blocklist the last
used pipeline in case the recorder didn't shut down (aka crashed) last time.

To store this state, create a file (gnome-shell-screencast-pipeline-blocklist)
in the XDG runtime dir and store the ID of the current pipeline in that file
before we try to start.

Now when we crash while running the pipeline, the entry in that file will stay
around and we'll pick it up on the next start of the screencastService as a
blocklist.

When the recording was successful on the other hand, we'll call
`this._updateServiceCrashBlocklist([...this._blocklistFromPreviousCrashes])`
and remove the new entry from the file again before shutting down the recorder.

In addition to that, we can now encourage the user to try recording again
after a crash happened. Adjust the failure notification a bit to say
"please try again".

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
2024-02-11 12:34:54 +01:00
Jonas Dreßler
ce613f5d15 screenshot: Show a special error when screencast ran out of disk space
Since we now propagate error types back to gnome-shell now, let's start
with showing a special error message in case the disk ran out of space,
which is probably the most typical error.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
2024-02-11 11:32:19 +01:00
Jonas Dreßler
7133fac91f screenshot: Handle screencast startup failures using special notification
When the screencast fails to start, we currently don't really inform the
user, other than the red screencasting indicator in the panel going away.

Re-use the failure handling paths to also show a notification when the
screencast fails to start. The notification in this case obviously should
not have an action to open a file (there is no file), so make that depend
on whether this._screencastPath is set and unset the path.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
2024-02-11 11:32:19 +01:00
Jonas Dreßler
75f86a6f60 screencastService: Propagate machine-parseable error types to gnome-shell
We'll be using hardware encoding for screencasts soon, so we'll likely see
more things go wrong in the future, including crashes of the whole
screencastService. To deal with this, we'll introduce logic to blocklist
certain recording pipelines in case of failure and also add some logic
to retry the recording automatically.

To allow for better messaging to the user in those failure cases, we want
to be aware in gnome-shell, what exactly the error in the recorder was.

So propagate the most common types of errors that can happen in the
ScreencastService to gnome-shell using the new DBusError module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
2024-02-11 11:32:19 +01:00
Bilal Elmoussaoui
9c7e1f1180 layout: Stop using deprecated display property
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3178>
2024-02-09 19:04:53 +01:00
Florian Müllner
b09eced160 layout: Don't use supports_extended_barriers()
The method was deprecated in favor of backend capabilities,
so query those instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3176>
2024-02-09 17:32:57 +01:00
Florian Müllner
02c85fbb64 layout: Don't use get_feedback_group_for_display()
The global method was deprecated in favor of a corresponding
method on Meta.Compositor, use that instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3176>
2024-02-09 17:32:57 +01:00
Florian Müllner
bb918fff3c messageTray: Remove _createPolicy() hook
It is now unused (at least in gnome-shell itself).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3170>
2024-02-09 11:12:51 +00:00
Florian Müllner
3fc7ed4088 notification: Pass policy in the Source contructor
Commit 932ccac1 changed Source to use a regular constructor
instead of `_init()`.

Unfortunately that results in ordering issues for subclasses
that override `_createPolicy()`, if that method needs to access
any properties that are set in the constructor (as `this` is
only available after chaining up to the parent).

We can fix that by simply setting the policy from the constructor,
instead of relying on some overriden method being called.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3170>
2024-02-09 11:12:51 +00:00
Florian Müllner
810391f41e messageTray: Add NotificationPolicy.newFromApp()
We have several places where we create an application policy
from an app if possible, and fall back to a generic policy
otherwise.

Make that more convenient by adding a small helper method.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3170>
2024-02-09 11:12:51 +00:00
Florian Müllner
ebec609207 messageTray: Don't call _createPolicy() unconditionally
Since commit 932ccac1c27, the Source constructor takes a
properties object instead of individual arguments.

That means that the policy may now be set through a construct
property, and we shouldn't override it if that was the case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3170>
2024-02-09 11:12:51 +00:00
Sam Hewitt
4d1ae863d0 switcherPopup: Restore selected pseudo-class
- move styles to switcher-popup
- reverts a change in a code clean up that causes problems with screen readers

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7336
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3127>
2024-02-06 20:09:20 +00:00
Sam Hewitt
628f0b5be9 dateMenu: Fix missing text style for no locations state
- add class to the header when there are no locations so the text appears clickable

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3169>
2024-02-06 19:54:04 +00:00
Julian Sparber
c1ff00c01b notification: Use the same Source for showing system notifications
This drops all subclasses of `MessageTray.Source` that were used to
display system notifications. Now the `Source` returned from
`MessageTray.getSystemSource()` is used.
Ensure also that properties and methods that where set on the `Source`
are moved to the `Notification` object itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3156>
2024-02-06 17:25:01 +00:00
Julian Sparber
3faf1caead messageTray: Introduce singleton Source for system notifications
This `Source` object should be used by all notifications created by
GNOME Shell and eventually can also be used by extensions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3156>
2024-02-06 17:25:01 +00:00
Julian Sparber
daa8ea5ab2 messageTray: Support setting notification icon by name
Since we now display the source icon and an image for the notification,
it's quite common to set an icon from a name. Therefore add a
convenience property to do so.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3156>
2024-02-06 17:25:01 +00:00
Sam Hewitt
4c5cb191d8 style: Fix bg color weirdness on background apps close button
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3140>
2024-02-06 17:14:40 +00:00
Sam Hewitt
da6950562a dateMenu: Add class to menu so border-radius can be set in stylesheet
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3165>
2024-02-05 22:57:01 +00:00
Keyu Tao
5d1a0cc525 windowManager: Add "opacity: 0" to minimize ease animation
Extensions like dash-to-dock use set_icon_geometry() to window.
This changes the dest and scale of ease animation of minimize and
makes it looks very strange. By setting dest opacity to 0 the animation
could be more natural.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2968>
2024-02-01 13:17:02 +00:00
Florian Müllner
d54e17d3d5 screenshot: Split out disabling cast button
Screencasts can be disabled for various reasons:

 1. the service is not available (missing plugin etc.)
 2. screencasts are not allowed by the session mode
    (lock screen etc.)
 3. the UI is invoked in screenshot-only mode (portal)

Currently each of those conditions is handled in a different
code path, which means that later conditions can re-enable
the button.

There's also an inconsistency whether disabling the button
is done via visibility or reactivity, which still allows
toggling the hidden button via shortcuts (although a hidden
button means that screencasts aren't supported at all, so
nothing will be recorded in that case).

Address this by updating the button from a dedicated function.

Fixes: 671df28a50 ("screenshot: Only handle mode-switch shortcut when
supported")

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7358
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3155>
2024-02-01 12:17:43 +00:00
Julian Sparber
8fed0b83d0 notification: Show symbolic icons in a circle and smaller
Huge symbolic icons look bad therefore we special case them, this
obviously can only work for icons that use the system icons.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3066>
2024-02-01 10:31:24 +01:00
Florian Müllner
f233aebe3a extensionDownloader: Use registered D-Bus error
Instead of returning ad-hoc errors, register a custom error domain
and return appropriate GLib.Errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3159>
2024-01-31 20:58:31 +01:00
Florian Müllner
f38e3f4b5d notificationDaemon: Use registered D-Bus error
Instead of returning ad-hoc errors, register a custom error domain
and return appropriate GLib.Errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3159>
2024-01-31 20:58:31 +01:00
Florian Müllner
8f03eec3a3 endSessionDialog: Use registered D-Bus error
Instead of returning ad-hoc errors, register a custom error domain
and return appropriate GLib.Errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3159>
2024-01-31 20:58:31 +01:00