9431 Commits

Author SHA1 Message Date
Zander Brown
a830edf8cf js: Cleanup use of StBin
StBins (inc StButton) should have their content managed via :child
rather than add_child()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
49cca32ca5 js: Cleanup usage of StScrollView
Whilst you *can* use add_actor() with ScrollView, it's more idiomatic to
work on :child

Cleanup a few extras along the way

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
c72742486f environment: Stop patching StBoxLayout
Child properties are long gone, and add() can be directly replaced with
add_child()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
350cd296fa js: Stop using ClutterContainer API
These have been long deprecated over in clutter, and (via several
vtables) simply forward the call to the equivalent ClutterActor methods

Save ourselves the hassle and just use ClutterActor methods directly

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
35cb2b5385 screenshot: Don't abuse StButton
It's an StBin, so can only have one child, yet we are adding multiple —
something we get away with by overriding allocate

Instead of doing that, move the content to it's own actor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Sebastian Keller
4722dd0d32 keyboard: Fix backspace not getting released after deleting preedit
When deleting is toggled while a preedit string is present, this causes
_toggleDelete() to use keyvalPress(). After the entire preedit string
has been deleted, _toggleDelete() will no longer hit the code path that
would call keyvalRelease() due to hasPreedit() now being false.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7171
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3009>
2023-11-08 15:01:10 +01:00
Carlos Garnacho
a93465ed69 networkAgent: Fetch environment from launch context before spawn_async()
This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>
2023-11-03 20:47:44 +00:00
Carlos Garnacho
7b1223a254 misc: Fetch environment from launch context before spawn_async()
This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>
2023-11-03 20:47:44 +00:00
Sebastian Keller
9153876764 search: Allow grid using search providers to specify maximum of results
When GridSearchResults::_getMaxDisplayedResults() is called after the
first character has been entered in the search, GridSearchResults has
no children yet. _getMaxDisplayedResults() tries to determine the
maximum number of search results based on how often the largest child
would fit into the allocated size or -1 (i.e. no limit) if there are no
children. So for the initial search there is no limit and in the app
search all matching apps get added as possible results, which due to the
search term being only a single character is almost all installed apps.
This now causes allocation to be run for all these results, despite the
vast majority of them never being visible, which on slower machines can
cause noticeable delays before the search results are displayed.

This now adds the ability for search providers to specify a maximum
number of results that gets used instead of -1 when specified. By being
provider specific this means extensions implementing their own providers
will not be affected by this.

Further this sets the maximum for the app search provider to 6 as per
the current designs.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7155
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3004>
2023-11-03 20:39:28 +00:00
Sebastian Keller
f1b7af2ab0 popupMenu: Only connect to notify::key-focus when needed
PopupMenuManager was connecting to notify::key-focus on the stage on
construction, but only ever reacting to it when one of its menus was
open. Given that every single app icon and text entry creates a
PopupMenuManager this was causing a lot of these handlers to be created.
Every single handler meant calling into JS code only for the vast
majority of them to determine that they would not do anything.

Additionally these handlers were leaked for the whole lifetime of the
stage due to never getting disconnected.

This now only connects the handler when a menu is open and disconnects
again when it is closed, significantly reducing the number of active
handlers at a time.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7143
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3001>
2023-11-03 20:33:23 +00:00
Florian Müllner
5fa08fe533 config: Add missing semicolon
The .in file isn't valid javascript, so it's excluded from eslint
and style issues like this can slip through.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3005>
2023-11-02 17:50:04 +01:00
Bilal Elmoussaoui
198dde2696 st: Stop using Clutter cairo helpers
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2808>
2023-10-25 21:35:18 +02:00
Bilal Elmoussaoui
ef9113da43 ui/environment: Add a setSourceColor helper
To simplify porting away from Clutter cairo helpers

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2808>
2023-10-25 21:35:18 +02:00
Sebastian Keller
23bcff3348 calendar: Emit selected-date-changed before rebuilding the calendar
If the cursor was placed on one of the widgets that get removed when
rebuilding the calendar due to a month change, destroying the hovered
widget will trigger a repick. This repick can then trigger an allocation
while not all buttons of the calendar are present.

If the last allocation before selected-date-changed is emitted was from
such an incomplete state, DateMenuButton will still freeze the layout in
this state in its signal handler.

What freezing the layout in DateMenuButton is supposed to do is to
prevent size changes of the menu when changing days, but for this the
layout needs to be frozen before potentially rebuilding calendar. This
change ensures that by emitting the signal earlier.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5411
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5469
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2989>
2023-10-23 01:29:12 +02:00
Alessandro Bono
1c05a64622 dash: Update comment
The dash is at the bottom of the overview now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2988>
2023-10-21 15:09:35 +00:00
Alessandro Bono
552d2172bc dash: Move item declaration on top
Otherwise it is not clear what is the item variable that we are
passing to _itemMenuStateChanged().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2988>
2023-10-21 15:09:35 +00:00
Alessandro Bono
b4676f0e9e screenShield: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use
the same path with duration 0.

Since commit ee09c5c85312f571e14abe69bb6674a361c16d65 we are sure that
duration 0 is always preserved.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
2023-10-21 15:02:55 +00:00
Alessandro Bono
46219b1101 popupMenu: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use
the same path with duration 0.

Since commit ee09c5c85312f571e14abe69bb6674a361c16d65 we are sure that
duration 0 is always preserved.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
2023-10-21 15:02:55 +00:00
Alessandro Bono
1571171a21 messageTray: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use
the same path with duration 0.

Since commit ee09c5c85312f571e14abe69bb6674a361c16d65 we are sure that
duration 0 is always preserved.

In the not animate case, we now call this._updateState(). This was not
happening before.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
2023-10-21 15:02:55 +00:00
Alessandro Bono
be49c8efc2 messageList: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use
the same path with duration 0.

Since commit ee09c5c85312f571e14abe69bb6674a361c16d65 we are sure that
duration 0 is always preserved.

In the not animate case, we now call this._actionBin.hide(). This was not
happening before.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
2023-10-21 15:02:55 +00:00
Martin Zurowietz
7d835bf455 js: Export variables and classes for Workspace Matrix extension
Most of these were "var" before the port to ESM (!1499). Here they
are exported again.

References !1499

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2978>
2023-10-21 14:04:10 +00:00
Florian Müllner
81546652c6 welcomeDialog: Adapt dialog title
Use the downstream OS info if it's available, instead of hardcoding
the GNOME release.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7026
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2962>
2023-10-18 18:40:04 +00:00
Automeris naranja
85e05ffc48 welcomeDialog: Rename "No Thanks" button label to "Skip"
"Skip" is a more accurate label for the current "No Thanks" button.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2963>
2023-10-18 14:54:32 +00:00
Sundeep Mediratta
5e6ce1cce6 workspaceAnimation: Handle DESKTOP windows
Windows of type DESKTOP are currently handled like all other sticky
windows, and stick to the monitor while the animation happens in the
background.

This behavior is odd for desktop windows, which are otherwise always
kept underneath regular windows.

Instead, make them part of the background, so they keep the expected
stacking position and animate together with the workspace.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2865>
2023-10-11 13:10:18 +02:00
Daniel van Vugt
4e2dddd18e layout: Destroy panel barrier on shutdown
It was being leaked, which is detected on mutter shutdown.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3011
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2975>
2023-10-03 15:00:45 +08:00
robert.mader@collabora.com
a94fcee961 overview: Handle unredirection in OverviewShown state machine
Under certain unknown circumstances currently not every
`disable_unredirect_for_display()` gets matched with an
`enable_unredirect_for_display()` when closing the overview.

As we only want to not disable unredirection when hidden and we nowadays
have a state machine that ensures we transition to and from one state to
another only once, handle unredirection en-/disablement as part of the
state transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2970>
2023-09-27 11:38:16 +02:00
Florian Müllner
6f7f0f369b status/system: Use Intl to format battery percentage
The exact way of formatting a percentage value is locale specific:
https://en.wikipedia.org/wiki/Percent_sign#Correct_style.

We account for that by marking the string for translations, but then
get it wrong for the default US locale (go us!).

But given that the javascript engine itself provides us with a way
of formatting a percentage in a locale-specific way, that seems the
better option than putting the burden on our own developers and
translators.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7005
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2966>
2023-09-22 17:03:17 +00:00
Carlos Garnacho
2baa298e39 slider: Ignore left/right scroll directions
Both of these ended up with a "undefined" delta, which turned
the final value into 0 no matter the previous state.

While this was already fixed for touchpads in the previous commit
(by not forwarding emulated discrete events), this looks somewhat
out of place even for the mice that have left/right discrete scroll
actions (e.g. tilting the scroll wheel left or right).

Let these unhandled directions have a delta of 0, and focus on
vertical scroll for both smooth and discrete events.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2967>
2023-09-22 17:55:12 +02:00
Carlos Garnacho
10b0e283e9 slider: Fix check for emulated scroll events
The name given by g-i is actually FLAG_POINTER_EMULATED, this
made the check slightly ineffective, handling both real and
emulated events in the case of touchpad scrolling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2967>
2023-09-22 13:29:31 +02:00
Florian Müllner
41907e9a56 extensions: Fix ngettext convenience
It is hooked up to the extension's 'gettext' function rather
than 'ngettext'.

Fixes: f59d523694 ("extensions: Add static defineTranslationFunctions() method")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2952>
2023-09-15 21:41:30 +00:00
Khalid Abu Shawarib
405b549a05 slider: Reverse handle direction in RTL
Rework slider handle to reverse directions when the slider is
Right-to-Left.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5107
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2943>
2023-09-15 20:52:14 +03:00
Khalid Abu Shawarib
c777425d39 barLevel: Reverse direction in RTL
Rework drawing and calculations to reverse the bar direction
when the bar is Right-to-Left.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2943>
2023-09-15 20:52:14 +03:00
Florian Müllner
ba46a1cf54 extensionSystem: Update immediately after major upgrades
Currently we periodically check for updated extensions, prepare
an update and perform it at the next login.

This is largely due to the fact that once an extension has been
loaded, its code is cached and reloading it would only make it
*appear* as updated, while in reality still running the old code.

Of course this only applies *once* we have loaded extensions.

Before that, it's possible to download and install updates, and
only then initialize extensions with their latest version.

The trade-off is that network requests, data download and extraction may
introduce a significant delay before extensions
are enabled. Most extensions modify the UI one way or another,
so that delay would likely be noticeable by the user.

Assuming that users are usually happy enough with the current
extension version, that trade-off doesn't seem worthwhile.

However there is an exception: After a major version update,
extensions are likely disabled as out-of-date, or at least
more likely to break (when the version check is disabled).

In that case delaying extension initialization to download
and install updates looks like the better trade-off, so do
that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2951>
2023-09-15 12:54:41 +00:00
xiaofan
050d0e10c7 ibusManager: Add missing environment variables required to launch ibus-daemon
IBus requires XAUTHORITY and XDG_RUNTIME_DIR to be able to spawn its XIM
implementation correctly. Using launch context to get environment can correctly
launch on non-systemd setups.

Closes: #6998

Signed-off-by: xiaofan <xiaofan@iscas.ac.cn>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2947>
2023-09-14 16:02:29 +00:00
Florian Müllner
ee11ecac46 main: Remove transitions from child adjustments
When commit 4d963c432b introduced the global workspace adjustment,
it mostly copied the adjustment handling from the overview that it
set out to replace.

That includes cancelling ongoing transitions when the number of
workspaces changed. However that missed that transitions don't
happen on the main adjustment, but on the "child" adjustments
returned from `createWorkspacesAdjustment()`.

Address this by tracking all child adjustments, and cancel transitions
there as well when necessary. Use weak refs to not
interfere with garbage collection, in case an extension creates
its own child adjustment.

Fixes: 4d963c432b ("main: Introduce global workspaces adjustment")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7000
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2949>
2023-09-14 16:46:31 +02:00
Hollow Man
8a5a25e6d3 js: Fix calendar scroll
Update to Clutter.Event getter methods in Clutter.Actor vfuncs
as the old way no longer works

Related to https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2872

Signed-off-by: Hollow Man <hollowman@opensuse.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2946>
2023-09-09 14:05:27 +02:00
Carlos Garnacho
bc3b890e75 keyboard: Only reset to the default level on unlocked latched levels
Reportedly, non-alphanumeric key levels were able to stick by
happenstance, and let the user press multiple keys until explicitly
switching to a different mode. Reportedly, this broke, switching to
the default level after the first key press on the additional levels.

Since we have this information in the OSK key models (each level has
a "mode" field to either default/latched/locked), retrieve this
information for them for each level, and only reset to the default
level if on one of those latched levels, and the relevant key was not
locked through long-press.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5763
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2945>
2023-09-08 19:42:38 +00:00
Carlos Garnacho
08f3ad3835 keyboard: Reset latched levels on string commit on all situations
The _commitAction() paths have early returns, which made resetting the
latched mode inconsistent depending on the paths taken to commit the
string. This made latched modes not return to normal on e.g. Shell
entries.

Make this happen outside the function, and after the only calling
point, so that the level is correctly reset on all situations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2945>
2023-09-08 19:42:38 +00:00
Florian Müllner
671df28a50 screenshot: Only handle mode-switch shortcut when supported
We currently handle the 'v' key to switch between recording- and
screenshot mode regardless of whether screen recordings are
supported.

This is clearly wrong, don't do that.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2944>
2023-09-07 18:23:29 +02:00
Florian Müllner
521525948e screenshot: Do not wrongly enable window button
The window button is disabled when
 - there are no windows
 - we are in screen-recording mode
 - the session mode doesn't allow windows

However the last condition is only taken into account when
opening the dialog, but not when switching from recording-
to screenshot mode.

Address this by updating the button's sensitivity in a separate
function, so the different conditions are considered consistently.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2944>
2023-09-07 18:23:29 +02:00
Florian Müllner
d8014090fd workspaceThumbnail: Expose maxThumbnailScale as property
Some extensions want to modify the value of the MAX_THUMBNAIL_SCALE
constant. That is no longer possible, as exports are always read-only
from the outside.

Make this possible again by exposing the scale as a property on the
object itself, so extensions can override it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2939>
2023-09-06 11:35:10 +00:00
Florian Müllner
2bc4215d1d status/backgroundApps: Filter out unknown apps
While extremely rare, flatpak apps are not guaranteed to provide
a .desktop file.

We don't have anything to represent the app in that case, but at
least we shouldn't break when trying to access properties on null,
so filter out these entries.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2938>
2023-09-05 16:06:24 +00:00
aliriza
d94f7dae1d appDisplay: Add Pardus apps to default folder list
Those are distro-specific apps like YaST on Suse.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2875>
2023-09-02 16:55:36 +00:00
Lukáš Tyrychtr
c97825e832 popupMenu: Allow to use the up and down arrows to wrap around
This aligns the keyboard navigation behavior with similar menus in
other desktop environments and with GTK itself.

It allows the users to move in the menu using already known patterns
and makes the operation quicker in some cases, especially as many
users don't know about the tab and shift+tab behavior.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2525>
2023-09-01 21:50:12 +00:00
Florian Müllner
c7208df8b3 panel: Switch workspaces when scrolling over activities
The activities button now shows workspace indicators instead
of a label. Adding the ability to switch workspaces without
entering the overview seems like a logical extension.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2933>
2023-09-01 15:07:22 +00:00
Florian Müllner
56103edc0e status/bluetooth: Show immediate feedback on toggle
Since commit 6a23e8ee0f4, we use the adapter state (that includes
transitional state) to indicate progress when a state change takes
a long time.

However on many systems, the delay happens on the rfkill side,
before a change request even reaches the adapter.

Address this by temporarily overriding the adapter-state with the
expected transitional state, until an actual adapter state change
occurs.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2815>
2023-09-01 11:37:04 +00:00
Florian Müllner
8c57eab5e6 status/bluetooth: Only show when rfkill is available
We currently show the bluetooth toggle when Bluetooth can be
toggled via rfkill, or when there is a powered adapter.

While the latter condition is obvious - if there is a working
Bluetooth adapter, then Bluetooth is available - it does impose
a problem: We rely on rfkill for turning Bluetooth off, so if
rfkill is missing, the toggle is stuck.

We could handle that case and power off the adapter ourselves
when necessary, but then the toggle would just disappear when
turned off.

Instead, only show the toggle when rfkill is available, so we
can assume that turning Bluetooth on and off will work.

This is also consistent with Settings, which shows Bluetooth
as unavailable in this case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2815>
2023-09-01 11:37:04 +00:00
Florian Müllner
f1317f07db environment: Add Meta.Rectangle compatibility
Meta.Rectangle was replaced by Mtk.Rectangle. Mutter defines a
typedef for compatibility, but it turns out that gjs fails to
pick it up.

Work around that by adding a small compatibility function
that prints a deprecation warning and returns the expected
Mtk.Rectangle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2930>
2023-08-31 22:05:32 +00:00
Florian Müllner
d9bc474dea layout: Fix missing switch to MTK
This bit was missed, probably because it uses the cairo type
instead of Meta.Rectangle.

Fixes 80237b1082
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6970

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2930>
2023-08-31 22:05:32 +00:00
Florian Müllner
8538a42943 windowMenu: Use NONE ornament by default
We now hide ornaments by default. As some of the items in the
window menu can be checked, that means that they will now shift
horizontally, and no longer align with other menu items when
checked.

That's quite bad, and as the items in question don't form a
distinctive group/section, adding back the spacing only to
those two items would still look fairly awkward.

So revert back to the previous behavior for this particular menu,
and default to the NONE ornament.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2926>
2023-08-31 21:35:23 +00:00