19468 Commits

Author SHA1 Message Date
Florian Müllner
9beacca329 st/texture-cache: Remove load_sliced_image()
It was only used by the `Animation`/`AnimatedIcon` classes, which
have now been removed since `Spinner` is now an independent
implementation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3612>
2025-01-28 12:50:00 +00:00
Florian Müllner
f24a624335 animation: Remove now unused classes
Since `Spinner` is no longer a subclass of `Animation`/`AnimatedIcon`,
the latter are now unused. Apparently that's not only true for
gnome-shell itself, but also extensions, so there's little reason
for keeping the former base classes around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3612>
2025-01-28 12:50:00 +00:00
Florian Müllner
b1b4592bc4 build: Update jasmine-gjs wrap
The new version fixes repeated warnings with newer GIO versions
(using Gio.Unix... instead of GioUnix...) which clutter the
output when tests are run verbosely.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
f4c46647e6 run-test: Filter out SYSTEM_EXIT errors
Calling `System.exit()` isn't an error, and there isn't much
value in logging a "Exit with code 0" message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
546f3d65f7 run-test: Always use returned status code if possible
gjs_context_eval_module_file() is a convenience method for

 - register the module (load and parse)
 - evaluate the module (run)

The first can fail, but has no notion of status code; the
second will always set a valid code if provided (either as
returned by the module, or set by gjs itself).

Doing those two steps separately allows us to explicitly
handle failures to register the module, so that we can then
return the original status code from evaluating the module.

That means that if evaluating the module "fails" with a
`GJS_ERROR_SYSTEM_EXIT` error (because it was terminated
with `System.exit()`), we now return the correct status
code instead of `EXIT_FAILURE`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
d192fc984f run-test: Split out module evaluation
The gjs API is slightly odd, in that explicit calls to `System.exit()`
are treated as errors, regardless of the passed status code.

Before addressing this, split out the module evaluation code into
a separate function to separate it from the main logic.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
f42c2d7371 run-test: Switch to new argv API
It's a bit nicer to use than manually defining the legacy ARGV
array.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
699c7c1b2c run-test: Check argc before using argv
We skip the filename argument when defining ARGV before actually
checking that it was provided.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
e7691bd3df run-tests: Add missing newlines in error messages
Unlike the various g_message() macros, the g_print() functions do
not add an implicit newline at the end of the message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
68fe35d1a2 run-test: Use g_autoptr/autofree
While we don't really care about freeing memory before leaving
main, it doesn't hurt and is good practice anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
696bd09d18 run-test: Fix coding style errors
The original code was likely copied from gjs' console code at the
time, which means that its coding style sneaked in.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Carlos Garnacho
fecd5cdd6c shellDBus: Actually emit AcceleratorDeactivated signal
Add the missing plumbing to have this signal emitted via D-Bus.

Fixes: e53f69f9d ("shellDBus: Add AcceleratorDeactivated D-Bus signal")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3617>
2025-01-28 11:56:56 +00:00
Florian Müllner
8043714478 timeLimitsManager: Fix grayscale transition
The code currently gets the `DesaturateEffect.factor` property[0]
backwards: 1.0 means fully desaturated, not full color.

The result is that we are currently "transitioning" from 1.0 to 1.0,
that is the screen is abruptly turned to grayscale with no transition.

[0] https://mutter.gnome.org/clutter/property.DesaturateEffect.factor.html

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8160
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3606>
2025-01-27 18:58:17 +01:00
Carlos Garnacho
8f53096cfa shellDBus: Allow GNOME portal to access Shell D-Bus API
This will be necessary for a global shortcuts implementation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3598>
2025-01-27 14:09:00 +00:00
Carlos Garnacho
e53f69f9d3 shellDBus: Add AcceleratorDeactivated D-Bus signal
Add this signal to complement AcceleratorActivated, meant to happen
on the release action of shortcuts, e.g. on push-to-talk.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3598>
2025-01-27 14:09:00 +00:00
Florian Müllner
e2de46e9ac st/scroll-bar: Remove vertical property
Unlike `StBoxLayout` which is ubiquious, `StScrollBar` is hightly unlikely
to be used outside of `StScrollView`. It therefore seems unnecessary to
deprecate the `vertical` property before removing it, so do just that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
8b8699d1d5 st/scroll-view: Set scrollbar orientation
Use the new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
f4f02fe4dd st/scroll-bar: Add orientation property
Like we did for `BoxLayout`, add an `orientation` property that
better expresses the orientation (duh) and is consistent with
Clutter and GTK.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
c5546dbe12 st/box-layout: Deprecate vertical property
BoxLayout is extremely common, so removing the old `vertical` property
in favor of `orientation` would be very disruptive. Instead, deprecate
it to indicate our intention of removing it eventually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
b75b4abaf0 js: Set BoxLayout orientation
Use new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
01541929eb st/box-layout: Add orientation property
Using "vertical: false" to express "horizontal" has always been a
bit awkward. While we have stuck to the existing property for a long
time, transitioning to an `orientation` property like in GTK and
Clutter seems better.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 12:12:59 +00:00
Florian Müllner
b01d429266 st/theme-context: Make property setter public
There's no good reason to only expose the getter of a READWRITE
property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
794f0bcc75 st/scroll-view: Remove deprecated properties
The `hscroll` and `vscroll` properties were deprecated for GNOME 46.

We usually consider two stable cycles enough of a heads-up, so remove
them for GNOME 48.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
094caeeeef shell/window-preview: Make window-container construct-only
It is tightly coupled to the preview, and not meant to be unset
or replaced during the lifetime of the object; size requests
and allocation assume that it exists.

Make that explicit by marking the property as construct-only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
0f9c13c55d windowPreview: Set window container during construction
The container is tightly coupled with the preview, and there is
never a need to replace it at a later point. Set it directly
during construction, so the underlying base class can make
this explicit by marking the property as construct-only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
eae1e8b170 shell/window-tracker: Simplify updating focus-app
It's a text-book use case for `g_set_object()` …

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
e2f4a9b512 shell/workspace-background: Remove unnecessary notify
The `monitor-index` property is construct-only, so it can only
be set before the caller has an object on which to connect
the `notify` signal.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
959888c601 shell/global: Remove unnecessary CONSTRUCT flag
There's nothing special about the `force-animations` property that
requires it to be set unconditionally during construction.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
1c98283e09 shell/global: Remove imagedir property
The property has long lost its usefulness: It hasn't been
used since 2011, and we nowadays we use resources for any
image assets.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:03 +00:00
Florian Müllner
6c47cea2b9 build: Clean up handling of internal dependencies
We currently only specify the library to link with when declaring
a dependency, which means that satisfying other requirements like
dependencies or includes is left to the targets.

Move everything required by libshell/libst to the declared dependency,
so other targets only need to care about their own requirements.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:03 +00:00
Florian Müllner
0c20407f57 st/box-layout: Remove unnecessary notify
We already notify via the `notify::orientation` handler on the
layout manager, so there is no need to also do so from our own
setter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3613>
2025-01-26 22:55:55 +01:00
Florian Müllner
a80e5a8c39 st/box-layout: Fix forwarding vertical changes
Our code to "forward" `notify` signals from the underlying layout
manager for the `vertical` property broke when ClutterLayoutManager
removed its own `vertical` property.

Property changes via the underlying layout manager should be rare,
but still worth fixing, so explicitly connect to `notify::orientation`
now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3613>
2025-01-26 22:55:55 +01:00
Adam Williamson
4bef27d85c data: Correct Utilities category ordering, add comments
This adds a comment to make clear that the Utilities category is
intended to be organized alphabetically by the display name of
the apps (*not* by the desktop file names), and adds comments
with the current display name of each app.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3609>
2025-01-23 16:28:04 -08:00
Adam Williamson
ca136d1c62 data: List Characters and Logs in the Utilities group
These have (Logs) or previously had (Characters) the
X-GNOME-Utilities category in their .desktop file and so showed
up in the Utilities folder (despite 152faae claiming that the
category was "completely unused"). Characters had the category
removed in
https://gitlab.gnome.org/GNOME/gnome-characters/-/commit/210eb09
in apparent expectation that it would be added to the list, but
it seems it was not.

We could restore consideration of the category, but I guess let's
just list the apps instead? I don't know if any others are
missing.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3607>
2025-01-21 14:54:01 -08:00
Sam Hewitt
481625972b style: Fix fg color of user icon on dialogs
- use regular fg_color instead of OSD style

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8151
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3596>
2025-01-21 16:52:33 +00:00
Philip Withnall
4e6de4e64b timeLimitsManager: Activate wellbeing settings on clicking notification
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8161
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3604>
2025-01-21 14:46:57 +00:00
Philip Withnall
bba85e1fcd tests: Factor out additional env vars mechanism
Make the mechanism more general, so that other tests can now specify
overrides for various defaults, if needed.

This replicates what GLib does:
https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/tests/meson.build#L475.

It introduces no functional changes in how the current set of tests run.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3605>
2025-01-21 14:32:44 +00:00
Philip Withnall
a3d4198c85 tests: Run timeLimitsManager tests in UTC
In order to keep the test code brief, all expected times and dates are
written as ISO 8601 strings in the test code, and use `Z` to specify UTC
(again, to keep things brief).

If the test is run under a significantly different timezone, the
end-of-day timestamp changes significantly, as it’s calculated by the
code-under-test using the local timezone.

Avoid that issue by requiring the `timeLimitsManager` tests to always be
run in UTC.

The previous failure could be reproduced by running `TZ=Europe/Madrid
meson test -C /opt/gnome/build/gnome-shell timeLimitsManager --verbose`
— the test for “tracks a single day’s usage early in the morning” would
fail.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3605>
2025-01-21 14:32:44 +00:00
Philip Withnall
72cb52e743 timeLimitsManager: Hide ‘limit reached’ notification when reset
If the user changes their daily limit setting so that they’ve no longer
reached their limit, remove the ‘limit reached’ notification from the
message tray, if it’s still there, when disabling greyscale mode.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8164
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3603>
2025-01-20 19:05:58 +00:00
Philip Withnall
c890a2f1e3 timeLimitsManager: Reset screen time if daily limit is changed
If the limit for the day had already been reached, the
`timeLimitsManager` was not resetting the screen time state if the daily
limit setting was then changed (and increased).

Fix that, and add a unit test for it.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8164
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3603>
2025-01-20 19:05:58 +00:00
Bilal Elmoussaoui
1471733dfd st/widget: Adapt to upstreamed accessible state tracking
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3510>
2025-01-20 14:38:06 +00:00
Bilal Elmoussaoui
44b84e458a st/image-content: Take a CoglContext on set_bytes/set_data functions
This avoids retrieving it from the global clutter backend and instead
pass things around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:31 +00:00
Bilal Elmoussaoui
76f2262d9c st/texture-cache: Remove unused helper
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:31 +00:00
Bilal Elmoussaoui
a8496dc90f st/theme-node: Get resolution from context
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
eaee51ff16 st/theme-context: Keep a pointer to ClutterBackend
Allows avoiding the usage of the global one and would also be used in
the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
f5b58cf102 st/theme-context: Drop constructor
Nothing really uses it except internally.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
343761e70e st/node-drawing: Pass CoglContext around
We already have access to it in most of places, just pass it around
instead of going through globals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
084a1b3be7 plugin: Remove unused CoglContext field
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
0e92689801 Remove re-shadowed variable
Drops a call to get_default_backend

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
b3f5f9601b Go through global stage for getting ClutterBackend
Instead of using the default backend.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00