3061 Commits

Author SHA1 Message Date
Bilal Elmoussaoui
084a1b3be7 plugin: Remove unused CoglContext field
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
0e92689801 Remove re-shadowed variable
Drops a call to get_default_backend

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00: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
Philip Withnall
debf00c893 main: Gracefully shut down on SIGINT as well as SIGTERM
This is mostly for use when testing a nested gnome-shell in a terminal:
terminating it with Ctrl+C from that terminal should give the process an
opportunity to save state on shutdown (such as the screen time limits
history file).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3397>
2025-01-13 14:24:02 +00:00
Philip Withnall
1ceb803686 shell: Add ShellTimeChangeSource to track system clock changes
This is a `GSource` which is dispatched when the offset of the system
real/wall clock changes with respect to the system monotonic clock. This
can happen when the user explicitly changes the system clock, or when
there’s an NTP sync after a prolonged period offline.

The source can’t tell you *what* the offset change was, just that there
was one.

This will be used in an upcoming commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3397>
2025-01-13 14:24:01 +00:00
Alberto Ruiz
46efbfb2ab build: Use python instead of perl to convert glsl source into a C string
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3578>
2025-01-04 11:24:53 +00:00
Bilal Elmoussaoui
8fbaa5e55a Adapt to split clutter/pango
In https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106, all of
the fonts rendering related bits are now behind a build option and under
a different header.

So we bail out if mutter was built without it & make sure we include the
new clutter-pango header where needed.

<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3544>

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3544>
2024-12-28 13:39:31 +01:00
Florian Müllner
9783f72d74 st/spinner-content: Add ClutterContent for a loading indicator
Last cycle, libadwaita added a new Spinner widget whose visuals
we should adapt. It loops extremely slowly though (a framerate
of 60fps would require 3180(!) frames), which means our current
asset-based implementation isn't well-suited for the job.

Instead, reimplement the underlying GdkPaintable as ClutterContent.
This does not only ensure consistency with libadwaita, but also
gives us more flexibility by picking up style information from
the widget the content is attached to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3565>
2024-12-24 15:37:20 +00: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
4980b4fce0 app-system: Mark as a final type
Also use subclassing macros

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
8d8f150685 network-agent: Mark as a final type
Also use subclassing macros

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
ab41daefcf screenshot: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
71ecb8e6cd mime-sniffer: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
791cbc7d5d mount-operation: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
910565a09a tray-manager: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
e2a7d3753f theme-node-transition: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
6ea7253322 texture-cache: Mark as a final type
It was already declared as such, so get rid of the priv boilerplate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
37282383fc st/box-layout: Remove deprecated & unused pack-start property
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3525>
2024-12-11 16:50:54 +00:00
Bilal Elmoussaoui
64d5d01360 st: Merge ClutterImage with ImageContent
ClutterImage as is, is very basic and doesn't really serve any purposes
other than being inherited by StImageContent. As we cannot easily push
ImageContent to Mutter by merging it with ClutterImage because it will
bring more GdkPixbuf usages and also because Clutter doesn't really deal
with theming bits.

Instead, merge it with StImageContent and let GNOME Shell take over from
here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3547>
2024-12-09 12:34:42 +00:00
Bilal Elmoussaoui
ea88ba687e st/image-content: Remove usage of private struct
As it is a final type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3547>
2024-12-09 12:34:42 +00:00
Georges Basile Stavracas Neto
572fe52f94 st: Adapt to paint node changes
See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4160

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3569>
2024-12-03 17:25:53 +00:00
Florian Müllner
411fe9c42f st: Fix closure annotations
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: St: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3535>
2024-11-06 14:59:43 +01:00
Bilal Elmoussaoui
715b47bddc Adapt to renamed Clutter threading functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3501>
2024-10-30 08:38:41 +01:00
Bilal Elmoussaoui
c3cd21cc16 texture-cache: Add missing cairo include
As the indirect include has been moved in Mutter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3527>
2024-10-23 22:17:10 +02:00
Florian Müllner
30f99e11c1 shell/plugin: Stop implementing plugin_info()
The hook would be optional if anything called `meta_plugin_get_info()`,
except that nothing has done so for the last ten years.

It seems a bit pointless to export information that is completely
unused, in particular as we never updated it ("version 0.1"?!),
so just stop doing that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3524>
2024-10-22 10:57:36 +00:00
Sebastian Keller
50434f0138 st/theme-node-drawing: Don't skip square top left inset shadow corners
When the inner radius of the top left corner is 0, the corresponding arc
does not get drawn, resulting in a path going from the bottom left
corner to the top right corner when the path is closed.

Fix this by always including a line_to from the bottom left to the top
left corner.

Fixes: dde13b30c ("st/theme-node-drawing: Trace the correct path for inset box shadows")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7996
2024-10-21 22:17:35 +02:00
Bilal Elmoussaoui
38cca6279c docs: Port various parts to gi-docgen annotations
So they properly show up in the docs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3518>
2024-10-21 10:25:45 +00: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
Bilal Elmoussaoui
ad0e2c940b st: Use macros to generate type boilerplate
Also mark certain types as final when they are not meant to be used
externally

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3506>
2024-10-16 17:37:43 +02:00
Bilal Elmoussaoui
31119228a8 st/focus-manager: Mark as final type
Nothing can derive this type. Also squeeze in a macro usage for cleanup

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3508>
2024-10-16 12:29:19 +00:00
Bilal Elmoussaoui
7aee2ca854 st: Remove useless HAVE_CONFIG
That doesn't exists anymore

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3507>
2024-10-16 13:50:52 +02:00
Bilal Elmoussaoui
5cbd847c84 Prefer using pragma once
Similar to what we did in mutter

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3507>
2024-10-16 13:17:45 +02: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
Bilal Elmoussaoui
9b58704c5d build: Replace cogl-pango with pango dependency
As CoglPango will be merged with Clutter and GNOME Shell
only uses Pango directly, so depend on that instead

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3494>
2024-10-02 22:54:59 +02:00
Daniel van Vugt
dde13b30c7 st/theme-node-drawing: Trace the correct path for inset box shadows
Previously we just copied the outer path and scaled it down, but that
resulted in an inconsistent thickness at the corners because the pivot
points for the arcs also moved inward.

So now we trace the inset path explicitly to maintain the correct
thickness (spread) around all the corners.

The spec actually mentions you need to do it in section 6.1 [1]:

> Note that for inner shadows, expanding the shadow (creating more
> shadow area) means contracting the shadow’s perimeter shape.

Despite the fact the example diagram gets it wrong in section 6.1.1 [2],
it does then follow with more confirmation that the shadow radius should
be reduced:

> To preserve the box’s shape when spread is applied, the corner radii
> of the shadow are also increased (decreased, for inner shadows) from
> the border-box (padding-box) radii by adding (subtracting) the spread
> distance (and flooring at zero).

[1] https://www.w3.org/TR/css-backgrounds-3/#box-shadow
[2] https://www.w3.org/TR/css-backgrounds-3/#shadow-shape

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7913
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3488>
2024-09-26 19:59:22 +08:00
Bilal Elmoussaoui
72db960a99 test/theme: Get ClutterSettings from the ClutterStage
As the global getter is now gone

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3452>
2024-08-29 13:48:42 +00:00
Florian Müllner
b7e42952dc cleanup: Remove gnome-shell-extension-prefs wrapper
After the old tool transformed into the extensions app, we added
a wrapper for compatibility with extensions that spawned the
command to open their preferences.

This was a long time ago.

As the ESM port happened since, we *know* that all extensions
are newer than that change. And as spawning the old prefs tool
is no longer accepted in review, no extension that is compatible
with current shell versions still does it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3456>
2024-08-28 21:55:16 +00:00
Bilal Elmoussaoui
ccc46d3f5c Remove text mipmapping disabling
As it is now disabled by default in CoglPango as a preparation for
merging it inside libst in the future

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3451>
2024-08-22 17:19:10 +02:00
Jonas Ådahl
deb9f05303 st/theme-node-drawing: Fix corner pipeline leak
The corner pipelines state theme node paint state was not necessarily
free of existing pipelines, so make sure to free them before looking up
new ones.

This avoids leaking thousands of CoglPipeline instances after toggling
the overview a bunch of times.

Fixes: e1868cab1a ("st/theme-node-drawing: Factor in border radius in update_resources()")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3421>
2024-08-19 11:47:32 +00:00
Bilal Elmoussaoui
31c7cf800c st/widget: Don't use notify for emitting accessibility changes
Reduces the overhead

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3433>
2024-08-08 01:07:25 +00: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
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
Bilal Elmoussaoui
2a9722cf3a Adapt to required CoglContext params
They used to retrieve it from a global variable which we are trying to
remove from mutter

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3402>
2024-07-15 12:48:36 +02:00
Jonas Ådahl
90f69dcd25 st: Setup color state on nested paint contexts
This requires plumbing the parent paint context around, to get the
current color state of the paint context.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3363>
2024-07-09 17:36:55 +00:00
Jonas Ådahl
401ba0837e st: Adapt to the paint_node() vfunc passing a paint context
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3363>
2024-07-09 17:36:55 +00:00
Jonas Ådahl
6a612e78cb st: Replace 'material' with 'pipeline'
'Material' is an old name for the same Cogl concept, but lets use the
current naming to avoid confusion.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3363>
2024-07-09 17:36:55 +00:00
Philip Withnall
976c99c5e3 shell-util: Fix a memory leak of a floating variant on error
If `params` is floating when provided by the caller, and if one of the
early return paths is taken from this function, the call into GIO never
sinks and takes ownership of the `GVariant`, and hence it’s leaked.

Always explicitly sink the input variant as soon as the function is
called, then it can’t be leaked.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3396>
2024-06-28 17:06:31 +01:00
Bilal Elmoussaoui
4c771e2da0 shell/global: Stop tracking xdisplay/input-region
Instead, let mutter do that

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3362>
2024-06-27 16:39:08 +02:00
Bilal Elmoussaoui
446bee5f1d build: Allow to disable x11
By detecting whether libmutter was built with x11 or xwayland support
and disabling relavant code paths

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3362>
2024-06-27 16:39:08 +02:00