Commit Graph

18286 Commits

Author SHA1 Message Date
Aryan Kaushik
6db55eaea6 extensions-app: Support "version-name" metadata field
The extensions site recently added support for a custom
"version-name" string in metadata:
gitlab.gnome.org/Infrastructure/extensions-web/-/merge_requests/154

This allows developers to control the version that is exposed to
users. As the version according to the developer is almost always
more relevant than the automatic version assigned by the website,
use it instead of the "version" field if set.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2995>
2023-11-30 14:10:27 +01:00
Dušan Kazik
f556699824 Update Slovak translation
(cherry picked from commit 5808dac61718f45604d3210fa6fb6b1789b37d14)
2023-11-27 13:43:14 +00:00
Peter Hutterer
e367a2713b padOsd: Fix rings and strips event handling
JS ERROR: TypeError: event.get_pad_event_details is not a function
    vfunc_captured_event@resource:///org/gnome/shell/ui/padOsd.js:824:53
    @resource:///org/gnome/shell/ui/init.js:21:20

These were renamed in mutter@97213041e8e7

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7210

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3029>
2023-11-26 23:31:14 +00:00
Sam Hewitt
ad5cffbce4 style: Fix oversights in screenshot UI css for high contrast
- fix non-working is_highcontrast if statements in drawing
- add missing hc bits for screenshot UI elements

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3030>
2023-11-24 11:05:28 -03:30
Sam Hewitt
ac7ef665a1 Use dedicated assets for ctrlAltTab
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3019>
2023-11-23 13:33:08 +00:00
Florian Müllner
7f7ae31fa3 dbusServices/extensions: Only show dialog when loaded
After the port to ESM, an extension's `prefs.js` file is imported
asynchronously. An unintended side effect of that is that we now
show the dialog before anything can be added to the window (either
by the extension, or the fallback error UI).

The delay almost always won't be noticeable to users, but it's
bad practice and prevents extensions from using some API that
only works before the window is realized.

To address the issue, add a `loaded` signal to the dialog that allows
the caller to postpone showing the window until the UI is ready.

Close: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7201
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3025>
2023-11-21 22:45:40 +00:00
Charles Wong
6ff08fd9bd main: Instantiate EndSessionDialog
Using an exported `init()` function to create the object is an odd
pattern, and not having the object referenced anywhere makes it harder
to access for debugging or extensions.

Just export the `EndSessionDialog` class and instantiate it like we
do for other objects.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2997>
2023-11-21 20:19:41 +00:00
Florian Müllner
f4c9489585 style: Stop setting slider height
Now that the slider requests a correct height, it is no longer
necessary to set it explicitly from the stylesheet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
99d49f787b slider: Request a size
Sliders (and level bars) currently don't request any size, so it's
up to the caller (or stylesheet) to explicitly set a size big
enough to fit the bar/handle.

That's rather unexpected, we should request the size we need ourselves.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a6706bd2ca slider: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a639fb0fc4 barLevel: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
77a72cec1e barLevel: Stop capping border-width at 1 pixel
I can't think of a reason why limiting the border to a maximum
would make any sense.

The original intention was probably to set a minimum border width
to avoid having to deal with border/no-border complexity in the code,
but as cairo accepts a line width of 0, it just works.

However limiting the size to the overall height seems reasonable,
as at that size a bigger height and different fill color can
achieve the same effect without requires special handling of
other values like the radius.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
7a04d92bc0 status/volume: Always look up device objects
Gvc may clean its device cache after we set up the device menu,
which can lead to failed assertions when using the "old" object
to later switch the device from a callback.

Make sure this doesn't happen by looking up the ID again from
the callback.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7173
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3011>
2023-11-21 18:50:46 +00:00
Julian Sparber
5b8347f90b st/viewport: Set adjustment properties all at once
This ensures that that property changes are notified all at the same
time and only after all were set. If we notify too early handlers
may act on a "broken" viewport.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3023>
2023-11-21 16:31:56 +01:00
Julian Sparber
78eb5f2a68 st/adjustment: Ensure changed signal emission is compressed
The docs say that `st_adjustment_set_values()` emits the `changed`
signal only once but it's actually emitted for each changed property,
this uses the `dispatch_properties_changed` vfunc to emit the `changed`
signal only per call to `st_adjustment_set_values()`. As a positive
side effect this also makes it possible to use `g_object_freeze/thaw_notify`
to compress the `changed` signal emission when using the setters for
properties.

This also fixes the wrong emission of the `changed` signal in
`st_adjustment_set_values()` when only the `value` property is changed.

Side note: the code is heavily inspired by GtkAdjustment

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3023>
2023-11-21 16:31:56 +01:00
Sabri Ünal
81f18d7ddb Update Turkish translation 2023-11-20 02:24:50 +00:00
Florian Müllner
f2601e6888 shellDBus: Await Eval() result
The Eval() method currently evaluates the provided string, and
returns the result immediately. This isn't useful when a promise
is returned, which has become much more likely now that accessing
any module requires import().

Simply await the result, to handle both sync and async code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3021>
2023-11-19 02:20:01 +00:00
Florian Müllner
eb8861e9b8 js: Rely on default scroll policy where appropriate
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
a190a0830b st/scroll-view: Change default hscrollbar-policy
It is a bit odd to have different default values for the vertical
and horizontal policy, but then that's what we almost always want in
practice: Automatic scrolling vertically, and no scrolling horizontally.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
b1cfe1732d st/scroll-view: Deprecate {v,h}scroll properties
We have better replacements now, so we'll eventually want to stop
exposing the internal scroll bar children.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
998d703bc2 js: Stop using {v,h}scroll properties
We only use them to access the corresponding adjustments, and
ScrollView now exposes those directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
a63d5b6b09 st/scroll-view-fade: Stop using {v,h}scroll properties
They are internal children of the scroll view. Instead, switch to
the dedicated APIs for accessing the adjustments directly and query
the bar offsets.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
14749744a3 st/scroll-view: Add private API to query bar offsets
The scroll fade effect is the only component that accesses the
{v,h}scroll properties for anything other than getting access
to the corresponding adjustments.

Allow the effect to get what it needs via new private API instead,
so we can deprecate and eventually remove the scroll bar properties.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
d243a9ba93 st/scroll-view: Expose adjustments as properties
The adjustments are currently only accessible indirectly via
the scroll bars. It is a bit odd to expose internal children,
and as nearly all users only access them for the adjustments,
it makes sense to expose those instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
5b84967deb lookingGlass: Don't hide scroll bar manually
The code predates the policy properties, which provide a cleaner
way of achieving the desired behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Jonas Dreßler
65e56183b1 st/scroll-view: Hide scroll bar from layout when its hidden
We hide scrollbars with POLICY_AUTOMATIC when the content of the scroll
view fits completely inside the view without having to scroll. In this case
it seems like a good idea to give the content the full available size
without subtracting scroll bars from that size.

So subtract the scroll bar from the size we give to the child only when
the scroll bar is actually visible, when it's invisible subtract 0 instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2190>
2023-11-18 12:22:51 +01:00
Jonas Dreßler
a59a992daa st/scroll-view: Allocate the scrollbars 0-size instead of not painting them
StScrollView applies the policy of whether to show or hide the scroll
bar,
and with the AUTOMATIC policy the scroll bar should be hidden as soon as
the
content of the scroll view is small enough to fit without scrolling.

Now we only know about the final size of the content when we're inside
st_scroll_view_allocate(), so that's where we can decide whether the
scroll
bar should be visible or not. Clutter really doesn't like calling
clutter_actor_show/hide() in the middle of an allocation cycle though,
so
what we do instead is saving the state into priv->vscrollbar_visible,
and
then just not painting the scroll bar based on that in a paint() vfunc
override.

This approach is not great for several reasons, it means we also have to
override pick() and finally it means the paint volume of the scroll bar
is
incorrect.

While the greatest solution to this would be to just hide/show the
scroll
bar inside the allocate() function as it is possible in gtk, we have an
established pattern for this kind of case too: We usually allocate a
0-sized
rect for the thing we want to hide, so let's do that instead.

A nice side effect is that we can conveniently drop another paint() and
pick() vfunc override.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2190>
2023-11-18 12:22:51 +01:00
Sebastian Keller
8d7dc098b1 main: Move g_setenv() calls before calls that may start threads
setenv() is not thread-safe and must happen before starting threads. The
g_setenv() calls in main() happened after meta_context_configure(),
which will start a thread via meta_profiler_new() which in its init
calls g_bus_get().

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6974
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3018>
2023-11-15 10:21:35 +01:00
Zander Brown
d013555392 iconGrid: Use class handlers for ::child-{added,removed}
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:11:03 +00:00
Zander Brown
0204920d8c st/bin: Use class handlers for ::child-{added,removed}
Now these signals are directly on ClutterActor, we can use class handlers
instead

Note we don't make the same change to StScrollView as it would clash
with the internal children.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:10:53 +00:00
Zander Brown
552f1456eb st/scroll-view: Adapt for ::child-{added,removed}
These were previously known as ::actor-{added,removed}

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:03 +00:00
Zander Brown
596efc3fa9 js: Adapt for ::child-{added,removed}
These were previously known as ::actor-{added,removed}

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:02 +00:00
Zander Brown
ab7ed393cb st: Adapt for ClutterContainer removal
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:02 +00:00
Zander Brown
f9ee0c9e45 shell/window-preview-layout: Adapt for ClutterContainer removal
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:02 +00:00
Sam Hewitt
0bc6a024be style: Improved monitor label osd
- drops OSD style for blue
- fixes #7140

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3016>
2023-11-13 15:44:32 -03:30
Sebastian Keller
ee5819f870 searchController: Use ClutterText::cursor_position instead of position
The deprecated position property has been removed in mutter commit
31849868 in favor of the otherwise identical cursor_position property.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7186
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3015>
2023-11-11 22:36:02 +01:00
Ngọc Quân Trần
7f3dad225b Update Vietnamese translation 2023-11-11 06:59:07 +00:00
Ngọc Quân Trần
b8a58564a1 Update Vietnamese translation
(cherry picked from commit cf682750c36fcbe4dad774fd016882b00c7ad1ad)
2023-11-11 06:48:04 +00:00
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
ed3b8d093e st/bin: Stop implementing a ClutterContainer
Instead we react to ::actor-{added,removed} and delegate to ClutterActor

Code should still interact with :child rather than {add,remove)_child(),
but at least we now avoid the footgun where the different APIs did
different things

Fix: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3172
Fix: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2661
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
Zander Brown
42fc986e91 st/scroll-view: Stop implementing ClutterContainer
Instead, listen to ::actor-{added,removed} allowing ClutterActor's
regular add/remove API to work as expected — at least so long only one
child is added

We also no longer inherit StBin as we actually have up to three
children (including the two scrollbars), but by implementing :child
ourselves the API seen by JS is unchanged

Fix: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2661
Fix: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3172
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Florian Müllner
b36f81b955 st: Adjust to ClutterBinAlignment removal
The custom alignment property was removed, so the convenience
constructor lost the corresponding parameters.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3013>
2023-11-10 00:29:50 +01: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
Barnabás Pőcze
3e7027821d st/texture-cache: Always close GdkPixbufLoader before disposal
As per the warning emitted when destroying without closing first

  GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed.
  You must explicitly end the data stream to the loader before dropping the last reference.

closing it is necessary.

Create the GdkPixbufLoader after loading the file contents so that
the loader is guaranteed to be closed before it is destroyed.
(`gdk_pixbuf_loader_write()` closes it on failure.)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3008>
2023-11-05 03:29:12 +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