Commit Graph

9370 Commits

Author SHA1 Message Date
Florian Müllner
610b72d43a dash: Move getAppFromSource() into static method
This is a small helper function that is used by the DND handling
in the dash and its items.

It turns out that some extensions used to override it, which is
no longer possible: We don't export it, and if we did, it would
be read-only.

To make the function available again, expose it as static method
on the dash itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2903>
2023-08-20 01:30:55 +00:00
Florian Müllner
93b89ce0c5 panel: Add extension hook to add quick settings items
Quick Settings has become a popular extension point, but adding
items anywhere but the end has become harder since the indicator
setup was made async.

Address this with an addExternalIndicator() method that adds
indicator and quick settings items at reasonable positions.

At the same time, adjust the indicator setup to take eventually
added external items into account.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2894>
2023-08-20 01:54:09 +02:00
Florian Müllner
96bf9e700f quickSettings: Add getFirstItem() method
We will need some more access to the menu's underlying grid to
provide extension API for adding additional quick items.

Expose a new getFirstItem() method that (surprise!) returns the
first item.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2894>
2023-08-20 01:54:09 +02:00
Florian Müllner
30a36c970b quickSettings: Add insertItemBefore() method
The QuickSettings menu currently only support appending items
at the end. Extensions can get around that limitation by accessing
the private grid property to move the item afterwards, but we don't
allow this in our own code.

Expose a new insertItemBefore() method that allows adding an item
before an existing one.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2894>
2023-08-20 01:54:09 +02:00
Georges Basile Stavracas Neto
ca503774b2 panel: Add workspaces indicators in activities button
After removing the app name and icon, the next natural step that
was requested from the design team is to add workspaces indicators
to the top bar, where currently the Activities button is placed.

In addition to that, this is desired because there are known issues
with using "Activities" as a label for the overview. A more
comprehensive rationale for that can be found at [1].

Add an workspaces indicator replacing the Activities label in the
activities button.

The WorkspaceIndicators class controls how many workspaces dots
exists, their expansion, and the width multiplier. The WorkspaceDot
class takes the expansion and the multiplier, and applies it
internally so that we can get perfectly rounded dots at all
times without using CSS hacks.

The width multipliers are hardcoded, and defined by the design
team. We can revisit them later if necessary. Special care is
taken to not let these width multipliers result in fractional
widths.

When the number of workspaces changes, WorkspaceIndicators adds
new dot to the end, and animate them. When removing, scale the dot
out, then destroy it.

This does not work with workspace grids, but that's not supported
by GNOME Shell anyway, so no effort is made to cover this use case.

The button continues to have "Activities" as its accessible name,
but the label actor is removed.

Also adjust the padding of the activities pill, so it better wraps
the new indicators.

[1] https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/227

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2902>
2023-08-19 15:54:04 +00:00
Marco Trevisan (Treviño)
b5960af2fc layout: Export PressureBarrier
It's an utility function that extensions can use to create pointer barriers,
so export it to allow wider usage

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2900>
2023-08-18 03:47:51 +00:00
Marco Trevisan (Treviño)
49464e3c7a init: Include the error stack in the context termination error message
If a failure happened during initialization the shell does not provide
any debug information, and so only the error is shown without a stack
trace.

Since this information is provided, pass it as the error message.

Do not log this directly from JS so that we just use one termination
path.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2899>
2023-08-18 00:31:10 +00:00
Simon Schneegans
8d1aa7bed8 lookingGlass: Export the Inspector class
Several extensions use this class to let the
user pick application windows. Exporting this
class will make it easier for these extensions
to be ported to GNOME 45.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2898>
2023-08-17 19:32:42 +02:00
Brendan William
ae86b58d59 weather: Prevent setting Geoclue source as location name
Prior to Geoclue v2.7, the location description did not seem to ever be
set. Now, the source used to determine the location is set as the
description. This can result in the location name in dateMenu to be set
as "WiFi", "GeoIP", etc., since we relay the description as the location
name to GWeather. Instead, pass an empty string so GWeather continues
to set the location name itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2729>
2023-08-16 19:17:21 +00:00
Chris Heywood
f119e5282b messageList: Allow dismissal via backspace
Currently only the delete key can be used to dismiss notifications.
Some laptops don't have delete keys, resulting in needing to hit a
modifier to trigger delete.

Plus, on those keyboards that do have delete keys they're often a
little harder to strike than backspace.

https://gitlab.gnome.org/gnome/gnome-shell/-/issues/5789

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2435>
2023-08-16 14:04:47 +02:00
Florian Müllner
8619b7637d panel: Don't expand camera quick settings items
The camera indicator currently doesn't have any items, but if
we were to add one, it would almost certainly be a regular
toggle rather than a slider that needs expanding.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2891>
2023-08-15 22:33:25 +00:00
Florian Müllner
af5dd7ddd1 extensions/shared: Don't cache detected URL
The translation functions we export from extension utils must
work with all extensions, not only the first that calls one
of the functions.

That means that we are back to examining a backtrace for every
function call unless an extension defined its own translation
functions with `import.meta.url`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2887>
2023-08-14 11:46:57 +00:00
Georges Basile Stavracas Neto
f497e863fd workspaceAnimation: Sync progress with main adjustment
Create a derived workspaces adjustment using the new API, and
bind it to the 'progress' property. This is only done by the
MonitorGroup representing the primary monitor.

The progress value that WorkspaceAnimation operates on
represents the percentage within the workspaceIndices array
we are, so make sure to transform the percentage to the
correct workspace index.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2881>
2023-08-11 16:51:13 +00:00
Georges Basile Stavracas Neto
f1db3498eb workspaceAnimation: Notify 'progress' property properly
The getter of the MonitorGroup's 'progress' property sets
some values based on it, but doesn't notify the property
change.

Fix that by calling this.notify('progress') when the setter
is called.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2881>
2023-08-11 16:51:13 +00:00
Georges Basile Stavracas Neto
13f4c781d5 overviewControls: Use new workspaces adjustment API
Derive the workspaces adjustment used by OverviewControls (and
shared with WorkspacesView) from the main workspaces adjustment
using the new Main.createWorkspacesAdjustment() method.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2881>
2023-08-11 16:51:13 +00:00
Georges Basile Stavracas Neto
4d963c432b main: Introduce global workspaces adjustment
And a way to derive "sub"-adjustments from the main one.

The main and private StAdjustment properly represents
workspaces, and has all relevant properties (lower, upper,
and value) set by the workspace manager.

The main adjustment is not bound to any particular actor,
which means we cannot call the 'ease' method directly.

Consumers of this API should create adjustments using
Main.createWorkspacesAdjustment(), and this new adjustment
is bound to the actor that the consumer passed. Consumers
must not change any property of the derived adjustment other
than the 'value' property.

The 'value' property is synchronized between all adjustments
created, which guarantees that all elements that represent
workspaces can have a shared and up-to-date understanding of
where in the workspace layout we are.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2881>
2023-08-11 16:51:13 +00:00
Dallas Strouse
7e18b4d0b2 util: Export trySpawn()
It was private before, and so any users of it (including the
Background Apps menu) would fail to utilize it, making apps fail
to get told to shut down from the Background Apps menu.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2885>
2023-08-11 17:54:49 +02:00
Florian Müllner
05f5532c7d status/backgroundApps: Close after activating app
We should leave the overview and close quick settings, like we
do elsewhere when launching something.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2884>
2023-08-11 10:27:49 +00:00
Florian Müllner
8a8539ee67 js: Port Config to ESM
The Config module is shared between the main process, D-Bus
services and tests, which previously prevented it from being
ported to ESM.

The previous commit removed the last outstanding blocker, so
we can now port the last remaining module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2880>
2023-08-10 17:42:23 +00:00
Andrew Zaech
09525ece8c extensionBase: Fix issue in lookupByURL()
The lookupByUUID() implementations in the subtypes return null
when the lookup failed, not undefined.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2879>
2023-08-10 16:04:51 +00:00
Andy Holmes
a703e192ed notificationDaemon: Export notification source classes
Out of the members of the notification daemon(s), these are the most
necessary and flexible to override. The daemons are used as singletons
and notifications are rather temporary, while the sources are more
flexible and make the most sense to override (and revert).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2869>
2023-08-10 13:33:13 +00:00
Florian Müllner
d6cfc13c3f screenshot: Export showScreen*UI() functions
showScreenshotUI() is needed by the system action, and
showScreenRecordingUI() is conceptually so similar that
it would be odd to export one and not the other.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2877>
2023-08-09 15:22:55 +00:00
Florian Müllner
ff010a11ab cleanup: Fixup wrong JSDoc comments
There are a handful of JSDoc comments that are invalid or don't
conform to the configured format. Fix them to remove the last
remaining bit of legacy configuration.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:38 +00:00
Florian Müllner
a42f7c2384 cleanup: Use type-safe comparisons
We have been using type-safe comparisons in new code for quite a while
now, however old code has only been adapted slowly.

Change all the remaining bits to get rid of another legacy style
difference.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:38 +00:00
Florian Müllner
9a3913d4a0 cleanup: Use consistent 4-space indent
This is another bit where we've made good progress, and just need
a final push to complete the transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Florian Müllner
071f92cfb6 cleanup: Remove spaces in object literals
We only adopted this style relatively recently, so there's a bit
more to adjust. Still, it's manageable and another step towards
getting rid of the legacy style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Florian Müllner
6a22af83dc cleanup: Always use single quotes
We have made good progress with transitioning to the new style,
to the point where we can complete it with a final push.

Start with changing the remaining places that still use double
quotes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Carlos Garnacho
d56b05b5c3 js: Avoid Clutter.get_current_event() in Clutter.Actor event vfuncs
We sometimes obtained the current event through the general machinery
just so we could pass it along as a ClutterEvent instead of a specialized
subtype.

We now get that out of the box, so may avoid getting the current event
which is just a cast of the same current event we already have.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872>
2023-08-09 13:46:14 +02:00
Carlos Garnacho
8423ba44fe js: Mass move to Clutter.Event getter methods in Clutter.Actor vfuncs
These traditionally got the various ClutterEvent subtype structs as their
argument, so it was not allowed to use ClutterEvent generic getter methods
in these vfuncs. These methods used direct access to struct fields instead.

This got spoiled with the move to make ClutterEvent opaque types, since
these are no longer public structs so GNOME Shell most silently failed to
fetch the expected values from event fields. But since they are not
ClutterEvents either, the getters could not be used on them.

Mutter is changing so that these vmethods all contain an alias to the
one and only Clutter.Event type, thus lifting those barriers, and making
it possible to use the ClutterEvent methods in these vfuncs.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2950
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872>
2023-08-09 13:46:08 +02:00
Carlos Garnacho
5e36a06835 inputMethod: Check that there is an existing cursor location
Commit 17d9ec5788 made the input method call update() more eagerly,
but also at times that it does not have a cursor position yet. Make
it bail out correctly in that situation.

Fixes: 17d9ec5788 ("inputMethod: Keep Capabilite.FOCUS before context.focus_in/focus_out")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2876>
2023-08-09 12:44:30 +02:00
Carlos Garnacho
c9741ae3d5 ui/slider: Handle emulated scroll events through the Clutter.EventFlags
Emulated scroll events no longer get event.is_pointer_emulated() set to
True, instead this information is propagated through the Clutter.EventFlags
of the event.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2871>
2023-08-08 17:23:33 +00:00
Takao Fujiwara
17d9ec5788 inputMethod: Keep Capabilite.FOCUS before context.focus_in/focus_out
If context.focus_out() is called *after* context.set_capabilities(0),
The FocusOut D-Bus method is ignored because of no FOCUS capability.
If context.focus_out() is called *before* context.set_capabilities(0),
The 0 capability is set to the next focused context and the
FocusIn D-Bus method is ignored because of no FOCUS capability.
So context.set_capabilities(0) should not be called.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6415
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2666>
2023-08-08 10:20:28 +00:00
Takao Fujiwara
1cfaa2379d inputMethod: Try to connect require-surrounding-text signal
require-surrounding-text signal has been added since IBus 1.5.28.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6405
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2668>
2023-08-08 11:59:02 +02:00
Carlos Garnacho
f40a641801 padOsd: Simplify continuation of edition into further ring/strip directions
Inline the checks, so that we call stopEdition() from a single place.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2766>
2023-08-07 20:49:20 +00:00
Carlos Garnacho
457f3ae15b padOsd: Use per-direction labels on ring/strip actions
Rely on new Mutter API in order to separate mapping/labeling of buttons
and rings/strips, so that the latter may have per-direction labels.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6631
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2766>
2023-08-07 20:49:20 +00:00
Florian Müllner
477011a364 js: Port dbusUtils to ESM
The module is shared between the various D-Bus services and the
main gnome-shell process, so it was originally left out to allow
porting different bits at their own speed.

Now that everything has been ported to ESM, there is no reason
to not move that particular module as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2868>
2023-08-07 19:05:50 +00:00
Florian Müllner
57662c1673 portalHelper: Fix import
fileutils.js is in a different directory than the main entry point.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2868>
2023-08-07 19:05:50 +00:00
Sebastian Keller
232e30108a polkitAgent: Fix misc import path
This was causing the importing of the component to get stuck, meaning it
would not get enabled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2864>
2023-08-06 19:51:17 +02:00
Sebastian Keller
81692280bf keyring: Fix misc import path
This was causing the importing of the component to get stuck, meaning it
would not get enabled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2864>
2023-08-06 19:50:55 +02:00
Evan Welsh
a751e213f6 js: Port to modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-06 13:02:49 +02:00
Evan Welsh
d9198317ae components: Change component loading to be asynchronous
Some components use build time optional dependencies such as
GNOME Bluetooth, so we need to import the components
conditionally.

Also rename to get rid of __init__.js file

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-05 22:16:23 +02:00
Evan Welsh
12f6d7027b listModes: Port listModes command to ES module
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-05 22:16:23 +02:00
Evan Welsh
b6e97fe449 js: Remove unused GDM utility functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-05 22:16:23 +02:00
Evan Welsh
64aa871a8a js: Add JSDoc to exported functions and fix incorrect JSDoc formatting
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-05 22:16:23 +02:00
Florian Müllner
910829f270 status/backlight: Sync checked on level changes
Since switching to property bindings/notifications, value changes
only happen on actual changes, so we cannot rely on them as the sole
source of updating the checked state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2862>
2023-08-05 20:02:57 +00:00
Florian Müllner
987435f1cc status/backlight: Update icon assets
… following design review.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2861>
2023-08-05 19:46:48 +00:00
Florian Müllner
a332771562 injectionManager: Support overriding vfuncs
Overriding vfuncs can be useful, in particular when we convert
to ES modules, and exported symbols cannot easily be swapped out.

Adapt overrideMethod() to work correctly in that case as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2809>
2023-08-05 12:35:30 +02:00
Florian Müllner
f70a75a905 extensionUtils: Add InjectionManager
It is fairly common for extensions to monkey-patch existing
classes. Add a small helper class that makes this a tad bit
more convenient.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2809>
2023-08-05 12:34:41 +02:00
Florian Müllner
7c4b1d4ae6 status/backlight: Notify slider value changes
The custom setter used by the slider item isn't emitting change
notifications, so the property binding that uses it as source
never propagates the new value.

Fix this by emitting proper change notifications.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2856>
2023-08-05 00:46:29 +00:00
Sam Hewitt
a466029374 panel: Fix drawing functions for light theme
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>
2023-08-02 20:05:39 +00:00