8972 Commits

Author SHA1 Message Date
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
Florian Müllner
0f9c13c55d windowPreview: Set window container during construction
The container is tightly coupled with the preview, and there is
never a need to replace it at a later point. Set it directly
during construction, so the underlying base class can make
this explicit by marking the property as construct-only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Adam Williamson
4bef27d85c data: Correct Utilities category ordering, add comments
This adds a comment to make clear that the Utilities category is
intended to be organized alphabetically by the display name of
the apps (*not* by the desktop file names), and adds comments
with the current display name of each app.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3609>
2025-01-23 16:28:04 -08:00
Adam Williamson
ca136d1c62 data: List Characters and Logs in the Utilities group
These have (Logs) or previously had (Characters) the
X-GNOME-Utilities category in their .desktop file and so showed
up in the Utilities folder (despite 152faae claiming that the
category was "completely unused"). Characters had the category
removed in
https://gitlab.gnome.org/GNOME/gnome-characters/-/commit/210eb09
in apparent expectation that it would be added to the list, but
it seems it was not.

We could restore consideration of the category, but I guess let's
just list the apps instead? I don't know if any others are
missing.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3607>
2025-01-21 14:54:01 -08:00
Bilal Elmoussaoui
b3f5f9601b Go through global stage for getting ClutterBackend
Instead of using the default backend.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
fea29eb490 Get ClutterBackend/CoglContext from the Actor/Texture
Avoids going through the global backend helper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Daniel van Vugt
dee6cf3f6b panel: Ensure already destroyed panels don't receive callbacks
To prevent sporadic shutdown failures:
```
** Message: 17:08:37.707: Shutting down GNOME Shell

(gnome-shell:91892): Gjs-CRITICAL **: 17:08:37.728: Object .Gjs_ui_panel_Panel (0x5b53524fb030), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3601>
2025-01-20 16:18:37 +08: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
Sam Hewitt
eeddf49371 style: Improve the styles for the separation in quick setting buttons
- remove the highlighting js in favour of color definitions, to fix it not really working in light theme or high contrast
- add a bunch of color definitions to set the color of the menu button in the different styles
- drop the border drawing for a separator, to fix visual issues with the high border radius, in favour of a separator element
- change the class names of some things to make it understandable
- bit of overall css tidying

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3554>
2025-01-10 18:22:09 +00:00
Sam Hewitt
f9b231beb3 style: Clean up the keyboard stylesheet
- remove a lot of unused styles and deprecated class definitions
- fix the padding and spacing of subkeys popover
- fix the lack of vertical padding on word-suggestions

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3553>
2025-01-10 17:58:15 +00:00
Sam Hewitt
b73159f414 keyboard: New and updated symbolic assets
- renamed all assets to start with osk- disambiguate them from other keyboard status icons
- updated the design of hide, enter and keyboard layout icons to be more rounded
- new symbolic assets for emoji and delete actions to move away from using 16x16
- updated keyboard scss to use the scalable icon definition
- updated the zwnj asset to align with GNOME icon style
- changed all references to icons in layouts

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3555>
2025-01-10 14:22:01 +00:00
Jakub Steiner
e55820cb1f data: Ship local copy of a cog wheel icon
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8135

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3589>
2025-01-06 22:10:54 +00:00
Matthijs Velsink
1e6c92a083 status/a11y: Block 'toggled' signal when manually toggling
When the 'text-scaling-factor' key changes and it's set bigger than 1.0,
the corresponding switch is activated in the a11y menu. However, since
commit 946ee936926a0e14fa5f86f62da757bcb581a147, setting the state using
`setToggleState()` also fires the 'toggled' signal, which is I think
correct and intended.

However, that means the GSettings handler for 'text-scaling-factor'
should block that 'toggled' handler when it sets the switch active, as
otherwise the 'text-scaling-factor' is always set to 1.25 when it is
first made bigger than 1.0.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3574>
2025-01-04 22:41:47 +01:00
AsciiWolf
5057a7fe0e appDisplay: Add org.freedesktop.MalcontentControl to Utilities
malcontent-control is now a standalone app that is displayed in Shell Overview.
Let's place it in the Utilities folder instead of taking up space (and confusing users)
in the main app grid

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8124
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3579>
2025-01-04 16:09:09 +00:00
Florian Müllner
3d87782a58 status/a11y: Simplify "Large Text" toggle
It is the last user of `_buildItemExtended()`, so merge it with
`_buildFontItem()`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3576>
2025-01-04 15:42:29 +00:00
Florian Müllner
6029380267 status/a11y: Simplify switch setup
Almost all switches represent boolean settings, which means we can
use bindings instead of fiddling with signal handlers.

As menu items have a `:sensitive` property, this also deals with
handling keys' writability.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3576>
2025-01-04 15:42:29 +00:00
Florian Müllner
296e5c32e4 popupMenu: Expose SwitchItem state as GObject property
This will allow using bindings instead of explicit signal connections.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3576>
2025-01-04 15:42:29 +00:00
Florian Müllner
6dbb2eef50 popupMenu: Avoid unnecessary accessible state update in switch items
The accessible state is already updated when changing the switch state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3576>
2025-01-04 15:42:29 +00:00
Florian Müllner
3421a3825a popupMenu: Make checkAccessibleState() private
Updating the accessible state is an internal business of the
class, so making it private is more appropriate.

Besides, it was never called from outside the class since it
was added in 2012, so it's unlikely we'll ever have a use case
for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3576>
2025-01-04 15:42:29 +00:00
Florian Müllner
9b9191e858 runDialog: Require matching key-press for ESC shortcut
Both popover menus and dialogs can be dismissed with the Escape key,
however the former triggers on key press, while the latter triggers
on key release. As a result, the same key press+release can dismiss
both the command entry's context menu and the run dialog itself.

Fix this by only triggering a key shortcut when a matching key press
was recorded before, which matches how Dialog handles button shortcuts.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8132
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3585>
2025-01-04 00:29:14 +01:00
Florian Müllner
58a1e000fa animation: Use new spinner content
Change the dedicated Spinner widget to use the corresponding content
instead of subclassing AnimatedIcon with appropriate assets.

Other than the changed class hierarchy, the public API stays the
same, so the impact on callers should be minimal.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8055
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3565>
2024-12-24 15:37:20 +00:00
Michel Dänzer
60dd2cd7a8 lightbox: Use variable magnitude for dithering noise
The magnitude of the noise in the final output scales with:

 1.0 - cogl_color_out.a

A fixed value for the magnitude relative to cogl_color_out.a might be
too small for large cogl_color_out.a or too large for small
cogl_color_out.a (or possibly even both).

Compensate for this to achieve constant magnitude in the final output.
The coefficients were determined experimentally as a compromise between
preventing colour banding with dark background content and tolerable
noise with bright background content.

This helps for the issue described in
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7795 .

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3572>
2024-12-16 15:17:25 +00:00
Florian Müllner
f89276fc56 magnifier: Fix (un)inhibiting unredirection
The methods for (un)inhibiting unredirection are on the compositor,
not the display.

Fixes: 4034e69d0d ("Adapt to fixed Meta functions namespace")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3575>
2024-12-16 14:40:45 +01:00
Bilal Elmoussaoui
4034e69d0d Adapt to fixed Meta functions namespace
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3546>
2024-12-11 19:58:23 +01:00
Bilal Elmoussaoui
961075d0e4 lg: Use Clutter functions directly
Instead of the duplicated ones in Meta as they will be removed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3546>
2024-12-11 19:56:26 +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
Philip Withnall
03e3d9f435 messageTray: Add removeAction() method and allow references to actions
Internally in gnome-shell it may be useful to modify the actions
available on a notification while it’s still visible, but without
clearing them all and re-creating them.

Allow that by returning the action object when adding it, and adding a
`removeAction()` method which takes that object and removes it.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
2024-11-28 10:44:02 +00:00
Daniel Rusek
de4f1c3f9f appDisplay: Remove deprecated apps from Utilities, fix desktop file name
gnome-system-log, vinagre and gnome-dictionary were deprecated a long time ago

The gnome-abrt desktop file name was also changed a long time ago to a rDNS one

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3539>
2024-11-23 13:35:02 +00:00
Jonas Dreßler
12d2532154 keyboard: Switch back from shift to default level on more situations
If the shift key was pressed, we should switch back to the default level
after the next commit. It seems that this only worked due to a superfluous
signal emission so far (see https://gitlab.gnome.org/GNOME/mutter/-/issues/3448).

When the keyboard is in this "shift" level (note: only "shift", not
"opt+shift" level) without being latched, there are certain events that
should put it back into the default level:

- A normal character key on the OSK being pressed
- A keyval on the extended OSK (eg. TAB key or an arrow key) being pressed
- The backspace key being pressed
- The OSK being hidden
- The user moving focus in the entry

The `_updateLevelFromHints()` function already takes care of updating the
active level after certain kinds of events, we can achieve the desired
behavior by adding a fallback case to that function where it moves the level
back from "shift" to "default".

Since we only want this switch back to the "default" layer as a response to
actual user input, add a `userInputHappened` boolean to
`_updateLevelFromHints()` and don't set that when the application simply
changes its content hints.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3286>
2024-11-19 20:23:25 +01:00
Jonas Dreßler
cae8b745ca keyboard: Don't press and release keyval if it's a modifier key
Looks like we currently do the press-and-release dance for keys that specify
both a keyval and the "modifier" action. So when pressing CTRL in the
extended OSK, not only is the CTRL modifier set together with the next key
pressed, but the actual CTRL keyval quickly gets pressed and released,
similar to how we'd do it for the TAB key.

This seems unintentional, as the press-and-release behavior should probably
be specific to keys like TAB, and not apply to modifier keys, so limit that
behavior to only keys without an action specified.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3286>
2024-11-19 20:23:25 +01:00
Jonas Dreßler
91ffc4c06b keyboard: Don't check for key.action using strict equality operator
A lot of keys have no action set. In that case key.action is `undefined`,
but the strict equality check of `action !== null` here will return true and
we'll enter the if-case anyway.

That's quite confusing and was not intended like that, so change the
comparison to a less-strict operator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3286>
2024-11-19 20:23:25 +01:00
Florian Müllner
4ebc7113ab main: Make notify() details optional again
The parameter used to be optional until commit d54219c0982, but
after GObjectifaction `undefined` is no longer interchangeable
with `null` here.

Restore the old behavior, as it's used by extensions (including
one of our own templates).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8068
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3548>
2024-11-19 18:13:34 +00:00
Florian Müllner
83a8810003 status/backlight: Fix a11y label of discrete level buttons
Point the discrete level buttons to the corresponding labels,
so that they don't appear as plain "button" in screen readers.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3545>
2024-11-13 12:32:57 +00:00
Florian Müllner
64c9baf412 status/backlight: Fix keynav within discrete item
When representing the keyboard backlight levels as discrete items,
it is currently not possible to keynav past the first button.

Fix this by bypassing the usual event bubbling and passing key press
events directly to the focus manager, similar to what we do for
popup menu items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3545>
2024-11-13 12:32:57 +00:00
Lukáš Tyrychtr
685a7948a5 backlight: Allow operating the keyboard backlight slider by keyboard
Also, hide its menu item from the a11y tree, similarly to the volume and
other sliders.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3538>
2024-11-13 00:57:11 +01:00
Florian Müllner
3d560909ea status/volume: Don't show OSD when initializing
The OSD should only be shown when switching to or from headphones,
not when initializing the volume indicator during startup.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8054
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3543>
2024-11-12 11:45:23 +00:00
Florian Müllner
fbaead359a dialog: Wrap titles
Dialogs should not use titles that are too long to fit, but if
they do, wrapping is more appropriate than ellipsizing.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3540>
2024-11-12 11:21:02 +00:00
Sundeep Mediratta
69bb44563d status/volume: Show OSD volume slider on plugging unplugging headphones
OSD Volume popup appears when a user connects or disconnects
earphones/headphones/headsets.

Shows and warns the user that the volume may be set to high
or low when headphones are connected or disconnected.

This is a nice bit of feedback to the user that something has
changed, and something that other platforms do.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7931
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3531>
2024-11-11 00:28:48 +01:00
Sundeep Mediratta
9f8cb2faba status/volume: Create global showOSD() method for StreamSlider
Abstract the Volume slider OSD display as a global method in the
base class, so that can be reused in all derived classes without
duplicating code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3531>
2024-11-11 00:28:44 +01:00
Daniel Rusek
b3c16a48ca appDisplay: Fix Fonts desktop file name
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3532>
2024-11-06 19:24:44 +00:00
Bilal Elmoussaoui
d92f8daf62 magnifier: Use the new get_client_content_rect API
As we have removed is_client_decorated from Mutter in the last release.
Instead of re-adding it and re-exposing SSD/CSD differences and making
gnome-shell deal with that, we created a new API that does exactly what
is_client_decorated was used for, so switch to using that.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3522>
2024-11-06 11:03:24 +00:00
Pablo Correa Gómez
152faae6f9 data: Add X-GNOME-Shell-Utilities.directory file to allow showing real name
Instead of having the name of the directory be X-GNOME-Utilities. This
also allows translating the name to the user's language. The name is
chose to be different to X-GNOME-Utilities from GNOME Menus.

In the process, also remove the categories. The menu definition from
gnome-menus is not used, and it's not a category that apps list
themselves, so it's completely unused anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3526>
2024-11-04 20:46:29 +01:00
Bilal Elmoussaoui
fd8d923a34 Adapt to exposed CoglSnippetHook
It was exposed few cycles back, so get rid of the duplicated type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3519>
2024-10-21 12:03:23 +02:00
Lukáš Tyrychtr
3bd68fcfd7 bluetooth: When the placeholder is shown, announce it when reaching the toggle
Previously, the menu would be just empty, without any indication why.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3485>
2024-10-16 16:47:09 +00:00
Lukáš Tyrychtr
4b04fc49b5 bluetooth: Name the device items for a11y
By doing that, they're finally announced by a screen reader.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3485>
2024-10-16 16:47:09 +00:00
Sam Hewitt
8d065b558e style: Clean up dialogs stylesheet to fix layout issues
- remove unnecessary dialog type-specific padding, spacing and margin definitions that led to layout to problems
- bump the size of user avatar in authentication dialog
- nest css classes in the sass to better reflect the structure of dialog elements
- sync style of audio device selector with switcher-popup style
- sync text and padding styles with other elements
- fix incorrect button order in audio selection dialog

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7876
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3473>
2024-10-16 16:41:40 +00: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
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
Guacamolie
91a9409b1d js: Update Meta.KeyHandlerFunc arguments
The Meta keybinding API now exposes the Clutter event to GJS, which was
previously hidden due to it being a gpointer. Since this moves the
binding argument one argument to the right on the GJS side, any code
that was using the binding argument needs to be updated.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3502>
2024-10-15 17:12:45 +00:00
Florian Müllner
8694f891ad windowMenu: Add context to screenshot action
The string "Take Screenshot" is used both by the action in the
window menu and the screenshot/recording toggle in the UI.

However in some languages, it would be best to use different
strings for the two use cases.

Address this by adding context to the window menu string, so
it can be differentiated from the string in the screenshot UI.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7979
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3503>
2024-10-15 16:02:24 +00:00