Commit Graph

9363 Commits

Author SHA1 Message Date
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
Florian Müllner
6bcb4f310f popupMenu: Hide ornament by default
We have always defaults to an empty ornament, so that menu items
are always aligned, even when radio items are used.

However radio items are fairly rare, so most of the time we end
up with an extra margin with no purpose. The design team now
prefers radio items to only align with each other, so that regular
items get the expected margin.

Change the defaults accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
2023-08-01 17:32:53 +00:00
Florian Müllner
8e9398be7e popupMenu: Never add ornament padding to image items
PopupImageMenuItem moves the ornament after the label, so we don't
need the additional padding that accounts for visible ornaments
for regular items.

Spotted by Sebastian Keller.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
2023-08-01 17:32:53 +00:00
Sebastian Keller
ad34082fd1 popupMenu: Use correct padding for items with hidden ornaments
This also restores the padding adjustments that were erroneously removed
in a0fde0ee, but now they only apply to ornamented items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
2023-08-01 17:32:53 +00:00
Florian Müllner
6a3dfbee8b status/network: Only show ornament in radio-mode
Soon only radio items should use a visible ornament, to avoid
unnecessary extra margins in regular items.

Network items can act as both radio- and regular items, so
update the ornament accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
2023-08-01 17:32:53 +00:00
Florian Müllner
2f8a2c3166 status/keyboard: Explicitly initialize ornament
Layout items use the ornament to indicate the active layout, so
their ornament should always be NONE or DOT.

The default is about to change to HIDDEN, so explicitly initialize
the ornament to NONE to keep the current radio item appearance.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
2023-08-01 17:32:53 +00:00
Florian Müllner
62db8dc16e status/backlight: Add new quick toggle
Settings no longer exposes a slider for the keyboard brightness,
leaving keyboard shortcuts as the only way of adjusting it.

This is good enough in most cases, because devices with keyboard
backlight usually include corresponding keys on their keyboard.

However for devices without those keys, it would be good for the
settings to be exposed somewhere again. Quick settings seems like
a more appropriate place than "proper" Settings, since it gives
quick access that doesn't require a major focus change.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2820>
2023-07-30 11:12:50 +00:00
Florian Müllner
797df4f52f extensions: Make ExtensionPreferences more flexible
Extensions must now export a class with a fillPreferencesWindow()
method in their prefs. That is less convenient for extensions
with simple preferences than the old buildPrefsWidget() hook, as
they must wrap their widget in page/group widgets.

Address this by adding a default fillPreferencesWindow() implementation
that calls a getPreferencesWidget() method and wraps it as necessary.

This is flexible enough to support different cases fairly conveniently,
from simple single-widget prefs over tweaking the window to complex
multi-page prefs:

```js
class SimplePreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }
}

class TinkerPreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }

    fillPreferencesWindow(window) {
        super.fillPreferencesWindow(window);

        window.set_default_size(123, 456);
    }
}

class FullPreferences extends ExtensionPreferences {
    fillPreferencesWindow(window) {
        const page1 = new GeneralPage();
        window.add(page1);

        const page2 = new FoobarPage();
        window.add(page2);
    }
}
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
2023-07-30 10:29:44 +03:00