Commit Graph

24 Commits

Author SHA1 Message Date
Simon McVittie
7f4f328a7f Specify API versions for all public GIR APIs, except GLib
If one of these libraries breaks its GIR API in future, then upgrading
packages unrelated to gnome-shell might pull in the newer version,
causing gnome-shell to crash when it gets a newer GIR API that is
incompatible with its expectations. For example, this seems to be
happening in Debian testing at the moment, when GNOME Shell 41.4
imports GWeather and can get version 4.0 instead of the version 3.0 that
it expected.

Adding explicit API versions at the time the newer version is released
is too late, because that will still let the newer version of the GIR API
break pre-existing GNOME Shell packages. Prevent similar crashes in
future by making the desired versions explicit.

This is done for all third-party libraries except GLib, similar to the
common practice in Python code; if GLib breaks API, then that will be
a disruptive change to the whole GLib/GObject ecosystem, regardless.

Gvc, Meta, Shell, Shew, St are not included because they're private
(only exist in a non-default search path entry).

Clutter and Cogl *are* included, because we need to import the fork of
them that comes with Meta, as opposed to their deprecated standalone
versions.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug-Debian: https://bugs.debian.org/1008926
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2261>
2022-04-04 17:55:25 +01:00
Romain Vigier
1087a0f6c1 extensions-app: Update authors list
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2114>
2022-02-12 14:51:30 +00:00
Romain Vigier
77bd26fe07 extensions-app: Enable/disable an extension by activating the row
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2114>
2022-02-12 14:51:30 +00:00
Romain Vigier
859ded5790 extensions-app: Remove extension row revealer
Make all the actions (open website, open preferences, remove extension) and
information (description, version number) readily available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2114>
2022-02-12 14:51:30 +00:00
Florian Müllner
a1dd1b25d8 js: Use templates for non-translatable strings
This reverts commit 9d941f8202 and replaces all additional
instances of .format() that have been added since.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2160>
2022-02-12 12:29:52 +00:00
Florian Müllner
5442266f28 js: Simplify promisify() calls
If the finish function isn't specified, promisify will now try
to use the async name without '_async'/'_begin' suffix (if any)
and '_finish' appended.

Everything except IBus uses a variation of that pattern, so there's
quite a bit of boilerplate we get to remove…

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2174>
2022-02-11 16:24:01 +00:00
Romain Vigier
ab5977713b extensions-app: Use AdwPreferencesPage and AdwPreferencesGroup
Give consistent styling and sizing to extensions lists.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1997>
2022-01-05 15:50:47 +01:00
Florian Müllner
f0754431bf extensions-app: Use Adw.Application's automatic style loading
Now that we switched to AdwApplication, we can automate loading
the custom stylesheet by simply using the expected name and
resource prefix.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1997>
2022-01-05 15:50:43 +01:00
Romain Vigier
891978b4eb extensions-app: Use AdwApplication
Initialize libadwaita, which loads the libadwaita stylesheet
and allow following the dark style preference of the system.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1997>
2022-01-05 14:33:35 +01:00
Florian Müllner
ef70364e81 cleanup: Replace non-standard ByteArray module
gjs landed support for TextDecoder/TextEncoder. Use those instead
of gjs' own ByteArray module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1946>
2021-09-01 14:49:30 +00:00
Florian Müllner
e8ca92a0ff extensions-app: Pick up app ID from package
This will allow us to build different applications from the
same sources (namely "Extensions" and "Extensions Nightly").

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1661>
2021-02-11 17:45:00 +01:00
Leleat
9fcbf3d0f9 extensions-app: Add description tooltip to rows
... to allow showing the full description in case the label is ellipsized.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1663>
2021-02-11 11:20:30 +01:00
Florian Müllner
edd34c50d9 Port extensions app and portal to GTK4
With the previous preparations in place, it is time to take the plunge.

As both the app and the portal use the same small library for handling
external windows, port everything at once to avoid the hassle of building
and installing two versions of the library.

With the portal using GTK4 now, all extensions must port their preference
widgets as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1495>
2021-01-14 13:03:21 +00:00
Florian Müllner
1bb0e1b9fc extensions-app: Explicitly dispose window when removed
Unlike in previous GTK version (or Clutter), destroy() no longer
breaks reference cycles but just releases the reference held by
GTK itself.

So any reference we hold - either the explicit property or any signal
handlers that bind the window as `this` - prevents the window from
being disposed when closed, and the application won't quit.

Work around this by explicitly running dispose() on the window when
it is removed from the application.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1495>
2021-01-14 13:03:21 +00:00
Florian Müllner
3af90918a3 extensions-app: Stop using :margin shortcut
The property has been removed in GTK4, so prepare for a port by
setting the four individual margin properties instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1495>
2021-01-14 13:03:21 +00:00
Florian Müllner
9ef59b3b4f extensions-app: Add extension filtering
It's possible for the list of installed extension to get long
enough to make searching more convenient than scrolling.

Support that by implementing the standard search pattern[0]
with a hidden search bar and a toggle in the headerbar.

[0] https://developer.gnome.org/hig/stable/search.html.en

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3382
2020-11-12 22:05:46 +00:00
Florian Müllner
8d43deaad5 extensions-app: Add quit action
It's good practice to support the standard <ctrl>-q shortcut, so
add a corresponding action and set its accel accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3335
2020-10-28 21:45:18 +01:00
Florian Müllner
9cad7ae975 extensions-app: Indicate extension errors
Currently there is no indication that an extension had an error except
for the sensitivity of the switch (which may have a different cause).

This is useful information to users, so add a small error indicator
alongside the updates icon and show the actual error in the details.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2337
2020-05-21 21:45:04 +00:00
Florian Müllner
d2583aa47b extensions-app: Reset switch handle when it becomes insensitive
Currently the switches handle position reflects the requested
extension state (as in: the user (de)activated the switch),
while the actual extension state is reflected by the underlying
state.

That doesn't work well when the switch is insensitive though (for
example on error), because the desaturation neuters the color
that reflects the state.

Address this by resetting the switch handle to the state when
making it insensitive.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1263
2020-05-21 21:29:31 +00:00
Florian Müllner
27774582b6 extensions-app: Fix Logout call
Commit 764527c8c9 adjusted the "call" call to promisification that
never happened (in this bit of code).

We can either add back a callback or properly promisify the call;
this opts for the latter.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2735
2020-05-07 15:58:06 +00:00
Florian Müllner
b02e3719b3 extensions-app: Rename executable
We kept the old binary name when overhauling the tool for the Extensions
app to avoid unnecessary churn for packagers/distributors.

However we now have a reason to "free" the old name, so rename the binary
to match the (sub)project name.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1220
2020-04-28 00:06:19 +02: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
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
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