1
0
Fork 0
Commit graph

32609 commits

Author SHA1 Message Date
Jonas Ådahl
e994fbf02c wayland/pointer-constraints: Warp pointer before destroying resource
We're retrieving the context from the constraint instance, and the
wl_resource_destroy() call indirectly destroys the instance, so warp
earlier to still have a valid instance while warping.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3649
Fixes: 6a694d64f4 ("wayland/seat: Keep a back pointer to the ClutterSeat")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4003>
2024-09-04 08:58:05 +00:00
Fran Dieguez
58495ad208 Update Galician translation 2024-09-04 06:30:41 +00:00
José Expósito
cf5508bdeb onscreen/native: Return the correct number of EGL modifiers
g_array_sized_new() creates a new GArray with a preallocated size, but,
after creation, the array length is still zero [1].

Store the modifiers in a EGLuint64KHR array and use g_array_new_take()
to create a new GArray with the correct size.

Because no modifiers were returned, gbm_surface_create() was used
instead gbm_surface_create_with_modifiers() on multi-GPU setups.

[1] https://docs.gtk.org/glib/type_func.Array.sized_new.html

Fixes: aec85281ba ("native/renderer: Retrieve the right modifiers set for each GPU")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3998>
2024-09-03 16:38:09 +00:00
Daniel
03d00902fe Updated Spanish translation 2024-09-03 11:22:35 +02:00
Sebastian Wick
b20e0370aa wayland/color-management: Handle inert feedback surfaces
When a surface is destroyed, the existing feedback surfaces are marked
as inert by setting the wl_resource user_data to NULL. This wasn't
handled in the feedback surface destructor.

Fixes: 2341346c90 ("wayland: Implement the color management protocol v4")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4000>
2024-09-02 21:56:19 +00:00
Peter Hutterer
e4004a7c4f wayland: Use the tool's current_tablet device instead of caching it
The tablet tool is initialized with a device but if that device is later
removed we never update tool->device. This eventually causes a crash
when we're passing that device into
meta_wayland_input_invalidate_focus().

The tool keeps track of the current tablet anyway so instead of caching
this pointer in the tool, use the current tablet's device.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3642
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3959>
2024-09-02 21:12:56 +00:00
Jonas Ådahl
2d64965a55 window/xwayland: Handle arithmetics close to the int limits
`(int) (1.0f * (float) INT_MAX)` doesn't necessarily result in INT_MAX
due to how floating point arithmetics. Handle this better by setting
INT_MIN/MAX explicitly, when the floating point value post scaling
exceeds the corresponding limit.

This fixes resizing of electron windows.

Fixes: 6e8c7c5f84 ("Add experimental mode to use native scaling of Xwayland clients")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3997>
2024-09-02 19:50:20 +00:00
Florian Müllner
b0e90c6523 build: Don't override prefix
Meson variables don't have a scope, so using `prefix` in a loop
for D-Bus interface prefixes actually overshadows the global
variable that holds the build prefix.

As far as I can tell, the only place where the "wrong" value is
read is the build summary, but let's not tempt fate and fix it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3995>
2024-09-02 01:07:39 +02:00
Florian Müllner
6f9981d36a
Bump version to 47.rc
Update NEWS.
2024-09-01 13:05:59 +02:00
Sebastian Keller
898d802c5e xwayland: Fix XRROutputInfo leak when setting primary output
The call to XRRFreeOutputInfo() seems to have been accidentally dropped.

Fixes: 1333d92fa ("xwayland: Set primary monitor using connector name")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3994>
2024-09-01 11:33:32 +02:00
Sebastian Keller
d1a1b7bfdd window-actor/x11: Fix region leak when updating frame bounds
The value returned by meta_frame_get_frame_bounds() is owned by the
caller so we can assign it directly without copying to avoid a leak and
a bit of unnecessary work. Also it can't ever return NULL, so there is
no need to check for that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3994>
2024-09-01 11:29:12 +02:00
Jonas Ådahl
cddd3a7df0 x11-display: Use X11 UI scaling factor for cursor theme size
As with Xsettings, we want to use the X11 UI scaling factor to set the
cursor size, so that clients use a larger theme, both when using
`native-xwayland-scaling` and a physical layout mode.

Fixes: 6e8c7c5f84 ("Add experimental mode to use native scaling of Xwayland clients")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3992>
2024-08-31 23:28:27 +00:00
Jonas Ådahl
babafe01fc x11-display: Use the X11 UI scaling factor for Xsettings
This makes Xsettings tell clients to be HiDPI again, when using the
physical layout mode.

Fixes: 6e8c7c5f84 ("Add experimental mode to use native scaling of Xwayland clients")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3992>
2024-08-31 23:28:27 +00:00
Jonas Ådahl
9d83d67fde xwayland: Add helper to get X11 UI scaling factor
This is different from MetaSetting's UI scaling factor, and different
from the effective Xwayland scale.

The MetaSetting's UI scaling factor is the scaling factor used by
gnome-shell chrome itself.

The effective Xwayland scale is, with `native-xwayland-scaling` enabled,
the scale everything X11 is scaled with.

The X11 UI scaling factor is intended to be the scaling factor X11
clients are told to use, and how to derive that differs depending on the
layout mode and the effective Xwayland scale.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3992>
2024-08-31 23:28:27 +00:00
Bilal Elmoussaoui
736082f41a clutter/input-pointer: Get context from seat
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
0c03a6b676 clutter/seat: Keep a pointer to the context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
6a694d64f4 wayland/seat: Keep a back pointer to the ClutterSeat
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
ea902ac928 compositor: Require a context when creating a texture mipmap
avoids going through globals

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
0c7019a092 x11/shadow-factory: Get CoglContext from the window actor
As the shadow factory is now private

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
770fbb71f3 compositor: Pass CoglContext to create_texture helper
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
b83385e911 x11/cursor-sprite: Get ClutterBackend from MetaBackend
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
0c226e046c compositor/shaped-texture: Get ClutterBackend from Context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
3c1d2d765b clutter/offscreen-effect: Pass a CoglContext to create_texture
As creating a texture requires one anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
a80360ad38 clutter/stage: Remove unused title property
It was used for the titlebar title, which is no longer relavant
in current Clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
2dc2ab94d3 clutter/backend: Remove unused vfuncs
The signals are still used by Actor/Text

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Sebastian Keller
2eddf35625 cogl/trace: Fix build without profiler
When !3952 introduced the new tracing macros, they were only defined in
the HAVE_PROFILER case, causing builds without profiler support to fail.

Also it introduced an unconditional call to cogl_is_tracing_enabled()
which is not available without HAVE_PROFILER.

Fixes: 777c63507 ("cogl/trace: Allow defining and setting sysprof trace counters")
Fixes: 322ac42a6 ("stage-impl: Trace the damage region")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3991>
2024-08-31 18:47:32 +02:00
Jonas Ådahl
7c7e147fd2 display-config: Add HasExternalMonitor property
This aims to replace gnome-setting-daemon manually trying to figure this
state out, currently via libgnome-rr.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:19:16 +02:00
Jonas Ådahl
cc0ec14712 monitor-manager: Add new backlight D-Bus API
It is intended to replace using GetResources() and ChangeBacklight().

It moves from a normalized 1-100 numbers, to directly exposing the
hardware. This more closely maps to how gsd-backlight.c in
gnome-settings-daemon normally works, and simplifies the API a bit to
not have to deal with rounding issues.

There is still no KMS uAPI for this, so it still only hooks up to
XRANDR. Being private API, it doesn't try very hard to predict how the
KMS uAPI will look. When that day comes, it will likely need some
adaptations.

Part of the motivation here is to get something for gsd-backlight.c to
use where it can work more similarly to how the current common case
(sysefs) works, while attempting to migrate away from libgnome-rr.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:19:16 +02:00
Jonas Ådahl
332c4a1bf0 tests: Add backlight sanity test
It currently sanity checks the MetaOutput and MetaMonitor APIs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:06:33 +02:00
Jonas Ådahl
c22816393c monitor: Add backlight abstraction
This allows higher levels to deal with backlight on a monitor bases,
instead of having to deal with the fact that some monitors might have
multiple outputs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:06:33 +02:00
Jonas Ådahl
68dd168e33 monitor-manager: Move backlight API to MetaOutput
It's now a signal emitted when `meta_output_set_backlight()` is called.
It is also no longer normalized between 1 and 100; that is now handled
done via the D-Bus API layer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:06:33 +02:00
Jonas Ådahl
c4f1396570 monitor-manager: Use explicit method invocation return value
Using G_DBUSMETHOD_INVOCATION_HANDLED is clearer than TRUE in what it
means.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
2024-08-31 01:06:33 +02:00
Sebastian Wick
a212f823e7 stage-impl: Use a trace counter for the damaged redraw area
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3952>
2024-08-30 22:09:55 +00:00
Sebastian Wick
322ac42a65 stage-impl: Trace the damage region
Describes the RedrawViewPrimary trace scope with the total area of the
damage and the individual rects with the format:

  AREA[ X,Y,W,H]*

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3952>
2024-08-30 22:09:55 +00:00
Sebastian Wick
777c635076 cogl/trace: Allow defining and setting sysprof trace counters
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3952>
2024-08-30 22:09:55 +00:00
Vasil Pupkin
55a97c8600 Update Belarusian translation 2024-08-30 21:34:47 +00:00
Wim Taymans
c7105a70f1 screen-cast: Add initial PipeWire explicit sync support
Add new param to request SyncTimeline metadata on buffer that contains
the sync points.

Add new Buffers param depending on the SyncTimeline metadata and that
adds extra space for the syncobj fd.

When we receive a buffer from PipeWire with the SyncTimeline, also set
up the spa_data with the syncobj fd and the sync type. We use the
GenericFd type.

When we render a buffer with SyncTimeline, set the acquire & release
points for the syncobj.

[ Michel Dänzer:
* Flesh out Wim's skeleton and make it compile
* Dequeue explicit-sync buffers only if the release point has signaled
* Tweak commit log
v2:
* Always check spa_buffer->n_datas as well when getting the
  SPA_META_SyncTimeline metadata (Doğukan Korkmaztürk)
* Always put space before opening parens.
v3:
* Keep a per-stream list of dequeued buffers with unsignaled release
  point. (Wim Taymans)
* Fix indentation of meta_drm_timeline_is_signaled parameters in
  dequeue_pw_buffer.
v4:
* priv->dequeued_buffers handling fixes in dequeue_pw_buffer.
v5:
* Fix bumping sync points in maybe_set_sync_points.
v6:
* Guard new code by #ifdef HAVE_NATIVE_BACKEND as needed.
* Remove unused sync_fd in dequeue_pw_buffer.
v7: (Sebastian Wick)
* Refactor can_reuse_pw_buffer helper out of dequeue_pw_buffer.
* Separate loops for priv->dequeued_buffers and pw_stream_dequeue_buffer
  in dequeue_pw_buffer.
* Add g_assert after g_hash_table_lookup.
* Prevent calling meta_drm_timeline_is_signaled with non-NULL *error.
* Use g_autoptr & g_steal_pointer for timeline in maybe_create_syncobj.
* Log meta_drm_timeline_create_syncobj / meta_drm_timeline_import_syncobj
  errors in maybe_create_syncobj.
* Use g_warning_once instead of g_warning.
* Do not close (spa_buffer->datas[1].fd) in on_stream_remove_buffer,
  g_hash_table_remove closes it.
v8:
* Fix pw_stream_dequeue_buffer loop condition in dequeue_pw_buffer.
  (Sebastian Wick)
* Use g_clear_error in can_reuse_pw_buffer. (Sebastian Wick)
* Add comment above dequeued_buffers list declaration in
  MetaScreenCastStreamSrcPrivate.
v9:
* Call g_clear_error from dequeue_pw_buffer instead of
  can_reuse_pw_buffer. (Sebastian Wick)
v10: (Jonas Ådahl)
* Move added #includes to separate HAVE_NATIVE_BACKEND block.
* Add and use enum entries for spa_buffer::datas array access.
* Clean up the end of can_reuse_pw_buffer.
* Change first argument of dequeue_pw_buffer to MetaScreenCastStreamSrc.
* Rename GSList iterator to "l".
* Clean up error handling in dequeue_pw_buffer.
* Fix second parameter to second can_reuse_pw_buffer call in dequeue_pw_buffer.
* Fix coding style of code added in on_stream_param_changed.
v11:
* Move local_error declaration inside HAVE_NATIVE_BACKEND in
  dequeue_pw_buffer.
v12: (Jonas Ådahl)
* Use new syncobj_data_from_buffer helper to retrieve acquire/release
  spa_data.
* Generally assume spa_buffer->n_datas is large enough, just spot-check
  it in strategic places.
* Use GList for dequeued_buffers list.
* Warn in meta_screen_cast_stream_src_dispose if dequeued_buffers list
  isn't empty.
v13:
* Simplify empty list test in meta_screen_cast_stream_src_dispose.
  (Jonas Ådahl)
v14:
* Refactor maybe_remove_syncobj helper out of on_stream_remove_buffer.
  This allows using g_return_if_fail in the former. (Sebastian Wick,
  Jonas Ådahl)
v15:
* Guard syncobj_data_from_buffer & enum definitions by
  HAVE_NATIVE_BACKEND, since they're unused outside of that guard.
]
[ Jonas Ådahl
v16:
* Destroy the timelines hash table after destroying the stream.
* Don't warn when getting timeline data.
* Fix n_datas sanity check condition.
]

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
60161bec38 Bump pipewire requirement to >= 1.2.0
Build upstream version 1.2.0 for the CI image if needed.

v2:
* Build upstream 1.2.0 tag instead of 1.2.2.
v3:
* Build upstream 1.2.3 tag for CI, it has a needed fix.
v4:
* Enable systemd support in pipewire build. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
0c10330392 screen-cast/stream-src: Add timelines hash table
Will be used to look up a MetaDrmTimeline object for a syncobj file
descriptor.

v2:
* Add comment above timelines hash table declaration in
  MetaScreenCastStreamSrcPrivate. (Bilal Elmoussaoui)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
a3515eecb6 drm-timeline: Add meta_drm_timeline_is_signaled
v2: (Doğukan Korkmaztürk)
* Use drmSyncobjQuery instead of drmSyncobjTimelineWait.
* Fix libdrm function name in error message.
v3:
* Add separate boolean is_signaled out parameter. (Sebastian Wick)
* Use g_strerror instead of strerror.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
12d12eb278 drm-timeline: Add meta_drm_timeline_create_syncobj
Creates a kernel syncobj and returns a file descriptor representing it.

v2:
* Call drmSyncobjDestroy also after drmSyncobjHandleToFD returns 0, or
  we leak the original syncobj reference. (Sebastian Wick)
* Add errno based error messages.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
fcf1a5163d drm-timeline: Remove declaration of non-existing meta_drm_timeline_create
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Michel Dänzer
6d21b5151e Move MetaDrmTimeline to src/common
There's nothing Wayland specific about it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
2024-08-30 21:07:16 +00:00
Jonas Ådahl
36eee131c2 settings: Allow overriding experimental settings with an env var
This makes it simpler to experiment with experimental settings without
having to make changes to any gsettings fields one might not want to
change.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
6e8c7c5f84 Add experimental mode to use native scaling of Xwayland clients
Allow scale-aware Xwayland clients to scale by an integer scale
themselves, instead of letting them render them at 1x scale and then
scaling up the texture, making it look blurry.

When monitor framebuffers are scaled, this special cases Xwayland and
sends output regions in a way that Xwayland think everything is N times
as large as the logical region, where N is the ceil of the max monitor
scale.

This is done by introducing a "stage" vs "protocol" coordinate space for
X11, where the "protocol" coordinate space is "stage" multiplied by a
scaling factor.

Xwayland thus will have its own "effective scale", sent via
wl_output.scale. The effective Xwayland scale is also used for the
internal MetaWaylandSurface scale internally, unless there is a viewport
dst size set on the same surface, in which case the scale is still set
to 1, to not interfere with wp_viewport semantics.

We're guarding this behind a new experimental feature
"xwayland-native-scaling", which can only come into effect when enabled
together with "scale-monitor-framebuffer".

[v2]:

Move stage_to_protocol/protocol_to_stage to generic window class.

This means parts that aren't aware of any windowing system specific
logic, only that coordinates originate from there for a given window,
can still get their coordinates properly handled.

In particular, this means coordinates from IBus that originates from the
client, can be scaled properly when that client is using X11.

Also make them properly introspected.

[v3]:

Split up coordinate transform API.

Make it one that takes a MtkRectangle, and another that takes a point.

This means the rounding strategy becames explicit when transforming a
point, while when it's a rectangle, it's still always "grow".

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
5bf9cf59aa xwayland: Introduce an 'effective scale'
This scale is currently a lie, it doesn't do anything. What it
represents is the current highest monitor scale, and will eventually be
used to, when configured to do so, scale X11 coordinates as well as
coordinates given to Xwayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
b88482a56c monitor-manager: Add API to get layout mode
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
1333d92fa5 xwayland: Set primary monitor using connector name
We know let Xwayland set the RANDR names from the connectors. To stop
relying on layouts and coordinates to match the primary logical monitor,
instead use the connector name of the first monitor.

Also make the X11 client sanity checking check that the right X11 output
is primary as part of the monitor tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Ådahl
9af1926056 test-client: Add 'assert_primary_monitor'
This is a X11 only assert, as only X11 has the concept of a primary
monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00
Jonas Dreßler
e2db6c8276 Add an experimental feature for letting Xwayland clients scale natively
With the next commits we'll introduce a new mode for scaling of Xwayland apps,
we'll want to put this mode behind an experimental setting though, so add
that setting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3567>
2024-08-30 20:32:01 +00:00