1
0
Fork 0
Commit graph

31846 commits

Author SHA1 Message Date
Sebastian Wick
5626004aed kms/impl-device/atomic: Set hotspot cap before initing mode setting
We need to set the drm CAP before we read the KMS resources to make sure
we actually get all resoures the CAP makes visible.

Fixes: 27f798b6d ("kms/impl-device/atomic: Implement mouse cursor hotspots")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3341
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3654>
2024-03-08 17:27:10 +00:00
Robert Mader
f21762ea6e wayland: Add support for preferred_buffer_scale/transform
Which got introduced in wl_compositor version 6.

Note that if the surface is visible on multiple monitors with different
transforms, we pick the transform of the monitor which we choose for the
scale as well. This doesn't really matter at the moment, as the
transform is only really relevant for direct-scanout - which we
currently only support for fullscreen clients.

Once we support direct-scanout for partially visible clients we'll
likely want to introduce a more sophisticated algorithm.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3580>
2024-03-08 17:01:43 +00:00
Robert Mader
037077bb56 screen-cast-stream-src: Always advertise support for BGRA
Some clients - notably the Gstreamer vapostproc element when using Intel
GPUs - only support BGRA, not BGRx. We already assume that we can
support this format for window screen casts, and even in case of failure
we now have a re-negotiation fallback in place. Thus it's pretty safe to
support it for all screen cast types.

The possible duplication in case of window screen casts doesn't seem to
be a problem for either Pipewire or existing clients like OBS.

Note that the implementation lays the foundation to make it easy to add
more formats in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3617>
2024-03-08 14:31:16 +00:00
Robert Mader
77186c2063 screen-cast-stream-src: Use dynamic buffer allocations
In order to allow arbitrary number of formats, modifiers and other
parameters. This makes the code more robust and easier to adapt.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3617>
2024-03-08 14:31:16 +00:00
Robert Mader
774d0ad0bc screen-cast-stream-src: Remove unnecessary enum choice
If we don't offer different options there's no need to pretend there's a
choice.

Fixes: dc2b2e379b ("screen-cast-stream: Add explicit modifier support")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3617>
2024-03-08 14:31:16 +00:00
Robert Mader
572801c02f screen-cast: Clear GError within loop
In order to silence warnings and/or prevent memory leaks.

Fixes: dc2b2e379b (screen-cast-stream: Add explicit modifier support)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3617>
2024-03-08 14:31:16 +00:00
Milo Casagrande
d7bcab1ee8 Update Italian translation 2024-03-08 13:36:03 +00:00
Peter Hutterer
1fb8cbb15a build: Check for python-dbusmock if the core tests are enabled
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3648>
2024-03-07 11:49:17 +00:00
Kukuh Syafaat
dedfc99a84 Update Indonesian translation 2024-03-07 09:48:56 +00:00
Peter Hutterer
46ca7fbe00 clutter: Indentation and whitespace fix
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3647>
2024-03-07 14:34:36 +10:00
Peter Hutterer
75186fb40a backends/native: Change a C cast into a GObject type cast
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3647>
2024-03-07 14:34:36 +10:00
Christian Hergert
1513dd4ef7 wayland: Use timerfd for sub-msec poll() precision
Like the change to ClutterFrameClock, this allows poll() timeouts below
1 msec by using a timerfd which will trigger using G_POLL_IN.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3636>
2024-03-06 23:10:13 +00:00
Christian Hergert
0810238d22 clutter/frame-clock: Use timerfd for clock timing
Currently, ClutterFrameClock uses g_source_set_ready_time() to determine
the usec timing of the next frame. That translates into a poll() with a
millisecond timeout if no trigger occurs to break the poll() out early.

To avoid spinning the CPU, GLib always rounds *up* to the next millisecond
value unless a timeout of 0 was provided by a GSource.

This means that timeouts for the ClutterFrameClock can easily skew beyond
their expected time as the precision is too coarse.

This applies the same concept as GNOME/glib!3949 but just for the
ClutterFrameClock. That may be more ideal than adding a timerfd for every
GMainContext, but we'll see if that lands upstream. I wanted to provide
this here because it could easily be cherry-picked in the mean time if
this is found to be useful.

From a timer stability perspective, this improves things from erratically
jumping between 100s and 1000s off of the expected awake time to single
or low double digits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3636>
2024-03-06 23:10:13 +00:00
Guillaume Bernard
06e7a4fb68 Update French translation 2024-03-06 23:06:48 +00:00
Bruce Cowan
ad720fe7c2 Update British English translation 2024-03-06 21:25:43 +00:00
Anders Jonsson
9d60e1f466 Update Swedish translation 2024-03-06 18:09:45 +00:00
Carlos Garnacho
ab8e145e25 wayland: Filter scroll events based on source
The POINTER_EMULATED flag was a convenience to filter either
side of smooth/discrete events that we should ignore based on
the source.

This distinction was challenged, first by v120 mice that use
Clutter smooth events to deliver semi-discrete changes, second
by commit e0c4b2b241 ("backends/native: Mark the emulated smooth
scroll event as such") which made the smooth events be flagged
as emulated, and the discrete whole-step events marked as
real.

This distinction feels convenient for the time being, since
upper layers might be confused by real smooth scroll events
without finish flags. Adapt to this change at MetaWaylandPointer
so that we drop the POINTER_EMULATED check, and the events are
perhaps filtered based on their source and the preferred
wl_seat version of the client that we are talking to.

This handles the whole grid of combinations:
- wheel sources with wl_seat >=8 result in wl_pointer.axis_value120
  from "emulated" smooth scroll events, with value120 information.
- wheel sources with wl_seat < 8 result in wl_pointer.axis_discrete
  from "real" discrete scroll events.
- finger/continuous sources prefer smooth events. Previously, always
  non-emulated for those.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
2024-03-05 21:47:43 +00:00
Carlos Garnacho
39d8e44f5e wayland: Always send wl_pointer.axis after .axis_value120/discrete
The wl_pointer.axis_discrete axis (applicable to wl_seat <= v8) is
meant to be sent together with wl_pointer.axis events in the same
frame. And the wl_pointer.axis_value120 event replaces it in
wl_seat >= v9, but has the same relation with the other information
available in a frame.

This emission should not be conditional to anything, so drop the
various checks leading to maybe sending wl_pointer.axis or not.

This fixes emission of wl_pointer.axis in conjunction with discrete
events, for some combinations of versions and (non)value120 mice.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
2024-03-05 21:47:43 +00:00
Carlos Garnacho
ddc76d878e wayland: Fix handling of non-v120 discrete events on wl_seat >= v8
Unveiled by commit e0c4b2b241 ("backends/native: Mark the emulated smooth
scroll event as such"). The sudden "lack" of smooth scroll events (Used by
Clutter to forward v120 events) made it evident we silently ignore Clutter
discrete events, as we don't send wl_pointer.axis_value120 for these.

Fix this by assigning a value120 value to discrete scroll events. This
makes wl_pointer.axis_value120 events actually sent on non-v120 mice.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
2024-03-05 21:47:43 +00:00
Carlos Garnacho
7aebc9e63d clutter: Pass scroll source to discrete events
This piece of information was lost, always returning
"unknown". We can do better on the native backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
2024-03-05 21:47:43 +00:00
Carlos Garnacho
3c217d2902 cally: Use text length if caret is at the end of ClutterText
ClutterText uses -1 to express the caret being at the end of the
text content. A11y expects this position to be equivalent to the
number of characters in the text, fetch that if the position is
at the end.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7459
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3643>
2024-03-05 17:53:30 +00:00
Matej Urbančič
dd94f193cc Update Slovenian translation 2024-03-05 11:10:59 +00:00
Philip Withnall
a8be959cd8 build: Explicitly pass check kwarg to run_command()
The default value will change from `false` to `true` in future Meson
releases, so let’s be explicit.

We don’t want to check the exit status of the program in this case, as
we parse the `--help` output instead.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3640>
2024-03-05 08:26:32 +00:00
Philip Withnall
22b8af263b build: Use find_program().full_path()
`find_program().path()` was deprecated in Meson 0.55, but we depend on
Meson 0.60.

This helps fix the build with `--fatal-meson-warnings`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3640>
2024-03-05 08:26:32 +00:00
Asier Sarasua Garmendia
d1bc9028c5 Update Basque translation 2024-03-04 19:58:06 +00:00
Jonas Dreßler
58290cca57 window: Stop event propagation for drag and window-menu triggering events
meta_window_handle_ungrabbed_event() triggers the show of the window menu in
gnome-shell via meta_window_show_menu() on hold of Meta + right mouse button
click.

Since meta_display_handle_event() was refactored lately and now forwards a
lot more events to Clutter (including the one triggering the window menu),
gnome-shell now sees this event after the menu has opened, figures that the
source-actor is outside of the menu, and immediately closes the menu again.

This is the correct behavior from the PopupMenuManager on the gnome-shell
side, it is the responsibility of the event handler that opens the menu (aka
meta_window_handle_ungrabbed_event()) to return CLUTTER_EVENT_STOP and stop
event propagation.

So fix this issue by adding a return value to
meta_window_handle_ungrabbed_event() and stopping event propagation in case
the event opened the window menu.

While at it, also return CLUTTER_EVENT_STOP for events triggering window
drags, so we can drop the extra check for that in
meta_display_handle_event().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3623>
2024-03-04 09:59:59 +00:00
Peter Hutterer
6a31664a42 input-capture: Ignore emulated scroll events
For each libinput scroll event we generate two clutter events
(continuous and discrete), one of them marked as emulated. libei
explicitly specifies that emulation of scrolling must be done in the
client (if desired) so drop the emulated one.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3637>
2024-03-04 08:46:38 +00:00
Peter Hutterer
e0c4b2b241 backends/native: Mark the emulated smooth scroll event as such
This path is hit for discrete (wheel) scroll events from libinput but
the emulated smooth scroll event isn't marked as such.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3637>
2024-03-04 08:46:38 +00:00
Jordi Mas i Hernandez
ed903c440d Update Catalan translation 2024-03-04 06:24:17 +00:00
Aurimas Černius
d6a924bcd0 Update Lithuanian translation 2024-03-03 20:57:05 +00:00
Sabri Ünal
23c7e2d8c5 Update Turkish translation 2024-03-03 18:27:22 +00:00
Florian Müllner
1e74e5071f
Bump version to 46.rc
Update NEWS.
2024-03-03 15:02:00 +01:00
Luming Zh
c77eaac2d2 Update Chinese (China) translation 2024-03-03 10:03:30 +00:00
Sebastian Keller
c09fb9c5a1 compositor/drag: Use "default" cursor for moving windows
This is consistent with the DnD related cursor changes that also use the
"default" cursor for moving. The "move" cursor is kept for moving and
resizing windows using the keyboard since we currently have no other way
indicate this state.

See: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7425#note_2023057
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3634>
2024-03-02 23:42:55 +00:00
Barnabás Pőcze
fb890ead96 display: Force window user time update to happen
`meta_window_set_user_time()` will not update the window's
user time if it timestamp in the argument is before the
currently saved timestamp. However, when trying to work around
problematic timestamps, this is exactly what needs to be done.

So force the update to happen by setting the "is user time set?"
flag to false.

Fixes: 8f3da9f68a ("Use meta_window_set_user_time for setting user time consistently")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3027>
2024-03-02 23:19:22 +00:00
Robert Mader
e8b43d3b1b surface-actor: Add NULL check for stage
In some cases Wayland surface actors are not decendents of the stage,
notably subsurfaces without a parent surface. The code changes in the
mentioned commits dropped the previously existing check for that - readd
it.

Fixes: 627ab24721 (surface-actor: Add meta_surface_actor_schedule_update())
Fixes: 7eb99ddef7 (wayland/surface: Schedule updates in the context of the surface actor)

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3323
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3633>
2024-03-02 22:37:22 +00:00
Yaron Shahrabani
d5032449bb Update Hebrew translation 2024-03-02 22:17:42 +00:00
Yuri Chornoivan
578488a639 Update Ukrainian translation 2024-03-02 20:49:59 +00:00
Jonas Dreßler
e9866eee0f compositor: Set priv->current_drag before calling meta_window_drag_begin()
priv->current_drag is the property that
meta_compositor_get_current_window_drag() and therefore also
meta_display_is_grabbed() bases its check on. We use
meta_display_is_grabbed() to select which cursor to use (window cursor
vs root cursor) when updating the cursor in MetaCursorTracker.

Since meta_window_drag_begin() sets a new cursor, and therefore triggers the
cursor tracker to update the current visible cursor, we should set
priv->current_drag before the call to meta_window_drag_begin(). This makes
sure the cursor tracker sees that there's a window drag and changes the
cursor right away when the window drag begins (instead of doing so on
subsequent pointer events).

Fixes: 525ed1166c ("wayland/pointer: Unset current surface during window drags")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3630>
2024-03-02 20:24:26 +00:00
Artur S0
dcea30338c Update Russian translation 2024-03-02 19:54:04 +00:00
Balázs Úr
3e0555ac24 Update Hungarian translation 2024-03-02 19:03:59 +00:00
Michel Dänzer
0690addcfc wayland/tablet-tool: Check for non-NULL surface resource
A MetaWaylandSurface object can outlive the corresponding wl_surface
object since https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880 .

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3320
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3632>
2024-03-02 19:46:15 +01:00
Piotr Drąg
71175a2fd0 Update Polish translation 2024-03-02 16:24:54 +00:00
Ekaterine Papava
029f422149 Update Georgian translation 2024-03-02 15:29:05 +00:00
Daniel Rusek
943f239c01 Update Czech translation 2024-03-02 14:08:19 +00:00
Dor Askayo
8df0beae08 monitor-manger: Expose the minimum refresh rate of monitors
This exposes the minimum refresh rate of monitors through D-Bus.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
2024-03-02 12:35:36 +00:00
Dor Askayo
a53c02bba5 monitor: Add meta_monitor_get_min_refresh_rate()
This function gets the minimum refresh rate of the monitor's main
output.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
2024-03-02 12:35:36 +00:00
Dor Askayo
cb40a1c510 output: Add meta_output_info_get_min_refresh_rate()
This function gets the minimum refresh rate of an output if it was
found in EDID.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
2024-03-02 12:35:36 +00:00
Dor Askayo
a96d524503 edid: Decode the minimum vertical rate from the display range limits
This is used as the minimum refresh rate in the variable refresh rate
range.

This value is expected to be found in the DisplayPort and eDP EDID of
every monitor that supports variable refresh rate.

It is also found in the HDMI EDID of some monitors that support
variable (FreeSync), but most likely not all of them. The rest require
parsing the AMD vendor extension which libdisplay-info doesn't
support.

No fallback is implemented for cases where libdisplay-info support is
disabled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
2024-03-02 12:35:36 +00:00
Danial Behzadi
1080d5c20a Update Persian translation 2024-03-02 12:32:03 +00:00