2973 Commits

Author SHA1 Message Date
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
Bilal Elmoussaoui
19a37ed02a Remove obsolete/unnecessary includes
Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3362>
2024-06-27 16:39:08 +02:00
Jonas Ådahl
63153a0af1 tests: Stop using nested test backend
It is replaced with a new test backend that uses the native backend
running in headless mode.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3373>
2024-06-21 21:03:07 +02:00
Jonas Dreßler
e1868cab1a st/theme-node-drawing: Factor in border radius in update_resources()
The reduced border radius from st_theme_node_reduce_border_radius() depends
on the allocation size, and when it changes, has_large_corners can change.
has_large_corners is used to determine whether to pre-render using cairo,
so that means a change to the allocation size can influence whether the
pre-render using cairo should happen or not.

On changes to the allocation size we don't want to call render_resources()
though, but just update_resources() instead. And since we know now that
changes to the allocation size might cause pre-rendering to get enabled
or disabled, we need to do the "should pre-render" checks in
update_resources(), too.

So factor out those "should pre-render" checks into a new function
st_theme_node_maybe_prerender_background(), and then call that function from
both render_resources() and update_resources().

This fixes rendering artifacts with borders or rounded corners after changes
to the actor size.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6567
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3354>
2024-06-21 15:32:34 +00:00
Florian Müllner
dc6f7a1289 st/theme-node: Fix potential NULL pointer dereferences
If the new CSS functions added in commit c593aecbde3
are used wrongly, an expected argument may be missing.

The code checks for that, but only after dereferencing
it to assign the next argument. Fix that by splitting
up the checks.

Spotted by coverity.
CID: #462818
Fixes: c593aecbde ("st/theme-node: Implement extensions for accent
color")

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3380>
2024-06-21 12:31:14 +02:00
Alice Mikhaylenko
c593aecbde st/theme-node: Implement extensions for accent color
Add -st-accent-color and -st-fg-accent-color so that these colors can be
accessed from CSS.

Since they are often transformed in SCSS atm, add st-transparentize(),
st-mix(), st-lighten(), st-darken() that work in runtime.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2715>
2024-06-20 13:18:00 +00:00
Alice Mikhaylenko
1ce6193f4e st/theme-context: Expose accent color
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2715>
2024-06-20 13:18:00 +00:00
Alice Mikhaylenko
ec9217bc0d st/settings: Add :accent-color
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2715>
2024-06-20 13:18:00 +00:00
Georges Basile Stavracas Neto
a96868d1b0 st: Switch to render nodes
Switch to render nodes. Most of the changes follow the pattern of
replacing a cogl_framebuffer_draw_*() call by (1) creating a paint
node, and (2) calling the corresponding clutter_paint_node_add_*()
API.

StWidget now overrides ClutterActor.paint_node(), instead of paint.
All subclasses that overrided the paint vfunc also are changed to
override paint_node.

The entry point for CSS rendering, st_widget_paint_background(), now
receives a root ClutterPaintNode, and propagates it to the rendering
machinery.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1538>
2024-06-18 16:59:38 +02:00
Bilal Elmoussaoui
7f0b1e98cf cleanup: Adapt to removed ClutterColor
It was replaced by CoglColor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3142>
2024-06-13 18:29:13 +00:00
Florian Müllner
55027bb084 shell/app: Remove some dead code
`g_desktop_app_info_launch_uris_as_manager_with_fds()` was added
in GIO 2.57.2. We now depend on at least 2.79.2, so we no longer
need a fallback path for the case the function isn't available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3361>
2024-06-13 18:21:01 +00:00
Bilal Elmoussaoui
f155eb7576 tests: Adapt to Clutter.Color.to_pixel removal
By using the to_string representation instead

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367>
2024-06-12 16:09:43 +00:00
Bilal Elmoussaoui
cbf1d372f1 shell/screenshot: Don't use region type where rect is enough
New API added in
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3801

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3366>
2024-06-11 01:12:00 +02:00
Marco Trevisan (Treviño)
9abad7f25f shell-util: Pass the mutter context to the spawn child setup function
This was the type the function expected, but we were actually passing
the global context to it.

This didn't crash for some reason, but indeed it was wrong and we didn't
catch it because mutter side had not type-checks either

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3355>
2024-05-31 16:46:14 +02:00
Philip Withnall
37e49e8a22 shell-camera-monitor: Fix warning about strict aliasing
Changing type when casting a double pointer is not strictly allowed in
C. In order to fix compilation with `-fstrict-aliasing`, don’t use
`g_clear_pointer()` for clearing this pointer where the type expected by
the destroy notify function does not match the type stored in the
`ShellCameraMonitor` struct.

This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3351>
2024-05-28 17:39:46 +00:00
Georges Basile Stavracas Neto
4e449536f8 st/scroll-view-fade: Cleanup unecessary vfunc override
It does exactly what ClutterOffscreenEffect does these days.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3347>
2024-05-26 15:55:56 +02:00
Bilal Elmoussaoui
37fd461759 build: Make use of the x11 dependency
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3344>
2024-05-25 10:29:28 +02:00
Bilal Elmoussaoui
c0c4572ed5 build: Remove unnused dependencies
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3344>
2024-05-25 10:28:51 +02:00
Marco Trevisan (Treviño)
781010be66 shell-util: Add async-signal-safe wrappers for GLib.spawn_async implementations
In the shell code we often use GLib.spawn_async to launch processes
with a GSpawnChildSetupFunc implementation in JavaScript to reset the
mutter nofile rlimit in the new child process.

However, this is highly unsafe to do because this implies that the child
setup function code is executed in gjs where a lot of allocations are
done and even more not-async-signal-safe code is executed, in fact
leading to dead-locks as reported in the past.

To prevent this, declare a new functions that do the same of the GLib
counterpart but without providing a GSpawnChildSetupFunc that is instead
implemented in the C-side doing the cleanup that mutter requires without
allocations or async-signal-unsafe code.

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6698
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3293>
2024-05-24 22:48:53 +00:00
Marco Trevisan (Treviño)
dcb5956dea shell-app: Do not allocate memory during GSpawnChildSetupFunc
The child context setup function used as launch GSpawnChildSetupFunc
uses g_object_get that internally potentially allocates memory, making
it not async-signal-safe and so not something that is safe to use in
between fork and exec, so just use the simpler getter here.

Note that the current implementation of app_child_setup() is safe
already as sd_journal_stream_fd, dup2 and close are so.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3293>
2024-05-24 22:48:53 +00:00
Florian Müllner
1fcdc60ca0 tests: Drop wrapper script for unit test runner
We build a small run-js-test executable so tests run in a
similar environment as gnome-shell, and then wrap it with
a generated script that provides environment variables like
GI_TYPELIB_PATH.

This is more complicated than it needs to be, we can just as
well set up the typelib search path from the runner and pass
in the environment via meson.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3164>
2024-05-21 13:42:28 +00:00
Florian Müllner
3220005eea croco: Remove unused and dodgy function
The function creates a parser object that is never used nor
freed, then always returns NULL.

Luckily it's unused, so just remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3321>
2024-05-20 13:42:11 +00:00
Florian Müllner
56cc755bf6 st/icon: Add :is-symbolic property
It can be useful to know whether an icon displays a symbolic (rather
than just requesting it). Add a new :is-symbolic property for that
purpose, backed by private API on StImageContent that allows the
texture cache to shuffle that information through to the icon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3296>
2024-05-09 17:47:32 +00:00
Marco Trevisan (Treviño)
794acd65a8 na-tray-child: Use absolute icon position as root event coordinates
Currently we're using relative positioning when sending click events to
tray icon clients, and this leads to some apps (especially Qt ones) to
try to open the menus at such absolute coordinate under X11.

To prevent this to happen, let's get the root coordinate from the xembed
and let's use it to compute the synthetic event root x/y.

We could have even used the actual event position for this, but getting
it from the xembed makes this more consistent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3283>
2024-04-29 16:50:13 +00:00
pesader
72208da0c2 shell/window-tracker: Update docs on chromium shortcuts
The format of the .desktop file names and their StartupWMClass of
Chromium and Chrome shortcuts has changed, so update the docs to match
the most recent versions of these web browsers.

The user interface to create shortcuts has also changed. They are no
longer created through a "Tools" menu (which doesn't exist anymore), but
rather through a "Save and share" menu. So add that to the docs as well.

Finally, replace the examples using the GNOME Wiki with examples using
the new GNOME Developer Handbook.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7482
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3289>
2024-04-29 12:18:52 +00:00
Jamie Gravendeel
448df5c58e general: Remove periods from single sentences
This is done to align with the HIG rule about periods in single sentence
strings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3280>
2024-04-24 13:58:01 +02:00
Sebastian Wick
b3580919e3 shell-util: Only use systemd if gnome-shell is managed by systemd
Simply looking at the return value of sd_pid_get_user_unit can be used
to determine if the process is in a systemd unit, but it doesn't say if
gnome-shell is managed by systemd.

For example, running toolbx on a host with systemd creates a libpod
unit, even if the gnome-shell that gets started in the toolbx is itself
not managed by systemd.

We can make sure that gnome-shell is managed by systemd simply by
checking if the unit we're running starts with org.gnome.Shell.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3267>
2024-04-22 23:11:06 +00:00
Sebastian Wick
0586158389 st/clipboard: Pass non-NULL mimetype to SelectionSourceMemory
meta_selection_source_memory_new previously had some precondition checks
which would return NULL if the mimetype is NULL but now that it returns
an error we can't do that anymore.

Move the precondition checks to the caller instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3260>
2024-04-19 13:45:40 +00:00
Yotam Bar-On
77af504930 st/clipboard: Check for errors when creating MetaSelectionSourceMemory
depends on !3551

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3161>
2024-03-08 18:45:25 +01:00
Julian Sparber
90e9f56f79 shell/global: Don't force active workspace for launch context
Since the launch context may also be used to activate an action on an
running application with an already existing window, which we don't
necessarily want to move to a different workspace, don't set a workspace
for the launch context. If no active window exists for an application
then it will be place on the currently active workspace anyways.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:28:06 +01:00
Julian Sparber
54bc3aa4f5 shell/app: Add method to activate an action via FDO DBus activation
There are multiple different places where we activate an app action,
but none set the correct activation token. Therefore this adds an async
method to to call `ActivateAction` on `org.freedesktop.Appliaction`
with the correct activation token/startup id as platform data.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>
2024-02-28 11:27:40 +01:00
Florian Müllner
a1dd5d5e1e shell: Remove left-over function declaration
The function itself was removed in commit 4b80cbe1cd9e back
in 2016.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3206>
2024-02-21 16:10:40 +01:00
Bilal Elmoussaoui
8b6e1fe896 plugin: Stop overriding xevent_filter
The vfunc was used to register profiling hooks for glx.swapComplete
as we have sysprof nowadays and as that code path is x11 specific
anyways, let us drop it

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3201>
2024-02-20 13:51:30 +00:00
Bilal Elmoussaoui
cd33baff7d cleanup: Prefer CoglColor.init_form_4f
As we are slowly moving colors to be represented by a [0, 1] floats.
The unsigned integer variant will likely be removed in the near future, so be
ready for that already

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3147>
2024-02-16 12:34:30 +01:00
Bilal Elmoussaoui
43d4a12576 cleanup: Adapt to removal of CoglPipeline.set_color_*
Associated Mutter PR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3553

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3147>
2024-02-16 12:34:30 +01:00
Florian Müllner
8f2ab674fc st/drawing-actor: Queue redraw when repainting
Commit e7734e30bd removed the clutter_content_invalidate() call
that took care of queuing a redraw for us. Now that we no
longer delegate to a content we have to do that ourselves.

Fixes: e7734e30bd ("st/drawing-area: Merge ClutterCanvas to StDrawingArea")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7397
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3190>
2024-02-14 00:04:20 +01:00
Carlos Garnacho
14db121ce5 st: Adapt to ClutterGrab becoming a GObject
Change the unref function, since it's no longer a boxed type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3028>
2024-02-13 11:49:28 +00:00
Bilal Elmoussaoui
2dc0f48a22 window tracker: Adapt to renamed function
Ideally, the use case we have for MetaGroup would be removed but that
requires investigation that could be done as a future step

The function also expects a MetaWindowX11, so add a check to ensure
we don't crash at runtime if the function gets called on a wayland
client

Also removes an unused header import

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3157>
2024-02-08 16:45:06 +01:00
Julian Sparber
7b5da30f21 st/button: Fix small mistake in st_button_toggle_mode docs
When the toggle mode is enabled the checked state will be changed not
the active state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3172>
2024-02-08 10:27:03 +01:00