9616 Commits

Author SHA1 Message Date
Carlos Garnacho
b78b61a0be keyboard: Handle number/phone input purposes specifically
Add OSK keymaps for these, with the special keys necessary to
type numbers(positive, negative, fractional, ...) and phone numbers
(with */+/#)

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6550
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
32ada34e1d keyboard: Replace Keypad object with a "digits" JSON OSK keymap
Drop some code, in favor of a numeric keypad that is driven through
the same JSON-based maps. This is also a first use of the "height"
key property in the JSON files, for the Enter key.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
3f6f2f2376 keyboard: Figure out keypad visibility through purpose hints
Drop the keypad-visible KeyController signal, and figure it out
through the already notified purpose hint.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
4a4582b76c keyboard: Allow for terminal variants in specific languages
Do not hardcode the us-terminal OSK keymap, and append '-extended'
to the current group name, accounting with the existing 'us' fallback.
This allows for concerned individuals to propose language-specific
terminal layouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
0131408c0d keyboard: Keep OSK widgetry for a single group
Keep enough widgetry in memory for just the current group,
this means we more eagerly destroy and re-create actors on
language changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
35bfb4501d keyboard: Handle extended keyboards through TERMINAL input purpose
Drop the channeling of this specific signal from the InputMethod, and
update the OSK Keyboard object to using the purpose hint to find out
whether a extended keymap is necessary.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
173d70dc70 keyboard: Forward input purpose from KeyboardController
Instead of adding more emoji/keypad signals, forward the input
purpose, so that in future commits the Keyboard object can figure
out the right layout from the purpose hint.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
8673758336 keyboard: Rename function
Avoid the "ForGroup" suffix, and get the keyboard group implicitly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
9c8452269d keyboard: Minor refactor
Call the _updateKeys() method, instead of inlining it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
cfc0d42c7a keyboard: Add/document "height" optional property
This will allow OSK descriptions to declare "tall" keys. May be
used in combination with the "start" property added in previous
commits, in case a gap needs to be explicitly left.

No OSK description uses this yet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
d1aa2acef1 keyboard: Add/document "leftOffset" optional property on OSK keys
This optional property defines the offset the a key should have
relative to the previous key (on its left) or the start of the
column if it is the first key. If this property is not
present, the key will be placed with no relative offset.

This for example allows keymaps to explicitly define the padding
of the rows that are not "full" relative to other rows, without
guesswork in the code. It is used for this purpose in the
keymaps/levels/rows that needed it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
a93858b862 keyboard: Simplify key width handling
We do not need to store the key width in the Key object
itself when constructing the layout, and can attach it
to the grid from the model data right away.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Sebastian Keller
7a409bfffc keyboard: Delete selected text on backspace
Previously backspace would only ever remove a single character left of
the cursor, regardless of selection.

This requires the application to correctly set the anchor position in
text_input::set_surrounding_text(), which currently only gtk4 seems to
do. When there is no selection or on other applications that always set
cursor = anchor, like gtk3 does, the behavior is not changed and still
only deletes one character.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2746>
2024-02-29 14:56:16 +00:00
Sebastian Keller
484a237002 keyboard: Fix deleting the previous word
Since mutter@33088d59 the cursor we receive from mutter already is a
character index while the code here still treated it like a byte offset.

Further the code to detect the previous word position was treating the
cursor parameter already like a character index, while passing the
cursor that was prior to that commit a byte offset.

The function also had some unreachable and redundant code paths. The
pos < 0 case can never be reached due to the max(). Also the regex
already ensures that all whitespace is considered, so the code to remove
spaces not actually do anything except when deleting the first word in
the text, in which it would cause the first character to not get
deleted.

Also it was not handling characters with more than 2 bytes correctly. In
the presence of these JS string functions, such as search(), can not be
considered to operate on character indices anymore but rather the number
of UTF-16 byte pairs. Issues with this can be avoided by using
iterators, which unlike anything else iterate on characters, not byte
pairs and by not using the results returned by JS string functions for
anything but JS strings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2746>
2024-02-29 14:56:16 +00:00
Marco Trevisan (Treviño)
7552875dbc gdm/util: Reduce the fprintd proxy wait timeout
Given that this may lead to the shell to hang on gdm startup, and that
we expect the service to be up and running quickly, we can safely set a
5 seconds timeout instead of using the longer GLib proxy defaults.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:12:03 +01:00
Marco Trevisan (Treviño)
fa25156a6c gdm/util: Use fully async call to setup the fingerprint device proxy
Since fingerprint service can now be started also if a conversation has
already began, we can also initialize the proxy asynchronously, without
the risk that the service won't be started early enough.

As per this, remove the usage of FprintDeviceProxy wrapper completely
since it's just not giving us anything here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:12:03 +01:00
Marco Trevisan (Treviño)
ce03df5761 gdm/utils: Pass cancellable to the FPrint Device proxy and avoid signals
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:12:03 +01:00
Marco Trevisan (Treviño)
885f1391ab gdm/util: Only start fingerprint service synchronously when it's default
On ShellUserVerifier construction we used to start fprintd in a sync
fashion all the times, however in case the daemon had startup failures
or was hanging for whatever reason (like due to devices probing, given
that fprintd synchronously wait for them all to be initialized) we used
to just fail, leaving gdm or the lockscreen in a not usable state.

While this could be prevented with a try/catch statement, there's no
much point to wait for fprintd if that's not the default authentication
service, and so:
 - If we use gdm-fingerprint as default auth method, use a sync call to
   initialize it and in case of failures, just continue with fallback
   authentication mechanism (password)

 - Otherwise, asynchronously initialize fprintd and continue with the
   ShellUserVerifier without fingerprint support until we got a reply.
   In case the service fails to deliver us a result, we don't give up
   but we will try doing that at each authentication via
   _checkForFingerprintReader().
   In case all works properly, as per the previous commit, once the
   initialization is done, we'll start the fingerprint PAM gdm service.

Fixes #5168

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:12:02 +01:00
Marco Trevisan (Treviño)
efb52899f5 js/gdm/util: Rename fingerprint device into devicePath
It's just the dbus object path, so let's not be confused by that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:44 +01:00
Marco Trevisan (Treviño)
d5ca108a65 gdm/util: Start fingerprint verification once it's available
If fingerprint service is not replying fast enough to our async request,
authentication is started but the fingerprint service is never started.

So, in case the fingerprint type information is received after that the
authentication has been started, let's start the service.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:44 +01:00
Marco Trevisan (Treviño)
0d24563296 gdm/util: Do not handle fingerprint async errors in call
It's better to do this at caller level so that we have more control of
what to do on errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:44 +01:00
Marco Trevisan (Treviño)
ea3731de38 gdm/util: Only initialize fingerprint and smart card managers if needed
There's no point to initialize the fprint proxy and the smartcard
manager if they are disabled in authentication settings, so just avoid
initializing them, but at the same time this implies tracking of user
changes and so:
 - If a new service has been enabled, we initialize it
 - If a service has been disabled we destroy it and reset the
   authentication if such service was currently active

In both cases we do update the default service.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:43 +01:00
Marco Trevisan (Treviño)
9f3a9f8f2c gdm/util: Do not use gjs GDBus proxy wrapper for fprint manager
It only adds more complexity, while we can handle it all manually quite
easier now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:23 +01:00
Marco Trevisan (Treviño)
dc4f0f9053 gdm/util: Restart auth if default service changed
If a default service changed while the previous one was active we need to
reset the authentication so that we set back to the expected one.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:23 +01:00
Marco Trevisan (Treviño)
9af029e968 gdm/util: Keep track of started services that are currently active
If we have a late activation of a service backend we may need to check
whether it has been already started, and in case it has not, we can try
loading it.

So rely on gdm to see what service has been started, instead of handling
it manually on our side only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:23 +01:00
Marco Trevisan (Treviño)
f1c0f65075 gdm/util: Early initialize all internal properties
These may be used later by methods called by constructors, so ensure
that they're all defined early.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
2024-02-28 22:10:22 +01:00
Florian Müllner
290e705c89 windowMenu: Pass missing argument when starting grab op
The function now requires an additional position-hint argument.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3214>
2024-02-28 16:00:11 +00:00
Florian Müllner
be0800ea17 panel: Pass position hint when starting window drag
Since mutter@4b1e24fcc, starting a drag op requires an additional
argument, pass it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3214>
2024-02-28 16:00:11 +00:00
Julian Sparber
bb73bf548c FdoNotificationDaemon: Emit ActivationToken before ActionInvoked signal
Two years ago FDO notifications spec gained the ability to pass an
activation token (often called startup id) let's finally implement it.

See: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/b9a470004d

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/358
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3199>
2024-02-28 13:51:18 +00:00
Julian Sparber
7d6f465a47 GTKNotificationDaemon: Use ShellApp methods to activate apps
`ShellApp` gained the ability to activated actions and it sets the correct
platform data. Therefore drop the current implementation in favor for it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7409
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5239
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:35:38 +01:00
Julian Sparber
3abf7e4662 status/backgroundApps: Use ShellApp.activate_action() to quit apps
`ShellApp` gained the ability to activated actions, therefore drop the current
implementation in favor for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:28:06 +01:00
Julian Sparber
d6779f34da status/network: Use ShellApp.activate_action() to launch settings panel
`ShellApp` gained the ability to activated actions and sets the correct
platform data, therefore drop the current implementation in favor for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:28:06 +01:00
Julian Sparber
54bc3aa4f5 shell/app: Add method to activate an action via FDO DBus activation
There are multiple different places where we activate an app action,
but none set the correct activation token. Therefore this adds an async
method to to call `ActivateAction` on `org.freedesktop.Appliaction`
with the correct activation token/startup id as platform data.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:27:40 +01:00
Florian Müllner
9af81e44bc notificationDaemon: Fix auto-closing FDO notifications
We auto-close FDO notifications when the sender leaves the bus,
given that the protocol was created without persistency in mind
and any action will become invalid.

However that broke when moving the public-facing implementation
into a separate service, as we now track the (always running)
service instead of the original sender.

Fix that by forwarding the sender to the internal implementation
via a private hint, just like we already do for the PID.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3204>
2024-02-20 21:09:32 +01:00
Florian Müllner
f0b1cf5f8d notificationDaemon: Namespace private sender-pid hint
The hint is a private implementation detail between the public
and internal services, not something anybody else should set
(*cough* libnotify *cough*).

Prefix the name to hopefully make that clearer.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3204>
2024-02-20 21:09:32 +01:00
Julian Sparber
a80e0bba5c components/networkAgent: Fix small mistake
Fixes: c1ff00c01 ("notification: Use the same Source for showing system notifications")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3200>
2024-02-20 11:55:06 +01:00
Ray Strode
3dd5dcd9bb authPrompt: Disregard smartcard status changes if VERIFICATION_IN_PROGRESS
commit c8bb45b41c3a13ef161103f649aa18938e028a70 introduced a new
verification state, VERIFICATION_IN_PROGRESS, to detect when the user
has already interacted with the authentication prompt, so the
prompt can rate limit the number of times the user can cancel
authentication attempts with the escape key (without also rate limiting
the number of times they can hit escape to go back to the clock without
interacting with the prompt).

That means there are now two states that represent the user actively
undergoing verification: VERIFYING and VERIFICATION_IN_PROGRESS.

It's inappropriate to reset the smartcard service if the user is
actively conversing with it. We try to check for that by looking at the
original verification state, VERIFYING, but we unfortunately, neglect
to account for the new VERIFICATION_IN_PROGRESS state.

The result is that if a user types their smartcard pin at the clock,
and then inserts their smartcard, the pin will get cleared instead of
used, and they have to retype it again.

This commit fixes the oversight, and allows users to again pre-type
their smartcard pin at the clock before inserting their smartcard.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2765>
2024-02-17 14:04:04 +00:00
Florian Müllner
d6651706fe sessionMode: Use property spread to sync mode
The parameters here come from a fixed set of mode definitions rather
than a function parameter, so the additional check performed by
Params.parse() isn't relevant here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 12:02:25 +01:00
Florian Müllner
fe1eab1b3c cleanup: Also replace Params.parse(..., true) with spread
This is what Params.parse() boils down to when accepting extra
parameters, so we can just as well use standard syntax here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 12:02:25 +01:00
Florian Müllner
8eec7ac3f4 cleanup: Use spread properties instead of Object.assign()
It's more concise and has been around long enough to embrace it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
2024-02-17 11:53:43 +01:00
Bilal Elmoussaoui
5ce991749d lg: Replace remaining Color.init_from_4ub usage
Fixes cd33baff7d285af26475777fab1f59537c517cb5

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3197>
2024-02-17 10:46:37 +00:00
Florian Müllner
3b0e1a6b5a main: Remove timestamp parameter from popModal()
It has been unused since the move to Clutter.grab() in commit
f4cae72d17af.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
96471b9d19 main: Remove unused parameters from pushModal()
Both timestamp and options parameters have been unused since
the switch to Clutter.grab(), so remove them.

Stop using Params.parse(), so that code that still passes the
parameters doesn't throw an error.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
3f72a04a1b modalDialog: Remove timestamp parameter from open()
It is now unused.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
0ae285cc82 modalDialog: Remove onPrimary parameter
It was added in commit 48fb16b570 for the lock screen, but that
hasn't been based on ModalDialog for a long time.

It doesn't appear that anything else ever used the parameter,
so just remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
a17f4a6cb8 modalDialog: Don't pass timestamp to popModal()
Just like in the pushModal() case, the parameter doesn't do
anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
3574c5246a modalDialog: Stop passing timestamp to Main.pushModal()
Since the move to Clutter.grab() in commit f4cae72d17af6, the
parameter doesn't do anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
0432623fc8 unlockDialog: Stop passing timestamp to Main.pushModal()
Since the move to Clutter.grab() in commit f4cae72d17af6, the
parameter doesn't do anything anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Florian Müllner
fbc7290bcf appDisplay: Remove shellWorkspaceLaunch()
It was deprecated in commit 942758bb308 back in 2019.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3195>
2024-02-17 10:42:46 +00:00
Automeris naranja
e5e427a315 calendar: Add a11y label to the "Clear" button
The button that clear notifications is labeled as
"Clear". When using a screen reader, this label
doesn't provide enough context about the action
that will happen.

Fix that by adding an a11y label to this button.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3192>
2024-02-16 11:13:36 +00:00