9936 Commits

Author SHA1 Message Date
Alessandro Bono
91ae7de3ad environment: Make more explicit what are the default values
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
961ca226bd keyboard: Replace oskCompletion setter with public method
The underlying value only changes asynchronously, which makes a
setter a bit awkward, so replace it with a public async function.

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
Thore Sommer
cdf0e5fc6e status/network: Add user permissions to new wifi connections
When creating a new NM connection they are by default system connections. A
user cannot create them if they don't have the correct polkit permissions
(org.freedesktop.NetworkManager.settings.modify.system).

If a user tried to add a new connection in the drop down menu, then they got
no password prompt and NM logged the following:
[...] audit: op="connection-add-activate" pid=1872 uid=1000 result="fail" \
reason="Insufficient privileges"

This change adds the current user to the user permissions for the new
connection, if the user has no permissions to modify the system connections,
which copies the behavior of GNOME Settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3462>
2024-09-02 21:01:35 +00:00
Alessandro Bono
5445b705f1 authPrompt: Allow to set a custom ShellUserVerifer
Move ShellUserVerifier creation to its own function so that
extensions can easily override it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7828
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3446>
2024-09-02 10:43:24 +00:00
Jonas Ådahl
6982f2daae ibus-candidate-popup: Scale coordinates from IBus
The coordinates are effectively in the windowing system coordinate
space, which when scaling Xwayland, we need to scale these. Do this with
the Meta.Window.protocol_to_stage() function on the focused window,
which handles it correctly for the corresponding windowing system and
configuration.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3458>
2024-08-30 20:14:55 +00:00
Dylan McCall
babf69f6ba quick-settings: Handle interrupted menu animations
If the menu is closed while it is being opened, we should skip the next
animation in the chain. Similarly, if a menu is opened while it is being
closed, we should continue the animation from the previous state instead
of resetting height to 0.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5843
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2481>
2024-08-28 17:25:57 -07:00
Daniel Sheeler
24cd7af920 dash: Show move cursor on app icon dnd to dash
Previously, the 'copy' drag and drop cursor was displayed when dragging
an application icon to the dash (which adds the app to favorites),
but the operation is really a move, so ensure the 'move'
dnd cursor is used.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7819
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3453>
2024-08-27 14:46:50 +00:00
Alessandro Bono
e5d9a0fec8 loginDialog: Don't assume this._user is always defined
There are cases where this._user might be null when a session
is opened. This is because the user is not selected via GDM but
it is set through PAM. This happens when logging with smart card
or with credential managers, for example.

Given the session-id of the opened session, look for the owner.
This fixes the following error:
```
gnome-shell[153293]: TypeError: this._user is null

                     Stack trace:
                     _findConflictingSession@resource:///org/gnome/shell/gdm/loginDialog.js:1219:26
                     _onSessionOpened@resource:///org/gnome/shell/gdm/loginDialog.js:1254:51
                     @resource:///org/gnome/shell/ui/init.js:21:20
```

Fixes: df84854d9 ("loginDialog: On login, allow logout a conflicting session")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7526
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3448>
2024-08-20 12:38:41 +02:00
Alessandro Bono
647747fbd6 loginDialog: Get username directly from the conflicting session
The conflicting session is owned by the same user per definition.
Use the Name property of the conflicting session to get the
username instead of assuming that `this._user` is defined and
passing the username around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3448>
2024-08-20 12:38:41 +02:00
Alessandro Bono
f1223c6852 loginDialog: Catch possible errors when session is opened
Since commit df84854d9073c457d79d7c2e6a5750428c52ff01 the function
_onSessionOpened() is now async. This means that if an error occurs
we get the following warning:
```
gnome-shell[1014]: Unhandled promise rejection. To suppress this
warning, add an error handler to your promise chain with .catch()
or a try-catch block around your await expression. Stack trace of
the failed promise:
_onSessionOpened@resource:///org/gnome/shell/gdm/loginDialog.js:1166:27 @resource:///org/gnome/shell/ui/init.js:21:20
```

Follow the suggestion and add a try-catch block in order to reveal
what the error is. In the catch phase, reset the faded AuthPrompt
otherwise we can't retry with another user.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3448>
2024-08-20 12:38:41 +02:00
Bilal Elmoussaoui
6e57d42d26 st: Adapt to Cally merge inside of Clutter
ClutterActor has now a get_accessible_type that replaces
the StWidget one, switch to using that

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3433>
2024-08-08 01:07:25 +00:00
Sam Hewitt
a32f735ec0 style: Use unlinked rounded buttons for notifications
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3427>
2024-08-02 13:37:44 -02:30
Sam Hewitt
ff4b9fdb08 style: Use unlinked rounded buttons for notifications
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3383>
2024-08-02 15:16:46 +00: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
Julian Sparber
7a874334ef overview: Drop unused ShellInfo object
This object isn't used anymore and it's really easy to create a new
system notification via the appropriate notification source.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3387>
2024-07-29 14:57:42 +00:00
Julian Sparber
ab4f80b8ae appFavorites: Display its own notification for every pin/unpin
Show a notification for each user action instead of updating the
notification currently displayed when the user pins or unpins.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3387>
2024-07-29 14:57:42 +00:00
Tuomas Nurmi
a21558d67f status/network: Fix enterprise network connecting from panel
Use the right variable. A static WirelessNetwork._securityTypes
variable does exist, but the correct variable when checking
autoconnect possibility is this._securityType; this._securityTypes
is undefined, causing clicking an enterprise network name in panel
network selector do nothing instead of properly opening GNOME
Settings panel.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3426>
2024-07-29 16:27:26 +02:00
Will Thompson
3d06134545 Make startup animation use async functions throughout
During session startup, we have the following chain:

    LayoutManager._prepareStartupAnimation()
    `- LayoutManager._startupAnimation()
       `- LayoutManager._startupAnimationComplete()       (a)
       | or
       `- LayoutManager._startupAnimationGreeter()        (b)
       | or
       `- LayoutManager._startupAnimationSession()        (c)
          `- Overview.runStartupAnimation()               (d)
             `- OverviewActor.runStartupAnimation()       (e)
                `- ControlsManager.runStartupAnimation()  (f)

Branch (b) calls LayoutManager._startupAnimationComplete() once the
animation is complete. Branch (c) does the same, except that
ControlsManager.runStartupAnimation() is an async function that awaits
LayoutManager.ensureAllocation().

LayoutManager._prepareStartupAnimation() is an `async` function, and its
caller catches & logs any error it raises.

Previously, ControlsManager.runStartupAnimation() – (f) in the above
diagram – was declared `async`, because it uses `await` internally, but
also accepted a callback, which was called on successful completion of
the function and the animation it triggers.

If an exception is raised during execution of the function, its callback
would never be called, and because the promise it implicitly returns is
discarded, the exception would never be logged either. And, stepping a
few levels up the call stack, the callback that
LayoutManager._startupAnimationSession() (c) provided would never be
called, and so LayoutManager._startupAnimationComplete() would never be
called, meaning the cover pane that prevents input would never be
removed and the session would be unusable.

Remove the callback parameter from ControlsManager.runStartupAnimation()
(f), and instead make it resolve in the case where the callback would
previously have been called.

Remove the callback parameter from OverviewActor.runStartupAnimation()
(e) – it is just a wrapper around ControlsManager.runStartupAnimation().

Adjust Overview.runStartupAnimation() (d) accordingly: rather than
passing a callback to OverviewActor.runStartupAnimation(), await its
return and then proceed. There is a slight behaviour change here:
previously, in the branch where this._syncGrab() is false, the callback
would be called before calling this.hide(), whereas now this.hide() is
called before the async function returns.

Adjust LayoutManager._startupAnimationSession() and its siblings to be
async, rather than each calling _startupAnimationComplete() directly.
Finally, in _prepareStartupAnimation()  await _startupAnimation() either
succeeding or failing, and in either case call
_startupAnimationComplete(), removing the cover pane that prevents all
input.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3428>
2024-07-28 18:49:59 +01: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
Florian Müllner
4ab1ccf3f2 status/network: Show notification when detecting captive portal
When NetworkManager detects limited connectivity, we currently
pop up the portal helper window immediately. This can both be
disruptive when it happens unexpectedly, and unnoticeable
when it happens during screen lock.

In any case, it seems better to not pop up a window without
explicit user action, so instead show a notification that
launches the portal window when activated.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7688
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3408>
2024-07-25 01:51:17 +00:00
Florian Müllner
57de9ee874 network: Split out CaptivePortalHandler class
The handling of captive portals is going to be extended a bit,
so split out a proper class instead of mixing it in with the
indicator code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3408>
2024-07-25 01:51:17 +00:00
José Relvas
44beaa0e1d screencastService: Add gstreamer pipeline for h264 low-power hw encode
VA-API low-power encoder profiles (such as vah264lpenc) reduce power consumption by relying entirely on fixed-function hardware blocks.
Use vah264lpenc over vah264enc by default, in order to save on energy and 3D engine capacity.

Signed-off-by: José Relvas <josemonsantorelvas@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3416>
2024-07-25 01:45:06 +00:00
Sebastian Wick
a65e0722f1 lookingGlass: Make it possible to export the DebugControl service
Mutter has a new tool for interacting with mutter with features we don't
expose to users yet. It can be exported as a dbus service but it is not
done so by default. This adds an easy way to do so without having to
remember some JS snippet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3425>
2024-07-24 22:33:59 +02:00
sorelz
9569239ec5 appDisplay: Use AppFolderDialog grabHelper to obtain key focus on popup()
When an app folder is opened it would do so without grabbing the
keyboard focus, so one could not navigate with the arrow keys without
pressing Tab. This adds the focus parameter to popup()'s grab, which
sets the key focus to the elements of the folder when it is opened.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
sorelz
a04b35b569 appDisplay: Use navigate_focus() to keep focus after editing app folder title
The AppFolderDialog would lose keyboard focus after editing the title
(likely due to the folder entry grabbing key focus). This commit adds
navigate_focus() to _showFolderLabel() to send key focus back to the
dialog's elements after editing the title.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
sorelz
3061589610 appDisplay: Use navigate_from_event() for keyboard focus in app folders
It wasn't possible to navigate by keyboard inside app folders due
to the focus being grabbed by the dialog. Changed vfunc_key_press_event()
to use the focus manager's navigate_from_event(), which is the same method
used by modal dialogs (also making use of the focus group already assigned
to AppFolderDialog).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6331
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3338>
2024-07-21 14:24:57 -04:00
Will Thompson
93b33cf314 overviewControls: Make sure startup animation completes
In commit e69da36095d5093c1c7bec7a9c96c079c0b837f9, Florian Müllner
wrote:

> We currently complete the animation using an onComplete handler,
> which only runs if the corresponding transition was stopped when
> finished.
>
> While it is unexpected that the transition is interrupted, it can
> apparently happen under some circumstances (like VMs with qlx).
> The consequences of that are pretty bad, mainly due to the cover
> pane that prevents input during the animation not getting removed.
>
> Address this by always completing the animation when the transition
> is stopped, regardless of whether it completed or not.

There are effectively four branches of the startup animation:

1. if Meta.is_restart() is true, no animation is run on startup; I
   believe this is the X11-only case of restarting the shell
   mid-session.
2. if Main.sessionMode.isGreeter is true, just the panel is eased onto
   the screen; this is the GDM case.
3. if Main.sessionMode.hasOverview is true, then a whole sequence of
   animations are run; this is the normal session case.
4. otherwise, the whole UI zooms in to full size, and from full
   transparency to full opacity; this is the Initial Setup case.

The fix above handles cases 2 and 4, but not 3. This patch applies the
same fix to case 3, so that the callback is always called on session
startup even if the transition is interrupted.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3422>
2024-07-19 18:57:18 +00:00
Julian Sparber
3c43983ed1 components/autorunManager: Add description to autorun notification
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3168>
2024-07-19 18:51:57 +00:00
kramo
7fa763d9cc screenshot: Capitalize file names
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3420>
2024-07-19 18:27:12 +00:00
Sam Hewitt
fc39c32324 lookingGlass: Clean up the stylesheet and improve visuals overall
- shuffle stylesheet around for readability
- change names and classes of elements to be consistent
- added style classes to window list elements so they can be styled
- make sure all elements follow OSD style even in light theme
- clean out some old styles

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7746
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3412>
2024-07-11 19:00:29 +00:00
Florian Müllner
811a4103e4 lookingGlass: Include ScrollView in inspector styling
All styling currently happens on the ScrollView child, which
means that instead of a scrollbar inside the dialog to move
the content, we have a scrollbar next to the dialog that moves
the dialog as a whole.

Fix this by simply moving the style classes to the up-most parent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3414>
2024-07-11 19:50:03 +02:00
Florian Müllner
6f2c99147c lookingGlass: Stop setting font programmatically
Instead, use CSS to request a monospace font selectively where
it makes sense (the evaluator).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7776
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3413>
2024-07-11 19:27:08 +02:00
Julian Sparber
6e0227ac3d GtkNotificationDaemon: Add ActionInvoked signal
For the notification portal we need to provide the option to use unexported
actions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3382>
2024-07-11 12:32:33 +00:00
Florian Müllner
1a12bd4f30 accessDialog: Restrict senders
Now that we no longer provide a portal implementation ourselves,
the only expected callers are the GNOME portal implementation
and (since recently) the remote desktop daemon.

Make that explicit and restrict callers to these senders, like
we do for other D-Bus APIs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3411>
2024-07-11 14:03:22 +02:00
Jonas Dreßler
ac2ed42de5 screencastService: Add gstreamer pipeline for h264 encoding on hardware
Try h264 on intel and AMD hardware using VA-API, using vapostproc
to do the color conversion using specialized hardware. We're not adding
a vaapi pipeline using the color conversion GL shader here, as vapostproc
color conversion should be better suited for anything needed by vaapi
based encoders/decoders.

A capsfilter is used to enforce the use of DMAbuf (memory:DMABuf) with
the new explicit modifier API (format=DMA_DRM).

Also, we're using the new va* gst elements instead of the vaapi* ones
here, as the vaapi* elements are deprecated, while the va* elements are
actively maintained.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2080>
2024-07-09 17:46:07 +00:00
Florian Müllner
beb34eb105 popupMenu: Center-align switches
The default align of FILL was fine with the asset-based switches,
as the image would still keep its fixed height. But after the switch
to a pure CSS implementation, the alignment now results in stretched
switches. Fix this by explicitly center-aligning the widget.

Close: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7745
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3403>
2024-06-29 21:29:32 +02:00
Sundeep Mediratta
46c74acb1b workspace: Use better window check option in existing code
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3386>
2024-06-23 15:32:28 -04:00
Sundeep Mediratta
8af8a27d91 workspace: Initialize overview windows correctly in constructor
Currently overview windows added in workspace constructor lack monitoring
the skip-taskbar property. All other windows added after this have
this monitoring.

This uses existing code to correctly add the signal and removes all redundant
code.

It also insures all transients are handled correctly on initialization using
the existing code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3386>
2024-06-23 15:32:18 -04:00
Keyu Tao
ab87629241 workspacesView: Make active workspace above siblings
If there's a window flowing over the left edge in a workspace, the
animation of showing or hiding overview in the left adjacent workspace
would glitch, as the window would appear or disappear suddenly.

This commits tries to fix it by making sure the active workspace are
above other workspaces when updating workspaces or active workspace
changed in workspacesView.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7364
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3378>
2024-06-22 03:26:31 +08:00
Florian Müllner
1bab7b32e5 barLevel: Update cached style values before chaining up
St.DrawingArea emits the `repaint` signal on style changes, so
if we chain up first, drawing still happens with the previously
cached values.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3376>
2024-06-20 14:45:55 +02:00
Daniel Ruiz de Alegría
946ee93692 switch: Make handle draggable
Listen to state changes for switch menu items, since they can also be
changed without activating them now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2717>
2024-06-20 13:30:58 +02:00
Daniel Ruiz de Alegría
71f2355b8a switch: Animate transitions
Use a constraint align instead of :x-align to animate it. Match GTK
duration.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2717>
2024-06-20 13:30:58 +02:00
Alice Mikhaylenko
cca34af31e switch: Add hover styles
Same as checkboxes.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2717>
2024-06-20 13:30:57 +02:00
Daniel Ruiz de Alegría
259eaa9bbb switch: Style switches with pure CSS
Drop hardcoded assets, have a handle actor instead, change its align to
move it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2717>
2024-06-20 13:30:57 +02:00
Alice Mikhaylenko
e75839bd5d checkBox: Reimplement styles in CSS
Stop using SVG assets other than the actual check icon. This will help
making it recolorable.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2717>
2024-06-20 13:30:57 +02:00
Bilal Elmoussaoui
0cdddaa4a7 ui/animation: Fix a de-ClutterColor fallout
Fixes: 7f0b1e98c ("cleanup: Adapt to removed ClutterColor")
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7722

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3371>
2024-06-14 19:07:30 +02:00
Alessandro Bono
258ad57b87 gdm/util: Cleanup CredentialManager on successful verification
CredentialManagers emit a user-authenticated signal with a token
upon a successful authentication. This marks the service as preempting
and will be used for the next login/unlock request. However, the
preempting service is not cleaned after a successful verification.
As a consequence, it will be picked on a second unlock request.

This doesn't happen after a succesful login request because there
is a transition from the gnome-shell process owened by GDM to the
one owned by the user.

Clean the preempting service on a successful verification, like we
do when the PAM conversation stops.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3291>
2024-06-13 21:56:36 +00:00