595 Commits

Author SHA1 Message Date
Philip Withnall
81e7c944e7 breakManager: Clarify some nextBreakType variables
This doesn’t introduce any functional changes, as
`this._manager.currentBreakType` is set to the value returned by
`this._manager.getNextBreakDue()` when entering `BreakState.BREAK_DUE`.

However, it should make the code a little clearer as now the code refers
to the ’next’ break type rather than the ‘current’ one in the context of
an upcoming break.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
2025-04-28 15:52:14 +00:00
Philip Withnall
0547e35224 breakManager: Update manager state after settings change
The change of settings may have affected when a break is due. In
particular, `this._breakLastEnd` is modified in `_updateSettings()`,
but `this._state` is not modified correspondingly to transition to/from
a `BREAK_DUE` state (if appropriate).

This could be the cause of the `breakDueAgo should be non-negative`
assertion failure from #8280.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
2025-04-28 15:52:14 +00:00
Philip Withnall
a8fcf42197 breakManager: Make brightness setting function clearer
Confusingly, the `brightness` property of
`ClutterBrightnessContrastEffect` has type `CoglColor`, but the
`set_brightness()` setter takes a single `float`.

We previously chose to use the property setter everywhere for
consistency (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655#note_2369353),
but didn’t realise the types don’t match.

GJS optimises `this._brightnessEffect.brightness = foo` into a call to
`clutter_brightness_contrast_effect_set_brightness()`, which means the
type mismatch between the two results in a warning (see
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280).

So, let’s change from a property setter into an explicit method call to
avoid the type ambiguity, at the expense of a bit of clarity from using
the same method to set the initial value and each property animation
step.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
2025-04-28 15:52:14 +00:00
Philip Withnall
6131beead6 breakManager: Fix a potential null object dereference
There’s no `else` branch above, so it’s possible for
`this._notification` to be `null` at the bottom of the function
(especially if the user has explicitly closed the previous
notification), so handle that.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3687>
2025-04-28 15:52:14 +00:00
Philip Withnall
554af00a6d breakManager: Activate wellbeing settings on clicking notification
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8305
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3685>
2025-04-28 15:52:14 +00:00
Sebastian Keller
0e304100ab loginManager: Use signal argument to detect preparing for sleep
The DBus PreparingForSleep property on org.freedesktop.login1.Manager
does not trigger PropertyChanged signals, leading to wrong values due to
gdbus caching. In most cases it would have always been false.

Additionally it was not included in the XML interface description file
included in gnome-shell. So it was actually undefined.

Since this property is used in _calculateUserStateFromLogind() to
determine that a user is not active when closing the lid on a laptop,
the user was considered still active.

Fix this by storing the "start" argument from the PrepareForSleep signal
instead of trying to read from the property.

Fixes: 6a43b6f55 ("timeLimitsManager: Store screen time state on suspend/resume")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3679>
2025-04-28 15:52:14 +00:00
Philip Withnall
7183e75f05 timeLimitsManager: Remove a redundant fallback value
This code was originally copied from `lightbox.js`, where the fallback
is potentially useful because the duration is provided as an argument.
The `timeLimitsManager` uses a constant as the duration, though, so the
fallback is just confusing.

Spotted in https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655#note_2369352

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655>
2025-03-05 12:06:07 +00:00
Philip Withnall
5d1157cdfa breakManager: Switch from lightbox to a Clutter effect for fading out
From some testing on a full session with break reminders enabled, it
seems that it’s possible to break the stacking order of the lightbox
actor if the user continues to interact with the session while it’s
visible (for example, while they’re supposed to be taking a movement
break).

Rather than try and work out what’s going on with the lightbox here, it
seems more robust to switch to using a Clutter effect, like we did with
the screen time UI (in `timeLimitsManager`). Then the effect can be
applied to the main UI group, and doesn’t depend on a separate actor
being placed in the right place in the scene graph.

So, remove the lightbox, and instead add a
`ClutterBrightnessSaturationEffect`, and use its brightness property to
fade the screen slightly while in breaks.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3655>
2025-03-05 12:06:07 +00:00
Philip Withnall
e950697156 breakManager: Allow break to be taken or delayed when overdue
This makes the buttons on the ‘break overdue’ notification match those
on the ‘time to take a break’ notification. This makes more sense than
showing no buttons on the former, because it leads on from the ‘time to
take a break’ notification after a short wait.

By adding a ‘Take’ button it gives the user a path to acknowledge that
they are starting to take their break, rather than having to let the
session idle.

The ‘break overdue’ notification wasn’t on the original design[1], which is
probably why its buttons got overlooked.

[1]: https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3656>
2025-03-04 18:42:41 +00:00
Philip Withnall
f8024a5447 timeLimitsManager: Hold inhibitor for sleep to allow saving screen time data
This avoids the race between systemd emitting the `prepare-for-sleep`
signal, gnome-shell then starting to write the screen time data to disk,
and systemd suspending the hardware.

The race isn’t so much of an issue if the suspend succeeds (if
gnome-shell loses, the data will still get written out when the machine
resumes), but it’s slightly problematic if the machine loses power while
suspended, as that means the latest screen time data is lost.

Includes significant suggestions from Florian Müllner.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3643>
2025-03-03 15:15:25 +00:00
Philip Withnall
6a43b6f551 timeLimitsManager: Store screen time state on suspend/resume
There are two main changes in this commit:
 * Listen to the `prepare-for-sleep` signal from `LoginManager`, which
   is emitted just before suspending and just after resuming. When the
   signal is received, update the user’s screen time state (active or
   inactive), add a transition if necessary, and save the screen time
   history if necessary.
 * Factor the `preparingForSleep` property of `LoginManager` into the
   user’s screen time state, meaning that the user will be considered
   inactive between the system going for suspend and coming back from
   resume.

The rest of the changes in the commit are boilerplate to allow for this
functionality to be unit tested.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3643>
2025-03-03 15:15:24 +00:00
Philip Withnall
9dd5f7a8a8 timeLimitsManager: Fix a typo (bad encoding) in a link in a doc comment
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3643>
2025-03-03 15:15:24 +00:00
Philip Withnall
2415b4f005 loginManager: Expose systemd’s PreparingForSleep property
This will be used in upcoming commits to save the screen time state just
before the system goes to sleep.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3643>
2025-03-03 15:15:24 +00:00
Florian Müllner
c0e3dfd166 data: Add "System" default folder
The "Utilities" folder is potentially getting quite crowded,
so set up an additional "System" folder. It will be populated
in a follow-up commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3642>
2025-02-26 13:09:16 +00:00
Florian Müllner
38c6293f4f data: Generate dash/app-grid defaults from text files
Defining default apps as serialized GVariants isn't very human-friendly,
which likely contributes to the fact that the lists are in parts horribly
outdated (Books! Cheese! Screenshot! gedit!).

Instead, generate the lists at build time from simple text files, which
should be much easier to update.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3632>
2025-02-13 19:59:17 +00:00
Florian Müllner
5115236703 loginManager: Get user proxy for UID
Using the user object at `/org/freedesktop/login1/User/self` is
convenient, but has the caveat that login1 does not emit the
`PropertiesChanged` signal for the object.

That is indeed logical, as for signal emissions there is no
sender that can be used to resolve `self`.

The new TimeLimitsManager depends on change notifications for
user properties, so stop using the `self` shorthand and instead
create the User proxy for the user's UID.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8185
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3636>
2025-02-13 11:31:34 +00:00
Florian Müllner
a719b7039e loginManager: Create session proxy asynchronously
Most of the function is already asynchronous, except for the
initialization of the returned proxy. gjs' D-Bus wrapper gained
some convenience API a while ago that makes this trivial enough,
so use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3636>
2025-02-13 11:31:34 +00:00
Philip Withnall
98758c86d8 timeLimitsManager: Delete the history file if history is disabled
I forgot to include this in the first implementation, but it was always
meant to be here: when screen time data collection is disabled, the
history file should be deleted — it’s not being added to, and is just a
privacy risk.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3306
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3610>
2025-01-28 16:19:21 +00:00
Philip Withnall
11d8b9337d timeLimitsManager: Fully handle daily-limit-enabled setting
Separate out how it’s handled from the `history-enabled` setting,
allowing screen time usage data to be recorded with or without limits
being enforced.

This follows on from the previous commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3306
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3610>
2025-01-28 16:19:21 +00:00
Philip Withnall
73565e582c timeLimitsManager: Simple split of enabled setting in two
As described and motivated in
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3306, it
turns out that we want to be able to save screen time usage data while
not enabling limits based on that usage.

Bump the shell’s dependency on gsettings-desktop-schemas to get the
split setting, and roughly adapt the existing `timeLimitsManager` code
to use the new setting names. The code currently treats the two settings
as equivalent / expects them both to be set the same. The following
commits will refine that behaviour.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/3306
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3610>
2025-01-28 16:19:21 +00:00
Florian Müllner
8043714478 timeLimitsManager: Fix grayscale transition
The code currently gets the `DesaturateEffect.factor` property[0]
backwards: 1.0 means fully desaturated, not full color.

The result is that we are currently "transitioning" from 1.0 to 1.0,
that is the screen is abruptly turned to grayscale with no transition.

[0] https://mutter.gnome.org/clutter/property.DesaturateEffect.factor.html

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8160
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3606>
2025-01-27 18:58:17 +01:00
Florian Müllner
b75b4abaf0 js: Set BoxLayout orientation
Use new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Philip Withnall
4e6de4e64b timeLimitsManager: Activate wellbeing settings on clicking notification
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8161
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3604>
2025-01-21 14:46:57 +00:00
Philip Withnall
72cb52e743 timeLimitsManager: Hide ‘limit reached’ notification when reset
If the user changes their daily limit setting so that they’ve no longer
reached their limit, remove the ‘limit reached’ notification from the
message tray, if it’s still there, when disabling greyscale mode.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8164
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3603>
2025-01-20 19:05:58 +00:00
Philip Withnall
c890a2f1e3 timeLimitsManager: Reset screen time if daily limit is changed
If the limit for the day had already been reached, the
`timeLimitsManager` was not resetting the screen time state if the daily
limit setting was then changed (and increased).

Fix that, and add a unit test for it.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8164
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3603>
2025-01-20 19:05:58 +00:00
Philip Withnall
08b06acc4c timeLimitsManager: Only stop the state machine if it’s already running
This fixes a bug which happens if screen time limits are *disabled* and
the history file
(`~/.local/share/gnome-shell/session-active-history.json`) is missing
when gnome-shell is started.

If so, the code would previously have incorrectly called
`this._stopStateMachine()` on startup, even though the state machine
wasn’t running. This adds a fake transition from ACTIVE to INACTIVE to
the history file.

If the user later (that day) enables time limits, the code assumes that
they were active from the start of the day through to that fake
transition, which is possibly sufficient time to reach the user’s limit
already. This results in the screen immediately being made greyscale as
the limit has apparently been reached.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8155
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3597>
2025-01-15 17:58:15 +00:00
Philip Withnall
212e098da1 timeLimitsManager: Add new state machine for screen time limits
This implements wellbeing screen time limits in gnome-shell. It depends
on a few changes in other modules:
 - New settings schemas in gsettings-desktop-schemas
 - A settings UI in gnome-control-center
 - User documentation in gnome-user-docs

It implements the design from
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.

The core of the implementation is `TimeLimitsManager`, which is a state
machine which uses the user’s session state from logind to track how long
the user has been in an active session, in aggregate, during the day. If
this total exceeds their limit for the day, the state machine changes
state.

The user’s session activity history (basically, when they logged in and
out for the past 14 weeks) is kept in a state file in their home
directory. This is used by gnome-shell to count usage across reboots in
a single day, and in the future it will also be used to provide usage
history in gnome-control-center, so the user can visualise their
historic computer usage at a high level, for the past several weeks.

The `TimeLimitsDispatcher` is based on top of this, and controls showing
notifications and screen fades to make the user aware of whether they’ve
used the computer for too long today, as per their preferences.

Unit tests are included to check that `TimeLimitsManager` works, in
particular with its loading and storing of the history file. The unit
tests provide mock implementations of basic GLib clock functions, the
logind D-Bus proxy and `Gio.Settings` in order to test the state machine in
faster-than-real-time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

See: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/130
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3397>
2025-01-13 14:24:02 +00:00
Philip Withnall
a37d6d480b loginManager: Allow access to the D-Bus user proxy
It’s needed in an upcoming commit, to watch the user’s state
(active/online/offline/lingering/closing).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3397>
2025-01-13 14:24:01 +00:00
Florian Müllner
67c5be9c53 util: Stop special-casing trySpawnCommandLine() parse errors
Unlike for plain JS Errors, the `message` property of GLib.Errors
is read-only, so the intent to replace it with a nicer message
triggers an Error itself.

We could create a new GLib.Error with the changed message instead,
but as it turns out, none of the parse errors contain the technical
prefix we want to strip out, so we can simply drop the special-casing
altogether.

This is also consistent with `spawnCommandLine()`, which never
had special treatment of parse errors.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8146
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3593>
2025-01-12 22:43:02 +00:00
Florian Müllner
cbfcf17002 breakManager: Fix (un)inhibiting unredirection
The BreakManager is a relatively recent addition, which is probably
why commit 4034e69d0d8e1 missed it.

Fixes: 4034e69d0d ("Adapt to fixed Meta functions namespace")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3575>
2024-12-16 14:52:11 +01:00
Philip Withnall
df3b4d302d breakManager: Add new state machine for screen time/health breaks
This implements health break reminder support in gnome-shell. It depends
on a
few bits and bobs from other modules:
 - New settings schemas in gsettings-desktop-schemas (released in
   47.beta, which Mutter already depends on)
 - A settings UI in gnome-control-center
 - User documentation in gnome-user-docs

It implements the design from
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.

The core of the implementation is `BreakManager`, which is a state
machine which uses the Mutter `IdleMonitor` to track whether the user
is, or should be, in a screen time break.

The `BreakDispatcher` is based on top of this, and controls showing
notifications, countdown timers, screen fades, the lock shield, etc. to
make the user aware of upcoming or due breaks, as per their notification
preferences.

Unit tests are included to check that `BreakManager` works. These
provide mock implementations of basic GLib clock functions, the
`IdleMonitor` and `Gio.Settings` in order to test the state machine in
faster-than-real-time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

See: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/130
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
2024-11-28 10:44:10 +00:00
Bilal Elmoussaoui
715b47bddc Adapt to renamed Clutter threading functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3501>
2024-10-30 08:38:41 +01:00
Florian Müllner
74dcf99ea5 extensionSystem: Split out loadExtensionMetadata()
There is no need for sharing the functionality, but moving
the code into extensionUtils allows adding unit tests for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3379>
2024-10-16 16:16:08 +00:00
Florian Müllner
0188c453b9 extensionUtils: Include arrays and objects in serialization
We currently only handle simple types when (de)serializing,
which means we miss keys like "shell-version" and "session-modes".

While there is no immediate use for those, handing arrays and
objects will allow to support the newly added "donate" metadata
in the Extensions app in the future.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3379>
2024-10-16 16:16:08 +00:00
Bilal Elmoussaoui
aa0f2c4915 Use NULL for nick/blurb in GObject params
As they are only used by gstreamer for gst-inspect & other tools.
Projects like Mutter/gtk have completely dropped them as well, so follow
their path

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3505>
2024-10-16 10:19:41 +00:00
Alessandro Bono
27878aa096 animationUtils: Allow marking animations as required
There are cases when we want to mark an animation as required. For
example, we want the "Locate Pointer" animation to work even when
the animation is marked as disabled. Take this into account when
adjusting the animation time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2986>
2024-09-06 13:01:39 +00:00
Sundeep Mediratta
39a3da654d ibusManager: Simplify code and logic for setEngine()
Reword names, functions and refactor code to make code execution logic
simpler to understand.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3439>
2024-09-05 13:09:38 +02:00
Sundeep Mediratta
2975afaf1d ibusManager: Change return value of setCompletionEnabled()
The return value currently indicates whether the request was
successful, namely `setCompletionEnabled(false)` will return
`true` if completions were successfully disabled.

However the only caller that uses the value uses it to indicate
whether completions were enabled.

Given that nothing else uses the value, change the meaning to
match the caller, and indicate whether completions are enabled
after the call returns.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3439>
2024-09-05 13:09:38 +02:00
Sundeep Mediratta
ce89b15bb1 ibusManager: Use async await instead of callbacks
Code that uses async/await is often easier to follow than callbacks, in
particular as part of the code is already async.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3439>
2024-09-05 13:09:38 +02:00
Florian Müllner
105abab1e4 js: Remove modelines
We already include an .editorconfig that is supported by many
editors, including emacs, so no need to repeat an emacs-specific
modeline in every source file.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3431>
2024-07-30 18:20:55 +00:00
Florian Müllner
1403747863 build: Add option to disable portal-helper
The portal login window uses WebKit, which is a security-sensitive
component that not all vendors want to support.

Support that case with a build option, and update the captive
portal handler to use the user's default browser if the portal-helper
is disabled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3408>
2024-07-25 01:51:17 +00:00
Marco Trevisan (Treviño)
26e8fb90fb js: Use Shell.util_spawn_async functions to launch external processes
As explained in previous commits, it's not safe to use JS code in child
function callbacks, so let's use the safer version of it.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6698
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3293>
2024-05-24 22:48:53 +00:00
Sam Spilsbury
3d9c40783f util: Implement fixMarkup in util as opposed to messageList
We want to be able to import it in the markup unit test without
bringing in a UI dependency.

https://bugzilla.gnome.org/show_bug.cgi?id=783738

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3164>
2024-05-21 13:42:28 +00:00
Sam Spilsbury
4711f6eee4 util: Import notifyError dynamically when needed
For unit tests, it is best not to pull in UI related code.

https://bugzilla.gnome.org/show_bug.cgi?id=783738

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3164>
2024-05-21 13:42:28 +00:00
Sebastian Keller
80a37bcf53 js: Update for Gio/GioUnix split
GLib 2.79.2 split out the platform specific Gio APIs into a separate
GIRs, while still keeping a copy in the Gio GIR. gjs then added warnings
about the APIs being moved.

This bumps the Gio(Unix) version requirement to 2.79.2 and switches to
using the new GioUnix GIR.

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3892
See: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/918
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7539
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3288>
2024-04-29 16:48:07 +02:00
Florian Müllner
df50c2dfc6 cleanup: Replace deprecated String.prototype.substr()
The method is documented as deprecated:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

Switch to the non-deprecated substring() method.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3234>
2024-04-19 17:38:37 +00:00
Julian Sparber
c5ec3e45e4 components: Drop telepathy client
The telepathy client component has been unmaintained for a long time.
Now that we rework the notifications massively it's time to drop the
support for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>
2024-03-03 01:33:16 +00:00
Joan Torres
3517749537 loginManager: Add session-removed signal and getSession method
These changes will be used by the next commit when displaying a
conflicting session dialog.

session-removed signal will be used to close the conflicting session dialog
if it's not needed anymore.

getSession method will be used when a session is opened, to check if
there's already a conflicting opened session.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3134>
2024-02-29 20:42:52 +00:00
Carlos Garnacho
64d300b525 inputMethod: Honor the "private" IBusInputHint
This enum value was added in IBus 1.5.26, forward our own
"sensitive data" enum that way to the IMs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
ff063acd1f ibusManager: Avoid changes to ibus-typing-booster configuration
The ibus-typing-booster IM module is already meant to do the "right"
thing when the IBus.Capabilite.OSK hint is passed to the IM. We do
already honor that hint (commit 23bfd08b3c9), and ibus-typing-booster
has been doing this for a reasonably long time (first release seems
to be 2.19.9 dated 2 years ago, current is 2.24.12).

Drop this mangling of foreign settings, and let ibus-typing-booster
figure out the optimal configuration given the presence of an OSK.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00