Commit Graph

17946 Commits

Author SHA1 Message Date
robert.mader@collabora.com
cbcb56972f style: Generalize sharing indicator class
To have a shared style for various privacy related indicators.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>
2023-07-29 13:55:15 +03:00
Ngọc Quân Trần
da9ed5c666 Update Vietnamese translation 2023-07-29 07:53:03 +00:00
Danial Behzadi
f2f028b774 Update Persian translation 2023-07-28 22:56:02 +00:00
Artur So
75c7ca1612 Update Russian translation 2023-07-28 18:17:45 +00:00
Yuri Chornoivan
98f9f11ec0 Update Ukrainian translation 2023-07-28 17:45:51 +00:00
Ekaterine Papava
620994108c Update Georgian translation 2023-07-28 05:11:42 +00:00
Balázs Úr
dfde92589f Update Hungarian translation 2023-07-27 23:53:26 +00:00
Florian Müllner
8238533418 ci: Make meson warnings fatal
The Config variable that was removed in the previous commit was
actually wrong (PACKAGE_VERSION vs. GETTEXT_VERSION), so the
substituation didn't work.

Meson warns about this, let's make these warnings fatal to catch
similar issues during CI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2844>
2023-07-23 15:36:20 +02:00
Florian Müllner
f0ba468664 extensions-app: Stop setting VERSION in config
We set it because it was referenced by (here unused) code
in ExtensionUtils. This changed in commit 4a0b0e26c7, so
stop setting it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2844>
2023-07-23 15:36:10 +02:00
Florian Müllner
3a54e6cfa8 subprojects/gjc: Update to lastest master
Pull in more bug fixes, in particular a fix for duplicated entries
and a potential crash when pulseaudio is restarted.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2849>
2023-07-23 11:55:41 +00:00
Florian Müllner
fc14fb8503 ci: Bump mutter image
Ever since the mutter image started to set up a non-root user for
running tests, the toolbox image built on top of it has been broken.

The issue has now been addressed, so update the image to pull in
the fix.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2850>
2023-07-23 11:42:56 +00:00
Florian Müllner
34a33467f7 ci: Don't install fake pkexec in toolbox image
The mutter image already replaces `pkexec` with a symlink to
`sudo`, which does the same job as the `su` wrapper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2850>
2023-07-23 11:42:56 +00:00
Fabio Tomat
eeea52760a Update Friulian translation 2023-07-20 21:46:45 +00:00
Vasil Pupkin
d45355e701 Update Belarusian translation 2023-07-17 14:24:54 +00:00
Florian Müllner
1354d2cf56 extensions: Unify how manager is injected into shared module
We unified most code paths earlier, but the common code will still
import Main locally if no extension manager was injected before.

Now that the old extensionUtils was split between extension and
preferences, each of those modules can simply import the manager
from its corresponding environment, and then inject it into the
shared module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
3006c05ea5 extensions: Simplify openPrefs()
The module is now only used inside the gnome-shell process, so
we don't have to handle the case where it is used from prefs,
and we can use regular imports for shell modules.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
6a46d338e7 extensions: Provide separate implementations
For the time being this mostly means re-exporting functions
from the shared module. However openPrefs() is now only
available to extensions, and we stop exporting both
getCurrentExtension() and setExtensionManager() to either
extensions or prefs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
55cf8cf4bb extensions/internals: Port to ESM
We got rid of all uses of extension utils code in the gnome-shell
process itself, and everything that is now using it - including
extensions - is already loaded as module.

We can therefore quickly move the file to ESM, which will help
a bit with upcoming changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
d3f662fbf2 extensionUtils: Split out extension convenience functions
ExtensionUtils was originally used for shared functions between
the extension system and the (old) prefs-tool, but then gained
useful API meant for extensions themselves.

It's a bit weird to mix the two, so split out the extension convenience
API into a separate module.

We will soon split up the module further, and add specific "flavors"
for extensions and preferences, with the current code providing a
shared base for both.

That should explain both the new location and the odd module name. :-)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
23f525785c extensionUtils: Use non-legacy style
The file already largely conforms to the new style. Quickly fix
up the remaining issues before making any major changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
4a0b0e26c7 extensionUtils: Move isOutOfDate() into manager
It hasn't been used anywhere else since the old prefs-tool stopped
implementing its own extension loading.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>
2023-07-15 13:16:42 +02:00
Florian Müllner
df350cab0a extensionUtils: Always use manager to find current extension
Now that we always have an extension manager object, we can use
the same code path for use from extensions and prefs.

For that, inject the D-Bus service's extensionManager instead
of the current extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
10672597c2 dbusServices/extensions: Add basic extension manager
ExtensionUtils' getCurrentExtension() method currently either
returns the extension that was injected with setCurrentExtension(),
or imports Main locally to access the extensionManager.

But local imports won't work anymore when we convert to ESM,
and setCurrentExtension() is only an option for prefs.

Instead of diverging the code paths even further, we'll unify
the two cases as much as possible.

As a first step, add a basic extension manager in the Extensions
D-Bus service that exposes the same lookup() API as the "real"
extension manager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
cdd19a7773 dbusServices/extensions: Save stateObj on extension
We don't need it for anything for the time being, but reducing the
differences between extension object in the gnome-shell process and
in preferences still seems a good idea.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
9e4de6a005 dbusServices/extensions: Don't use getCurrentExtension()
The prefs dialog is created on behalf of a particular extension.
It's a bit silly to rely on getCurrentExtension() to access it,
instead of just keeping track of it ourselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
b4c2901e47 dbusServices/extensions: Check earlier for existing dialog
There is no point in making a D-Bus call if we are going to bail
out anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
3451c5a182 extensionUtils: Slightly optimize current extension lookup
When looking for a directory name that matches the extension UUID,
we can just as well use GLib's dirname()/basename() functions
instead of wrapping the path in a GFile.

We also know that the original path corresponds to a regular file
and not a directory, so rearrange the loop to avoid a lookup that
is guaranteed to fail.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Florian Müllner
3289b79433 extensionUtils: Stop using RegExp for stack parsing
We currently use a regular expression to extract the exact file path
from a stack line. That RE is no longer accurate:

 - we assume a line number at the end, but at one point the column
   number was added as well
 - stacks from ES modules use file:// URIs instead of plain paths

Luckily that doesn't matter: We don't want to access any actual
files, so all we need is a path that can be traversed and that
contains the UUID.

We can get that with simple string manipulation, so avoid the regex
overhead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
2023-07-15 11:07:12 +00:00
Evan Welsh
c2c4d84fc1 dependencies: Migrate to ES module and organize dependencies
gi modules are always loaded (there is no API for "set version without
loading"), so
we need to break dependencies.js into three sections:

- Required
- Compile-time optional
- Runtime optional

Required dependencies are always imported, compile-time optional
dependencies
are loaded if gnome-shell is compiled with support for them, and for
runtime optional dependencies we catch any errors when attempting to
load them.
If runtime optional dependencies fail to load we log a debug-level
message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
7a5f1e5c9e layout: Add catch when asynchronously setting up the startup animation
This ensures any errors that occur in this stage of startup are clearly
logged.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
3f12f3a87c scripting: Convert to ES module and migrate tests
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
9a2c3da868 environment: Port environment.js to be an ES module
Removes the init() function in favor of executing all environment
changes when the file is imported.

Additionally ports all unit tests using imports.gi.environment.init() to
use the updated module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
26fa1046a3 tests: Load unit tests as modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Florian Müllner
3f667be2e8 ci: Include tests/ for linting
Linting isn't exclusively about coding style, but can detect
actual bugs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
c570011376 tests/unit: Fix remaining ESLint errors
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Florian Müllner
26e018206d tests/shell: Fix remaining ESlint errors
All tests are currently excluded from linting, so errors can sneak
in more easily.

We should change that, so quickly fix up any remaining errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
9e84891240 insertSorted: Refactor comparator functions to be arrow functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
df8fb2899d tests: Move assertArrayEquals to shared assertions file
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
b798efcc1d tests: Use gjs_context_eval_file to evaluate test scripts
GJS provides utilities to run scripts given a filename, using those
utilities we can remove most of the logic implementing file loading.

Additionally the REPL logic does not make much sense for a test
runner and is unused, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Florian Müllner
011ac6f83c dependencies: Specify versions of Shell/St
We started to version them last cycle, so docs can be differentiated
between versions. It is not *expected* that two versions show up
on the same system, but then it also doesn't hurt handling it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
e2e3694cbd environment: Split dependencies loading into a new file
Once environment.js is an ES module we need to ensure we can dynamically
specify the version for required GI dependencies such as Clutter.

Moving dependency version setup to dependencies.js ensures gi.require
calls are done before environment.js imports any utilities.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Evan Welsh
87d1248dc1 animationUtils: Group together various animation helpers
The environment module is used to initialize the environment, yet it
currently also defines the adjustAnimationTime() function.

Ideally it should not export any utility functions, in particular
once converted to ESM.

The function cannot be moved to the existing Utils module, as that
depends on an initialized environment, and can therefore not be
imported from environment.js, so use that opportunity to group
together several animation helpers in a new animationUtils module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
2023-07-15 02:35:56 +00:00
Florian Müllner
3c9857abad ci: Bump mutter image
Eieiei, mutter now depends on libei.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2846>
2023-07-15 03:27:22 +02:00
Florian Müllner
7eafc248cd lookingGlass: Evaluate command asynchronously
This allows using await in the command (or the header we
add to it), for example when handling Promises or importing
a module dynamically.

The latter will be crucial when porting to ESM.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Florian Müllner
85a8a6f46c lookingGlass: Reformat command header
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Florian Müllner
c0fbd74d07 jsParse: Make getCompletions() asynchronous
Part of the possible completions involves evaluating the part
of the passed in text that looks like an object, so that we
can query it for properties.

Using a Function or eval() for that means that we can only
complete text that does not use `await`. To get over that
limitation, evaluate the text in an AsyncFunction instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Florian Müllner
13e20e47bf jsParse: Replace eval()
The evil() function is considered eval, replace it like we
already did in looking glass.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Evan Welsh
a66ffcfc74 jsParse: Use JSDoc to document functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Florian Müllner
561d0d3758 lookingGlass: Handle completions asynchronously
They will actually become asynchronous in a following commit,
prepare for that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00
Florian Müllner
03025d7cff lookingGlass: Handle unprintable object
We currently throw an error when encountering a result that cannot
be represented as string, with the prompt appearing somewhat stuck
(the input cannot be committed).

Showing a lame fallback instead at least avoids that issue. When
the object has a typeof 'object' but is not an instanceof Object,
we are likely dealing with an ES module, and can show a slightly
less lame fallback.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
2023-07-14 12:36:53 +00:00