18795 Commits

Author SHA1 Message Date
Florian Müllner
f302c4b494 data: Replace wiki reference in gschema
We now document looking glass in-tree, so point to that.

https://gitlab.gnome.org/GNOME/Initiatives/-/issues/51

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3215>
2024-02-29 16:59:10 +00:00
Philipp Kiemle
53e160be5d Update German translation 2024-02-29 16:42:49 +00:00
Carlos Garnacho
8164877997 keyboard: Add "url" keyboard for URL typing
This is basically an english keyboard, with some helper
keys to help typing URLs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
391b0d4ef3 keyboard: Add "email" OSK variant for EMAIL purpose hint
Not too fancy at the moment, just an "us" keymap, with the emoji
key replaced by '@'. Can be improved in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
7db0e01b24 keyboard: Forward/handle content hints
Forward these from the IM, and handle the ones involving
the OSK state: lowercase/uppercase/auto_capitalization/titlecase.
The latter two involve peeking at the surrounding text, to figure
out if it makes sense to toggle keyboard level.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01: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
Carlos Garnacho
741355e2cd keyboard: Refactor 'commit' action handling
Move the complex parts of this mechanism from the Keyboard object
to the KeyboardController object, replaced by code that is easier to
follow.

Also, keyval guessing is deferred to a later point in the commit
procedure so so it does not happen for a single character only,
this way we can send multi-character input through the IM, which
is necessary for some OSK layouts.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7190
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
f0b18c9ccc keyboard: Separate keyval action notification
Add a distinct signal for keys defining a keyval to have it handled
via event emulation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
4d71d9f46d keyboard: Support OSK layout modes explicitly
We only support "latched" which stays toggled on for a single
character unless long-pressed. Support "default" mode explicitly
to switch back to the default level, leaving "locked" implicitly
supported as the way to stay in the same level.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
81670e1543 keyboard: Close keyboard immediately on Clutter.InputPanelState.OFF
This is already covered by a timeout to handle focus transitions between
windows at the Clutter.InputMethod implementation, we can react immediately
and avoid chaining up timeouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
d917661ce8 keyboard: Close keyboard immediately on user interaction
When the user presses the hide button, the rest timeout feels
like lag in that case. Avoid it in that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
542263601b keyboard: Make emoji "hide keyboard" key icon consistent
It was stuck with an older icon, we've gained a specific icon
for this action since.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
9a340c6d66 keyboard: Simplify KeyContainer
We no longer have any guesswork during layout creation,
we can attach key actors directly to the grid without a second
step.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:22 +01:00
Carlos Garnacho
6e80f858c8 keyboard: Move backspace key handling to KeyboardController
Move the more action-y code to the controller, and let the Keyboard
object command it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:42:20 +01:00
Carlos Garnacho
f3c26ae17f keyboard: Minor refactor
This small function is just called from a single place,
drop it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
834be93666 keyboard: Drop dead code
This getGroups() method was not called anywhere for
a long time, the last user was dropped at commit
8fdf47ea5b ("keyboard: Do not create widgetry for
all keyboard groups at once").

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
c6d2f7d6c4 keyboard: Simplify group change emission at KeyboardController
Since we now just store the current group, we do not need to track
closely source changes vs selection changes in the available sources.
We just re-generate the current OSK keymap for all, so coalesce both
signals into a more generic "group-changed".

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
50e8203ce7 keyboard: Honor emoji-visible through input hints
And fix it so it is effective again. This is a small piece of
smarts the code needs to earn, so that keys with the "emoji"
action are hidden, and their width assigned to the next key.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
Carlos Garnacho
99ab1988d2 keyboard: Refer to levels by name instead of index
And drop some more guesswork in the code, since some layouts have
less than 4 levels. This also allows for having OSK maps with more
than 4 levels. Let us hope that the sanity of our future kin will
remain below that threshold.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
2024-02-29 16:34:21 +01:00
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
Daniel van Vugt
d09509b2cb theme: Don't give login-dialog another background-color
Its parent `lockDialogGroup` has exactly the same background-color
set in the same file. Giving them both the same wasted render time on
overdraw, and caused multi-layer blending artifacts (slight flickering
of the grey background) when the login dialog fades in/out.

While the flicker can also be fixed using `set_offscreen_redirect`,
there's no point adding that overhead when the extra layer doesn't need
to be painted. Removing it halves the average render time of the login
animation.

Closes: https://bugs.launchpad.net/bugs/2036388
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3207>
2024-02-28 14:55:39 +00:00
Sam Hewitt
e46b137b42 style: Restore missing insensitive menuitem style
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3213>
2024-02-28 14:38:27 +00:00