Commit Graph

9482 Commits

Author SHA1 Message Date
Sebastian Wick
6b9c04de6e lookingGlass: Use Cogl.Pipeline.new to construct new pipelines
new Cogl.Pipeline now constructs a GObject via g_object_new and not via
cogl_pipeline_new. Construction via g_object_new requires a some
construct only parameters so either way, this call doesn't work anymore.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3144
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3057>
2024-01-06 21:24:56 +00:00
Philip Chimento
71befc5ff7 extensionSystem: Improve error formatting
This exposes the formatted error with stack trace and proper location of
SyntaxErrors over the bus, instead of just the message.

<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 20:12:32 +01:00
Philip Chimento
1692004b6b init: Improve error message formatting
Instead of manually formatting the error message and stack, use the same
formatting mechanism as we do when displaying errors to the user that
occur while opening extension preferences. This should correctly
indicate where syntax errors from imported modules occur.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Philip Chimento
e3ea12b8d5 scripting: Use logError to format error stack
Instead of manually formatting the error stack, use logError() to
display the error. logError() displays the stack already.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Philip Chimento
e4691d2717 dbusServices/extensions: Improve error message formatting
See https://gitlab.gnome.org/GNOME/gjs/-/issues/584 for a user report.

This uses the new formatter added in the previous commit to format
errors in the extension preferences loader.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Philip Chimento
e6f35c5e88 main: Improve error formatting in logError()
We override GJS's default logError(). This adds the improved formatting
of error stack traces that gjs-console would otherwise do as part of
logError().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Philip Chimento
a1a320d3d1 js: Add utility to improve error message formatting
Previously, when we formatted SyntaxErrors with toString(), they
wouldn't display the file/line/column where the syntax error occurred.
This adds a utility function that performs a more comprehensive
formatting that displays location information for SyntaxErrors, as well
as the .cause property of the error if it is present. This formatting is
equivalent to what we do in gjs-console when logging an error.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Philip Chimento
5fe6e5c865 js: Alphabetize JS resources
These look like they are supposed to be alphabetized, but are not quite.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
2024-01-04 18:59:33 +00:00
Florian Müllner
b5e5b67e22 screenshot: Expand window contents
More fallout from commit c290a38730 …

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7287

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3083>
2024-01-03 21:48:18 +00:00
Florian Müllner
f9e81284f8 extensionSystem: Allow changing extensions in ERROR state
While an extension's actual state can no longer change once it is
in ERROR state, its requested state can. In fact, disabling an
erroneous extension is highly recommended, so that it doesn't cause
problems again on the next login.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
2024-01-03 20:05:05 +00:00
Florian Müllner
02b19e3b5c extensionSystem: Add 'enabled' property
Unlike `state` which represents the actual state, the new property
reflects the desired state, i.e. whether an extension should be
enabled according to the settings.

The Extension app will soon use it to improve its handling of the
case where the two mismatch (e.g. extension errors).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
2024-01-03 20:05:05 +00:00
Florian Müllner
e6624f8ba1 extensionSytem: Rename ENABLED/DISABLED states
The ENABLED state means that an extension's `enable()` method
was called successfully.

This usually matches whether an extension *should* be enabled
according to the enabled-extensions/disabled-extensions settings,
but not necessarily: If an extension had an error or does not
support the currently active mode, its actual state is different.

We currently only expose the actual state to external tooling,
but whether an extension should be enabled is relevant as well,
for example to disable a lock-screen only extension from the
regular session.

For that purpose we will expose a separate `enabled` property.
To avoid confusion with the existing states, change the exposed
names to (IN)ACTIVE.

This does not affect the D-Bus API, as the numeric values of
the states remain unchanged.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
2024-01-03 20:05:05 +00:00
Jonian Guveli
6615d69985 appMenu: Move setApp to null before destroy
Calling `setApp` after the menu has been destroyed results in error.
Moving the method before `super.destroy()` fixes the issue.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2998>
2023-12-31 20:30:11 +02:00
Florian Müllner
1dda339395 animation: Use appropriate spinner asset in light variant
Ideally we would replace the sliced-image based animation with a
themed `process-working-symbolic` icon and rotate it, so the spinner
simply picks up the current foreground color.

Unfortunately the `repeat-count` property does not work for rotations,
so to fix the broken spinner in the light variant
in the meantime, include assets for both variants and swap them
out at runtime.

Not everything in the light variant is actually light (overview,
OSDs, ...), so use a simple heuristic on the text color to decide
which asset to use.

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6783

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3080>
2023-12-27 10:10:35 +00:00
Florian Müllner
74445249db animation: Save file and dimensions in properties
The properties passed to the constructor are currently used
directly in anonymous functions. Store them in properties
instead, so they become accessible outside the constructor,
including for changing them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3080>
2023-12-27 10:10:35 +00:00
Leleat
d429ab5e08 windowManager: Add shortcuts to open new window of nth pinned app
Add new shortcuts to open a new instance of an app by pressing
Super + Ctrl + Number. This is analogous to ctrl-activating
(LMB/Enter) an app icon.

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4129

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1829>
2023-12-24 10:56:09 +00:00
Florian Müllner
dc655b9ed0 main: Override global logError() function
logError() prints an exception with an optional prefix, and is
used fairly commonly through-out the code base.

The problem is that by being defined in gjs, it uses "Gjs" as the
GLib log domain, not our own as expected.

Address this by adding a small override that implements the function
with console.error().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3072>
2023-12-21 19:17:32 +00:00
Georges Basile Stavracas Neto
ee150f2949 screenshot: Add and implement new D-Bus method
The new InteractiveScreenshot() D-Bus method is implemented using
the signals introduced by the previous commit, and is fundamentally
very simple: take the screenshot, and return the GFile URI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
c80f3af79b screenshot: Add signals to ScreenshotUI
These signals will let the yet to be introduced D-Bus method to
be notified of when either a screenshot has been taken, or if
the screenshot UI has been closed without taking a screenshot.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
75dafd8d9c screenshot: Add SCREENSHOT_ONLY UI mode
Add a screenshot-exclusive mode that makes the screencast button
unreactive, and therefore disables screencasting. It doesn't change
the visibility of the button though, as that's done by the codepath
that checks if screencasting is supported.

This will be used by the D-Bus callback to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
52a7ee7590 screenshot: Make captureScreenshot() return the GFile
Make the captureScreenshot() auxiliary function return the GFile at
which the texture was saved. This file will be used to return the
screenshot URI to the new D-Bus method to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Julian Sparber
b66dee80f6 panel: Ensure signal is disconnected when the panel is destroyed
This fixes a warning when terminating GNOME Shell

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3064>
2023-12-21 15:17:28 +00:00
Florian Müllner
070e712508 extensionSystem: Add debug logging
Now that we can use console.debug() to log messages that aren't
shown by default, we can be a lot more verbose without spamming
the system log.

Use that to all extension state changes, which can be useful for
debugging.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3058>
2023-12-21 15:12:14 +00:00
Florian Müllner
3351cd2f07 panelMenu: Remove SystemIndicator class
It was used by components in the aggregate menu. That menu no
longer exists, and the class has been superseded by the class of
the same name in quick settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3068>
2023-12-21 13:35:50 +00:00
Florian Müllner
9c2da01a95 userWidget: Expand child
More fallout from commit c290a38730 …

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7264

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3061>
2023-12-16 23:57:48 +01:00
Sundeep Mediratta
3b4e3af6fa extensionSystem: Sort extensions before loading
When an extension is disabled, we "rebase" all extensions that
were enabled afterwards, in case they override the same method.

This can be fairly expensive, in particular when disabling many
extensions at once, for instance when locking the screen.

Help with that by sorting extensions by the number of session-modes,
as extensions that support multiple modes are less likely to be
disabled on session mode changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2851>
2023-12-16 17:33:47 +00:00
Florian Müllner
38d9026bc7 lookingGlass: Set expand of DebugFlags children
Since commit c290a38730, St.Bin respects the child's
expand properties instead of basing expansion on the
alignment.

Commit b02800f8 updated a number of callers to prepare for the
change, but the "Flags" tab in looking glass was missed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3060>
2023-12-15 20:58:38 +01:00
Florian Müllner
b02800f8b5 js: Explicitly set expand of St.Bin children
Right now, St.Bin ignores the child's expand properties, and
instead expands the child if its alignment is set to FILL.

This will change when we replace the custom allocation code
with a layout manager, so to prepare for that, set the expand
property where needed to keep the expected behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>
2023-12-15 14:45:37 +00:00
Scott Buchanan
95daa577cf screenshot: Allow any enter key activate capture
We currently only consider enter/return on the main keyboard
area, but not on the numpad.

Fix that.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2777>
2023-12-14 23:39:11 +01:00
Sam Hewitt
745667a825 style: Rewrote app grid tile drawing functions
- updated mixin for tile_button
- dropped the overview_button mixin
- minor changes to dash, appDisplay and switcherPopup JS to accommodate new stylesheet
- new focus style for all tile buttons
- improved high contrast style support for app grid and dash
- renamed some style-classes
- tidied up dash stylesheet

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3017>
2023-12-14 18:30:52 +00:00
Daniel van Vugt
76dfff1012 Pass 'radius' to blur APIs instead of 'sigma'
Requires mutter!1908 first.

So now consumers of the clutter blur code don't have to know the
implementation is Gaussian and no longer need to convert the intended
blur radius to a sigma value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1905>
2023-12-14 18:20:59 +00:00
Florian Müllner
ebe1a4d303 dbusService: Exempt org.gnome.Shell from sender tracking
If an interface has any signals, we don't want to auto-shutdown
while a caller is still connected to a signal.

Unfortunately we can't tell whether there are any signal connections,
so we track all callers instead, and keep the service alive while
any of them is still on the bus.

For services that we call from gnome-shell itself - like screencasts
or extensions - this has the unintended side effect of effectively
disabling auto-shutdown.

Address this by exempting the org.gnome.Shell name from sender
tracking.

Services that we expect to keep running for the lifetime of the
shell already disable auto-shutdown, so the only downside is a
small startup delay to resolve the well-known shell name.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3052>
2023-12-13 01:27:51 +01:00
Florian Müllner
39d2988865 windowPreview: Don't hide overlay while hovering icon
We should treat the icon like we do the caption or close button,
and still consider the preview hovered when the pointer is over
the icon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3049>
2023-12-11 15:10:59 +00:00
Sam Hewitt
49c0b849c4 style: Improve text scaling support
- new drawing function to convert px to em, for select instances
- updated fontsize function to convert fonts in pt to em
- replace instances of discrete sizes with defined values
- fix instances where assets or icons did not scale along with text
- rework panel buttons to accommodate the scaling padding and icons
- new 'scalable' definitions for elements that follow text scaling

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3033>
2023-12-05 12:14:53 +00:00
Sam Hewitt
8e1241c29b popupMenu: Use less ambiguous symbols for radio options
- new checked and unchecked dot ornament assets
- updated JS with a NO_DOT ornament state, replaced instances of NONE with this

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3027>
2023-12-02 10:11:10 +00:00
Peter Hutterer
e367a2713b padOsd: Fix rings and strips event handling
JS ERROR: TypeError: event.get_pad_event_details is not a function
    vfunc_captured_event@resource:///org/gnome/shell/ui/padOsd.js:824:53
    @resource:///org/gnome/shell/ui/init.js:21:20

These were renamed in mutter@97213041e8e7

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7210

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3029>
2023-11-26 23:31:14 +00:00
Sam Hewitt
ac7ef665a1 Use dedicated assets for ctrlAltTab
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3019>
2023-11-23 13:33:08 +00:00
Florian Müllner
7f7ae31fa3 dbusServices/extensions: Only show dialog when loaded
After the port to ESM, an extension's `prefs.js` file is imported
asynchronously. An unintended side effect of that is that we now
show the dialog before anything can be added to the window (either
by the extension, or the fallback error UI).

The delay almost always won't be noticeable to users, but it's
bad practice and prevents extensions from using some API that
only works before the window is realized.

To address the issue, add a `loaded` signal to the dialog that allows
the caller to postpone showing the window until the UI is ready.

Close: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7201
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3025>
2023-11-21 22:45:40 +00:00
Charles Wong
6ff08fd9bd main: Instantiate EndSessionDialog
Using an exported `init()` function to create the object is an odd
pattern, and not having the object referenced anywhere makes it harder
to access for debugging or extensions.

Just export the `EndSessionDialog` class and instantiate it like we
do for other objects.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2997>
2023-11-21 20:19:41 +00:00
Florian Müllner
99d49f787b slider: Request a size
Sliders (and level bars) currently don't request any size, so it's
up to the caller (or stylesheet) to explicitly set a size big
enough to fit the bar/handle.

That's rather unexpected, we should request the size we need ourselves.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7133

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a6706bd2ca slider: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a639fb0fc4 barLevel: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
77a72cec1e barLevel: Stop capping border-width at 1 pixel
I can't think of a reason why limiting the border to a maximum
would make any sense.

The original intention was probably to set a minimum border width
to avoid having to deal with border/no-border complexity in the code,
but as cairo accepts a line width of 0, it just works.

However limiting the size to the overall height seems reasonable,
as at that size a bigger height and different fill color can
achieve the same effect without requires special handling of
other values like the radius.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
7a04d92bc0 status/volume: Always look up device objects
Gvc may clean its device cache after we set up the device menu,
which can lead to failed assertions when using the "old" object
to later switch the device from a callback.

Make sure this doesn't happen by looking up the ID again from
the callback.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7173
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3011>
2023-11-21 18:50:46 +00:00
Florian Müllner
f2601e6888 shellDBus: Await Eval() result
The Eval() method currently evaluates the provided string, and
returns the result immediately. This isn't useful when a promise
is returned, which has become much more likely now that accessing
any module requires import().

Simply await the result, to handle both sync and async code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3021>
2023-11-19 02:20:01 +00:00
Florian Müllner
eb8861e9b8 js: Rely on default scroll policy where appropriate
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
998d703bc2 js: Stop using {v,h}scroll properties
We only use them to access the corresponding adjustments, and
ScrollView now exposes those directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
5b84967deb lookingGlass: Don't hide scroll bar manually
The code predates the policy properties, which provide a cleaner
way of achieving the desired behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Zander Brown
d013555392 iconGrid: Use class handlers for ::child-{added,removed}
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:11:03 +00:00
Zander Brown
596efc3fa9 js: Adapt for ::child-{added,removed}
These were previously known as ::actor-{added,removed}

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:02 +00:00