import CS mutter-3.32.2-72.el8
This commit is contained in:
parent
8fc44febdf
commit
253b53fd8c
|
@ -0,0 +1,163 @@
|
|||
From bfd49687aa862a7e69d0d7fe76f803ae180d40c2 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
Date: Wed, 7 Jun 2023 11:04:15 +0200
|
||||
Subject: [PATCH] core: Change MetaWaylandTextInput event forwarding to IMs
|
||||
|
||||
We need to juggle with some things here to keep key event ordering
|
||||
and accounting consistent.
|
||||
|
||||
The keyboard internal state changes (and maybe modifier event emission)
|
||||
happening through meta_wayland_seat_update() should ideally happen
|
||||
from the same key events that reach the client through wl_keyboard.key,
|
||||
so that wl_keyboard.modifier events are emitted in the right relative
|
||||
order to other key events.
|
||||
|
||||
In order to fix this, we need to decide at an earlier point whether
|
||||
the event will get processed through IM (and maybe be reinjected),
|
||||
thus ignored in wait of IM-postprocessed events.
|
||||
|
||||
This means we pay less attention to whether events are first-hand
|
||||
hardware events for some things and go with the event that does
|
||||
eventually reach to us (hardware or IM).
|
||||
|
||||
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5890
|
||||
---
|
||||
src/core/events.c | 8 ++++++++
|
||||
src/wayland/meta-wayland-keyboard.c | 8 --------
|
||||
src/wayland/meta-wayland-seat.c | 30 ++++++++++++++++++++++-------
|
||||
src/wayland/meta-wayland-seat.h | 3 +++
|
||||
src/wayland/meta-wayland.c | 7 +++++++
|
||||
src/wayland/meta-wayland.h | 4 ++++
|
||||
6 files changed, 45 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/core/events.c b/src/core/events.c
|
||||
index 5b8e49fc79..19d701779b 100644
|
||||
--- a/src/core/events.c
|
||||
+++ b/src/core/events.c
|
||||
@@ -207,6 +207,14 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
compositor = meta_wayland_compositor_get_default ();
|
||||
+
|
||||
+ if (display->event_route == META_EVENT_ROUTE_NORMAL &&
|
||||
+ meta_wayland_compositor_handle_text_input_event (compositor, event))
|
||||
+ {
|
||||
+ bypass_wayland = bypass_clutter = TRUE;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
meta_wayland_compositor_update (compositor, event);
|
||||
}
|
||||
#endif
|
||||
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
|
||||
index 8b23d76ce7..84f46bcf8e 100644
|
||||
--- a/src/wayland/meta-wayland-keyboard.c
|
||||
+++ b/src/wayland/meta-wayland-keyboard.c
|
||||
@@ -753,14 +753,6 @@ meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
|
||||
{
|
||||
gboolean is_press = event->type == CLUTTER_KEY_PRESS;
|
||||
|
||||
- /* Only handle real, non-synthetic, events here. The IM is free to reemit
|
||||
- * key events (incl. modifiers), handling those additionally will result
|
||||
- * in doubly-pressed keys.
|
||||
- */
|
||||
- if ((event->flags &
|
||||
- (CLUTTER_EVENT_FLAG_SYNTHETIC | CLUTTER_EVENT_FLAG_INPUT_METHOD)) != 0)
|
||||
- return;
|
||||
-
|
||||
/* If we get a key event but still have pending modifier state
|
||||
* changes from a previous event that didn't get cleared, we need to
|
||||
* send that state right away so that the new key event can be
|
||||
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
|
||||
index 91fe376ffe..dcf420201f 100644
|
||||
--- a/src/wayland/meta-wayland-seat.c
|
||||
+++ b/src/wayland/meta-wayland-seat.c
|
||||
@@ -362,6 +362,29 @@ meta_wayland_seat_update (MetaWaylandSeat *seat,
|
||||
}
|
||||
}
|
||||
|
||||
+gboolean
|
||||
+meta_wayland_seat_handle_text_input_event (MetaWaylandSeat *seat,
|
||||
+ const ClutterEvent *event)
|
||||
+{
|
||||
+ switch (event->type)
|
||||
+ {
|
||||
+ case CLUTTER_KEY_PRESS:
|
||||
+ case CLUTTER_KEY_RELEASE:
|
||||
+ if (meta_wayland_text_input_handle_event (seat->text_input, event))
|
||||
+ return TRUE;
|
||||
+
|
||||
+ if (meta_wayland_gtk_text_input_handle_event (seat->gtk_text_input,
|
||||
+ event))
|
||||
+ return TRUE;
|
||||
+
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
gboolean
|
||||
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||
const ClutterEvent *event)
|
||||
@@ -384,13 +407,6 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||
break;
|
||||
case CLUTTER_KEY_PRESS:
|
||||
case CLUTTER_KEY_RELEASE:
|
||||
- if (meta_wayland_text_input_handle_event (seat->text_input, event))
|
||||
- return TRUE;
|
||||
-
|
||||
- if (meta_wayland_gtk_text_input_handle_event (seat->gtk_text_input,
|
||||
- event))
|
||||
- return TRUE;
|
||||
-
|
||||
if (meta_wayland_seat_has_keyboard (seat))
|
||||
return meta_wayland_keyboard_handle_event (seat->keyboard,
|
||||
(const ClutterKeyEvent *) event);
|
||||
diff --git a/src/wayland/meta-wayland-seat.h b/src/wayland/meta-wayland-seat.h
|
||||
index 3a744d0580..da20e69d8d 100644
|
||||
--- a/src/wayland/meta-wayland-seat.h
|
||||
+++ b/src/wayland/meta-wayland-seat.h
|
||||
@@ -82,4 +82,7 @@ gboolean meta_wayland_seat_has_pointer (MetaWaylandSeat *seat);
|
||||
|
||||
gboolean meta_wayland_seat_has_touch (MetaWaylandSeat *seat);
|
||||
|
||||
+gboolean meta_wayland_seat_handle_text_input_event (MetaWaylandSeat *seat,
|
||||
+ const ClutterEvent *event);
|
||||
+
|
||||
#endif /* META_WAYLAND_SEAT_H */
|
||||
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
|
||||
index a593f0a7b7..24a68f1e06 100644
|
||||
--- a/src/wayland/meta-wayland.c
|
||||
+++ b/src/wayland/meta-wayland.c
|
||||
@@ -565,3 +565,10 @@ meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
||||
meta_wayland_compositor_remove_surface_association (compositor, id);
|
||||
}
|
||||
}
|
||||
+
|
||||
+gboolean
|
||||
+meta_wayland_compositor_handle_text_input_event (MetaWaylandCompositor *compositor,
|
||||
+ const ClutterEvent *event)
|
||||
+{
|
||||
+ return meta_wayland_seat_handle_text_input_event (compositor->seat, event);
|
||||
+}
|
||||
diff --git a/src/wayland/meta-wayland.h b/src/wayland/meta-wayland.h
|
||||
index 2a0aa11400..b5281d2014 100644
|
||||
--- a/src/wayland/meta-wayland.h
|
||||
+++ b/src/wayland/meta-wayland.h
|
||||
@@ -87,6 +87,10 @@ META_EXPORT_TEST
|
||||
void meta_wayland_compositor_schedule_surface_association (MetaWaylandCompositor *compositor,
|
||||
int id,
|
||||
MetaWindow *window);
|
||||
+
|
||||
+gboolean meta_wayland_compositor_handle_text_input_event (MetaWaylandCompositor *compositor,
|
||||
+ const ClutterEvent *event);
|
||||
+
|
||||
META_EXPORT_TEST
|
||||
void meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
|
||||
int id,
|
||||
--
|
||||
2.40.1
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
|
||||
index 2bf7f5e..1221c7b 100644
|
||||
--- a/src/backends/native/meta-backend-native.c
|
||||
+++ b/src/backends/native/meta-backend-native.c
|
||||
@@ -341,25 +341,30 @@ maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
|
||||
MetaGpuKms *primary_gpu;
|
||||
const char *driver_name;
|
||||
int i;
|
||||
- static const char *disable_dma_buf_drivers[] = {
|
||||
- "qxl",
|
||||
+ static const char *enable_dma_buf_drivers[] = {
|
||||
+ "i915",
|
||||
};
|
||||
+ MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
|
||||
+ gboolean enable_dma_buf = FALSE;
|
||||
|
||||
primary_gpu = meta_renderer_native_get_primary_gpu (renderer_native);
|
||||
driver_name = meta_gpu_kms_get_driver_name (primary_gpu);
|
||||
|
||||
- for (i = 0; i < G_N_ELEMENTS (disable_dma_buf_drivers); i++)
|
||||
+ for (i = 0; i < G_N_ELEMENTS (enable_dma_buf_drivers); i++)
|
||||
{
|
||||
- if (g_strcmp0 (driver_name, disable_dma_buf_drivers[i]) == 0)
|
||||
+ if (g_strcmp0 (driver_name, enable_dma_buf_drivers[i]) == 0)
|
||||
{
|
||||
- MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
|
||||
+ enable_dma_buf = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- g_message ("The '%s' driver doesn't support DMA buffer screen sharing, disabling.",
|
||||
- driver_name);
|
||||
+ if (!enable_dma_buf)
|
||||
+ {
|
||||
+ g_message ("Not enabling DMA buffer screen sharing for driver '%s'.",
|
||||
+ driver_name);
|
||||
|
||||
- meta_screen_cast_disable_dma_bufs (screen_cast);
|
||||
- return;
|
||||
- }
|
||||
+ meta_screen_cast_disable_dma_bufs (screen_cast);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_REMOTE_DESKTOP */
|
|
@ -0,0 +1,68 @@
|
|||
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
|
||||
index f39d348..c1abc9b 100644
|
||||
--- a/src/backends/meta-screen-cast-stream-src.c
|
||||
+++ b/src/backends/meta-screen-cast-stream-src.c
|
||||
@@ -684,11 +684,18 @@ on_stream_param_changed (void *data,
|
||||
MetaScreenCastStreamSrc *src = data;
|
||||
MetaScreenCastStreamSrcPrivate *priv =
|
||||
meta_screen_cast_stream_src_get_instance_private (src);
|
||||
+ MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||
+ MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
|
||||
+ MetaScreenCast *screen_cast =
|
||||
+ meta_screen_cast_session_get_screen_cast (session);
|
||||
+
|
||||
uint8_t params_buffer[1024];
|
||||
int32_t width, height, stride, size;
|
||||
struct spa_pod_builder pod_builder;
|
||||
const struct spa_pod *params[3];
|
||||
const int bpp = 4;
|
||||
+ int buffer_types;
|
||||
+ CoglDmaBufHandle *dmabuf_handle;
|
||||
|
||||
if (!format || id != SPA_PARAM_Format)
|
||||
return;
|
||||
@@ -705,6 +712,16 @@ on_stream_param_changed (void *data,
|
||||
|
||||
pod_builder = SPA_POD_BUILDER_INIT (params_buffer, sizeof (params_buffer));
|
||||
|
||||
+ buffer_types = 1 << SPA_DATA_MemFd;
|
||||
+ dmabuf_handle = meta_screen_cast_create_dma_buf_handle (screen_cast,
|
||||
+ priv->stream_width,
|
||||
+ priv->stream_height);
|
||||
+ if (dmabuf_handle)
|
||||
+ {
|
||||
+ buffer_types |= 1 << SPA_DATA_DmaBuf;
|
||||
+ cogl_dma_buf_handle_free(dmabuf_handle);
|
||||
+ }
|
||||
+
|
||||
params[0] = spa_pod_builder_add_object (
|
||||
&pod_builder,
|
||||
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
|
||||
@@ -712,7 +729,8 @@ on_stream_param_changed (void *data,
|
||||
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int (1),
|
||||
SPA_PARAM_BUFFERS_size, SPA_POD_Int (size),
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_Int (stride),
|
||||
- SPA_PARAM_BUFFERS_align, SPA_POD_Int (16));
|
||||
+ SPA_PARAM_BUFFERS_align, SPA_POD_Int (16),
|
||||
+ SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int (buffer_types));
|
||||
|
||||
params[1] = spa_pod_builder_add_object (
|
||||
&pod_builder,
|
||||
@@ -751,9 +769,16 @@ on_stream_add_buffer (void *data,
|
||||
spa_data[0].mapoffset = 0;
|
||||
spa_data[0].maxsize = stride * priv->video_format.size.height;
|
||||
|
||||
- dmabuf_handle = meta_screen_cast_create_dma_buf_handle (screen_cast,
|
||||
+ if (spa_data[0].type & (1 << SPA_DATA_DmaBuf))
|
||||
+ {
|
||||
+ dmabuf_handle = meta_screen_cast_create_dma_buf_handle (screen_cast,
|
||||
priv->stream_width,
|
||||
priv->stream_height);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ dmabuf_handle = NULL;
|
||||
+ }
|
||||
|
||||
if (dmabuf_handle)
|
||||
{
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Name: mutter
|
||||
Version: 3.32.2
|
||||
Release: 69%{?dist}
|
||||
Release: 72%{?dist}
|
||||
Summary: Window and compositing manager based on Clutter
|
||||
|
||||
License: GPLv2+
|
||||
|
@ -148,6 +148,8 @@ Patch407: 0004-screen-cast-Disable-DMA-buffer-based-screen-casting-.patch
|
|||
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1365
|
||||
Patch408: cursor-move-only-screen-cast-fixes.patch
|
||||
Patch409: mutter-bump-screencast-api-version.patch
|
||||
Patch410: mutter-screencast-dmabuf-i915-only.patch
|
||||
Patch411: mutter-screencast-negotiate-buffer-type.patch
|
||||
|
||||
# Only treat WM_PROTOCOLS messages as WM_PROTOCOL messages (#1847203)
|
||||
Patch500: 0001-stage-x11-Check-that-message-is-WM_PROTOCOLS-before-.patch
|
||||
|
@ -213,6 +215,8 @@ Patch530: 0001-output-kms-Add-more-heuristics-to-decide-when-to-off.patch
|
|||
# Queue fail safe page flip callbacks (#2172057)
|
||||
Patch531: 0001-renderer-native-Queue-fail-safe-callbacks-when-mode-.patch
|
||||
|
||||
Patch532: 0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch
|
||||
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: pango-devel
|
||||
BuildRequires: startup-notification-devel
|
||||
|
@ -354,6 +358,15 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
|
|||
%{_datadir}/mutter-%{mutter_api_version}/tests
|
||||
|
||||
%changelog
|
||||
* Mon Oct 02 2023 Jan Grulich <jgrulich@redhat.com> - 3.32.2-72
|
||||
- Do not use DMA buffers for screencast when the client doesn't support it
|
||||
- Use DMA buffers only for i195 drivers
|
||||
Resolves: RHEL-4405
|
||||
|
||||
* Thu Aug 17 2023 Carlos Garnacho <cgarnach@redhat.com> - 3.32.2-71
|
||||
- Fix ordering of keyboard modifiers relative to other keyboard events
|
||||
Resolves: #2170830
|
||||
|
||||
* Thu Apr 06 2023 Jonas Ådahl <jadahl@redhat.com>) - 3.32.2-69
|
||||
- Queue fail safe page flip callbacks
|
||||
Resolves: #2172057
|
||||
|
|
Loading…
Reference in New Issue