1
0
Fork 0

Backport gnome-43 changes & Update !1441 and !2763

Signed-off-by: Mingi Sung <fiestalake@disroot.org>
This commit is contained in:
Mingi Sung 2023-02-22 06:16:16 +00:00
parent 6371de40e8
commit bbbc2b4415
No known key found for this signature in database
GPG key ID: 31A419BE9238EC9D
5 changed files with 851 additions and 19 deletions

View file

@ -1,7 +1,7 @@
pkgbase = mutter-performance
pkgdesc = A window manager for GNOME | Attempts to improve performances with non-upstreamed merge-requests and frequent stable branch resync
pkgver = 43.2+r3+g97dd7fb10
pkgrel = 3
pkgver = 43.3
pkgrel = 1
url = https://gitlab.gnome.org/GNOME/mutter
arch = x86_64
arch = aarch64
@ -37,11 +37,13 @@ pkgbase = mutter-performance
source = mr1880.patch
source = mr2702.patch
source = mr2763.patch
source = backport-for-43_2.patch
sha256sums = SKIP
sha256sums = d7a014965cbb90892ccbe65d0de49ddce50191dbd7521467d7f11c2f4825045c
sha256sums = c0fc6220d9b07de4b0ee16570aa4a4fef5a02c9b97a5012b34895277a5435e87
sha256sums = 20a90016dab0de9fb8e9cd7b38644e41d2006796f332b7a2d7c92bdf71bc3a4a
sha256sums = 1b0647ab0d39db3b334e86c39dbb81b80030339c8d1a9cd43ff88003e966dec2
sha256sums = ecb0360b5e517a4d6204c71634025ae2c7333ff0f8f33fbcc8a6566ac7acec2f
sha256sums = caded43b8a9ffd3e946be205396b7be61a29735c151717bd516fa683fb3a1d96
sha256sums = 4bf8048982e846145a514e9edf0aab5b6296c876accde8ba805ee976c3a8bc39
pkgname = mutter-performance
groups = gnome

View file

@ -30,8 +30,8 @@ if [ -n "$_disable_docs" ]; then
else
pkgname=(mutter-performance mutter-performance-docs)
fi
pkgver=43.2+r3+g97dd7fb10
pkgrel=3
pkgver=43.3
pkgrel=1
pkgdesc="A window manager for GNOME | Attempts to improve performances with non-upstreamed merge-requests and frequent stable branch resync"
url="https://gitlab.gnome.org/GNOME/mutter"
arch=(x86_64 aarch64)
@ -50,17 +50,19 @@ source=("$pkgname::git+https://gitlab.gnome.org/GNOME/mutter.git#commit=$_commit
'mr1441.patch'
'mr1880.patch'
'mr2702.patch'
'mr2763.patch')
'mr2763.patch'
'backport-for-43_2.patch')
sha256sums=('SKIP'
'd7a014965cbb90892ccbe65d0de49ddce50191dbd7521467d7f11c2f4825045c'
'c0fc6220d9b07de4b0ee16570aa4a4fef5a02c9b97a5012b34895277a5435e87'
'20a90016dab0de9fb8e9cd7b38644e41d2006796f332b7a2d7c92bdf71bc3a4a'
'1b0647ab0d39db3b334e86c39dbb81b80030339c8d1a9cd43ff88003e966dec2'
'ecb0360b5e517a4d6204c71634025ae2c7333ff0f8f33fbcc8a6566ac7acec2f')
'caded43b8a9ffd3e946be205396b7be61a29735c151717bd516fa683fb3a1d96'
'4bf8048982e846145a514e9edf0aab5b6296c876accde8ba805ee976c3a8bc39')
pkgver() {
cd $pkgname
git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}
# pkgver() {
# cd $pkgname
# git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
# }
pick_mr() {
for mr in "${_merge_requests_to_use[@]}"; do
@ -147,6 +149,10 @@ prepare() {
# Status: 2 & 3
pick_mr '2763' 'mr2763.patch' 'patch'
# Title: Backports for 43.2^3
# Collector: Mingi Sung <fiestalake@disroot.org>
pick_mr '2763' 'backport-for-43_2.patch' 'patch'
# Title: Draft: Dynamic triple/double buffering (v4)
# Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
# URL: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441

684
backport-for-43_2.patch Normal file
View file

@ -0,0 +1,684 @@
From 35763ca0cc961bf0c18f14f9f8779f67f1a6c453 Mon Sep 17 00:00:00 2001
From: Niels De Graef <nielsdegraef@gmail.com>
Date: Sun, 22 Jan 2023 18:46:01 +0100
Subject: [PATCH] clutter/stage-view: Properly chain up finalize
Fix a silly copy-paste mistake. Since `GObject` is the parent class,
chaining up to `dispose()` from within your `finalize()`
implementation just leads to a little memory leak and nothing worse.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2799>
(cherry picked from commit 768ec7b0c1128c43cd3a02b17aaccb552f9626c3)
---
clutter/clutter/clutter-stage-view.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index aa98e6a629..14f21024c0 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -1476,7 +1476,7 @@ clutter_stage_view_finalize (GObject *object)
g_clear_object (&priv->framebuffer);
- G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
+ G_OBJECT_CLASS (clutter_stage_view_parent_class)->finalize (object);
}
static void
--
GitLab
From 1b970252f53b0935c663961cabd08784852b4f05 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Wed, 30 Nov 2022 17:32:14 +0800
Subject: [PATCH] gles3: Ensure missing_extensions is always populated
This appears to be the only explanation for `init_secondary_gpu_data_gpu`
crashing in `g_strjoinv`, but I don't know the exact conditions causing
`glGetString (GL_EXTENSIONS)` to return NULL.
https://launchpad.net/bugs/1994011
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2674>
(cherry picked from commit 89b254a74ba3b64f98f8ad0727f5e420945664c1)
---
src/backends/meta-gles3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/meta-gles3.c b/src/backends/meta-gles3.c
index 727b3c1257..23a024b14a 100644
--- a/src/backends/meta-gles3.c
+++ b/src/backends/meta-gles3.c
@@ -127,7 +127,7 @@ meta_gles3_has_extensions (MetaGles3 *gles3,
if (!extensions_str)
{
g_warning ("Failed to get string: %s", get_gl_error_str (glGetError ()));
- return FALSE;
+ extensions_str = "";
}
va_start (var_args, first_extension);
--
GitLab
From 3c197879b52bbdc6ca54c3ef8ff7590cee11002e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 20 Jan 2023 15:55:44 +0100
Subject: [PATCH] color-device: Don't write to fields when cancelled
Writing to fields (in this case the MetaColorDevice::pending_state) in
response to an asynchronous operation that was cancelled means we'll
write to an arbitrary memory location, potentially causing segmentation
faults or memory corruption.
Avoid these segfaults or memory corruption by only updating state if we
weren't cancelled. Also avoid trying to dereference the device pointer
if we're cancelled.
The memory corruption due to this has been causing test flakyness in the
monitor unit tests due, which should now hopefully be fixed.
Fixes: 19837796fe39b7ab83a10721e0c9d8fb748437c4
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2794>
(cherry picked from commit ad371a443526389e54af3743ef9cf6cef9d5adea)
---
src/backends/meta-color-device.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c
index a3b8700e62..c0a98a46f3 100644
--- a/src/backends/meta-color-device.c
+++ b/src/backends/meta-color-device.c
@@ -367,13 +367,13 @@ on_cd_device_connected (GObject *source_object,
MetaColorDevice *color_device = user_data;
g_autoptr (GError) error = NULL;
- color_device->pending_state &= ~PENDING_CONNECTED;
-
if (!cd_device_connect_finish (cd_device, res, &error))
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
+ color_device->pending_state &= ~PENDING_CONNECTED;
+
g_warning ("Failed to connect to colord device %s: %s",
color_device->cd_device_id,
error->message);
@@ -384,6 +384,7 @@ on_cd_device_connected (GObject *source_object,
}
else
{
+ color_device->pending_state &= ~PENDING_CONNECTED;
meta_topic (META_DEBUG_COLOR, "Color device '%s' connected",
color_device->cd_device_id);
}
@@ -423,8 +424,6 @@ ensure_device_profile_cb (GObject *source_object,
MetaColorProfile *color_profile;
g_autoptr (GError) error = NULL;
- color_device->pending_state &= ~PENDING_EDID_PROFILE;
-
color_profile = meta_color_store_ensure_device_profile_finish (color_store,
res,
&error);
@@ -436,6 +435,7 @@ ensure_device_profile_cb (GObject *source_object,
g_warning ("Failed to create device color profile: %s", error->message);
+ color_device->pending_state &= ~PENDING_EDID_PROFILE;
g_cancellable_cancel (color_device->cancellable);
meta_color_device_notify_ready (color_device, FALSE);
return;
@@ -444,6 +444,7 @@ ensure_device_profile_cb (GObject *source_object,
meta_topic (META_DEBUG_COLOR, "Color device '%s' generated",
color_device->cd_device_id);
+ color_device->pending_state &= ~PENDING_EDID_PROFILE;
g_set_object (&color_device->device_profile, color_profile);
if (!meta_color_profile_is_ready (color_profile))
@@ -647,7 +648,7 @@ on_profile_written (GObject *source_object,
GFile *file = G_FILE (source_object);
g_autoptr (GTask) task = G_TASK (user_data);
GenerateProfileData *data = g_task_get_task_data (task);
- MetaColorManager *color_manager = data->color_device->color_manager;
+ MetaColorManager *color_manager;
g_autoptr (GError) error = NULL;
MetaColorProfile *color_profile;
@@ -668,6 +669,7 @@ on_profile_written (GObject *source_object,
meta_topic (META_DEBUG_COLOR, "On-disk device profile '%s' updated",
g_file_peek_path (file));
+ color_manager = data->color_device->color_manager;
color_profile =
meta_color_profile_new_from_icc (color_manager,
g_steal_pointer (&data->cd_icc),
--
GitLab
From 45d83b49a8090e882939beea5d70aa89b5c73d38 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 24 Jan 2023 13:31:49 +0100
Subject: [PATCH] backends/native: Minor refactor
Refactor code so that variables don't depend the on motion line
content, but the other way around. This makes it clearer what each
vector means.
This has no functional changes.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2803>
(cherry picked from commit 34a9141a6c975e26b12ba5d5c6739b3d9df6a2e4)
---
src/backends/native/meta-seat-impl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 23865c9059..cec2060f7b 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1169,9 +1169,12 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
meta_viewport_info_get_view_info (viewports, cur_view, &rect, &scale);
+ target_x = x + (dx * scale);
+ target_y = y + (dy * scale);
+
motion = (MetaLine2) {
.a = { x, y },
- .b = { x + (dx * scale), y + (dy * scale) }
+ .b = { target_x, target_y }
};
left = (MetaLine2) {
{ rect.x, rect.y },
@@ -1190,9 +1193,6 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
{ rect.x + rect.width, rect.y + rect.height }
};
- target_x = motion.b.x;
- target_y = motion.b.y;
-
if (direction != META_DISPLAY_RIGHT &&
meta_line2_intersects_with (&motion, &left, &intersection))
direction = META_DISPLAY_LEFT;
@@ -1209,10 +1209,10 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
/* We reached the dest logical monitor */
break;
+ dx -= intersection.x - x;
+ dy -= intersection.y - y;
x = intersection.x;
y = intersection.y;
- dx -= intersection.x - motion.a.x;
- dy -= intersection.y - motion.a.y;
cur_view = meta_viewport_info_get_neighbor (viewports, cur_view,
direction);
--
GitLab
From 844ce1776df1ac9e396c39e488904991fd32919e Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 24 Jan 2023 13:34:29 +0100
Subject: [PATCH] backends/native: Keep general direction when crossing
monitors
When the pointer crosses monitors, we account for a single motion event
resulting in the pointer moving across more than 2 monitors, in order
to correctly account each monitor scale and the distance traversed
across each monitor in the resulting relative motion vector.
However, memory on the direction is kept short, each iteration to
find the target view just remembers the direction it came from. This
brings a pathological case with 4 monitors with the same resolution
in a 2x2 grid, and a motion vector that crosses monitors at the
intersection of all 4 in a perfect diagonal. (Say, monitors are
all 1920x1080 and pointer moves from 1920,1080 to 1919,1079).
In that case, the intersection point at the crossing between 4
monitors (say, 1920,1080) will be considered to intersect with 2
edges of each view. Since there is always at least 2 directions to
try, the loop will always find the direction other than the one
it came from, and as a result endlessly jump across all 4 possible
choices.
In order to fix this, consider only the global v/h directions,
we already know if the pointer moves left/right or up/down, so
only consider those directions to jump across monitors.
For the case at hand, this will result in three monitors visited,
(either bottomright/bottomleft/topleft, or bottomright/topright/topleft)
with a total distance of 0,0 in the middle one, effectively
resulting in a correct diagonal motion.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2598
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2803>
(cherry picked from commit 8f268f2930b15bdf974395e0c27085c69d35b99e)
---
src/backends/native/meta-seat-impl.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index cec2060f7b..62bf9fc1ba 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1158,12 +1158,22 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
float x = cur_x, y = cur_y;
float target_x = cur_x, target_y = cur_y;
float dx = *dx_inout, dy = *dy_inout;
- MetaDisplayDirection direction = -1;
+ MetaDisplayDirection direction_h, direction_v;
+
+#define META_DISPLAY_NONE -1
+ direction_h = dx > 0.0 ? META_DISPLAY_RIGHT :
+ dx < 0.0 ? META_DISPLAY_LEFT :
+ META_DISPLAY_NONE;
+ direction_v = dy > 0.0 ? META_DISPLAY_DOWN :
+ dy < 0.0 ? META_DISPLAY_UP :
+ META_DISPLAY_NONE;
+#undef META_DISPLAY_NONE
while (cur_view >= 0)
{
MetaLine2 left, right, top, bottom, motion;
MetaVector2 intersection;
+ MetaDisplayDirection direction;
cairo_rectangle_int_t rect;
float scale;
@@ -1193,16 +1203,16 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
{ rect.x + rect.width, rect.y + rect.height }
};
- if (direction != META_DISPLAY_RIGHT &&
+ if (direction_h == META_DISPLAY_LEFT &&
meta_line2_intersects_with (&motion, &left, &intersection))
direction = META_DISPLAY_LEFT;
- else if (direction != META_DISPLAY_LEFT &&
+ else if (direction_h == META_DISPLAY_RIGHT &&
meta_line2_intersects_with (&motion, &right, &intersection))
direction = META_DISPLAY_RIGHT;
- else if (direction != META_DISPLAY_DOWN &&
+ else if (direction_v == META_DISPLAY_UP &&
meta_line2_intersects_with (&motion, &top, &intersection))
direction = META_DISPLAY_UP;
- else if (direction != META_DISPLAY_UP &&
+ else if (direction_v == META_DISPLAY_DOWN &&
meta_line2_intersects_with (&motion, &bottom, &intersection))
direction = META_DISPLAY_DOWN;
else
--
GitLab
From bc9853b8359d46c7ff8436e3d47a1e0fe59be53e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 27 Jan 2023 15:34:38 +0100
Subject: [PATCH] backend: Fix a couple of minor GError leaks
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2811>
(cherry picked from commit c95a24f6e8b3aa7af5ba34baa3402ed0cdf66ab7)
---
src/backends/meta-remote-desktop.c | 2 +-
src/backends/meta-screen-cast.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backends/meta-remote-desktop.c b/src/backends/meta-remote-desktop.c
index f0a4998184..0ad4d75083 100644
--- a/src/backends/meta-remote-desktop.c
+++ b/src/backends/meta-remote-desktop.c
@@ -208,7 +208,7 @@ on_bus_acquired (GDBusConnection *connection,
MetaRemoteDesktop *remote_desktop = user_data;
GDBusInterfaceSkeleton *interface_skeleton =
G_DBUS_INTERFACE_SKELETON (remote_desktop);
- GError *error = NULL;
+ g_autoptr (GError) error = NULL;
if (!g_dbus_interface_skeleton_export (interface_skeleton,
connection,
diff --git a/src/backends/meta-screen-cast.c b/src/backends/meta-screen-cast.c
index 119c8712fc..d79bfc3733 100644
--- a/src/backends/meta-screen-cast.c
+++ b/src/backends/meta-screen-cast.c
@@ -274,7 +274,7 @@ on_bus_acquired (GDBusConnection *connection,
MetaScreenCast *screen_cast = user_data;
GDBusInterfaceSkeleton *interface_skeleton =
G_DBUS_INTERFACE_SKELETON (screen_cast);
- GError *error = NULL;
+ g_autoptr (GError) error = NULL;
if (!g_dbus_interface_skeleton_export (interface_skeleton,
connection,
--
GitLab
From 4ed03b9bc83f343123a212699db80a22ec17bc21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 27 Jan 2023 16:02:35 +0100
Subject: [PATCH] screen-cast: Fix warning message
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2811>
(cherry picked from commit 176b706e662d1cae2e7e72b4f807a76955cb2bbb)
---
src/backends/meta-screen-cast.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/meta-screen-cast.c b/src/backends/meta-screen-cast.c
index d79bfc3733..1376cbbc9f 100644
--- a/src/backends/meta-screen-cast.c
+++ b/src/backends/meta-screen-cast.c
@@ -280,7 +280,7 @@ on_bus_acquired (GDBusConnection *connection,
connection,
META_SCREEN_CAST_DBUS_PATH,
&error))
- g_warning ("Failed to export remote desktop object: %s", error->message);
+ g_warning ("Failed to export screen cast object: %s", error->message);
}
static void
--
GitLab
From 516ff7b7e49d1aaad9f4f7a2d92cda8be1549083 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@posteo.de>
Date: Fri, 10 Feb 2023 19:01:45 +0100
Subject: [PATCH] Revert "clutter/frame-clock: Fix handling of equal
next_presentation_time_us"
This reverts commit 1f7527bbc4d74cbb4d79c7e21e549ef984b36e3a.
Not waiting till the next refresh cycle can cause feedback loops with
Wayland clients using "empty" commits for frame events - notably
Firefox, but possibly many other clients as well under certain
conditions.
While for Gnome 44 a more sophisticated solution is in development, lets
go with a simple and tested one for Gnome 43, going back to Gnome 42
behavior, slightly increasing the chance for frame skips.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6137
---
clutter/clutter/clutter-frame-clock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c
index 4d441c364b..34d676f549 100644
--- a/clutter/clutter/clutter-frame-clock.c
+++ b/clutter/clutter/clutter-frame-clock.c
@@ -530,8 +530,7 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
last_next_presentation_time_us = frame_clock->next_presentation_time_us;
time_since_last_next_presentation_time_us =
next_presentation_time_us - last_next_presentation_time_us;
- if (time_since_last_next_presentation_time_us > 0 &&
- time_since_last_next_presentation_time_us < (refresh_interval_us / 2))
+ if (time_since_last_next_presentation_time_us < (refresh_interval_us / 2))
{
next_presentation_time_us =
frame_clock->next_presentation_time_us + refresh_interval_us;
--
GitLab
From 7c080d24d7bc2503b6ece4bf380d6fb2c6437271 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 21 Dec 2022 15:55:38 +0100
Subject: [PATCH] x11/display: Add some logging
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776>
(cherry picked from commit 24f796a30c8ecc62ecd38d72b00c2342ee5558a7)
---
src/x11/meta-x11-display.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 2607bdaf53..729d8c0f80 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1932,6 +1932,9 @@ meta_x11_display_update_focus_window (MetaX11Display *x11_display,
if (x11_display->focus_xwindow == xwindow)
return;
+ meta_topic (META_DEBUG_FOCUS, "Updating X11 focus window from 0x%lx to 0x%lx",
+ x11_display->focus_xwindow, xwindow);
+
x11_display->focus_xwindow = xwindow;
meta_x11_display_update_active_window_hint (x11_display);
}
@@ -1983,6 +1986,9 @@ meta_x11_display_set_input_focus (MetaX11Display *x11_display,
else
xwindow = x11_display->no_focus_window;
+ meta_topic (META_DEBUG_FOCUS, "Setting X11 input focus for window %s to 0x%lx",
+ window ? window->desc : "none", xwindow);
+
meta_x11_error_trap_push (x11_display);
meta_x11_display_set_input_focus_internal (x11_display, xwindow, timestamp);
serial = XNextRequest (x11_display->xdisplay);
@@ -2000,6 +2006,8 @@ meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display,
if (meta_display_timestamp_too_old (x11_display->display, &timestamp))
return;
+ meta_topic (META_DEBUG_FOCUS, "Setting X11 input focus to 0x%lx", window);
+
meta_x11_display_set_input_focus_internal (x11_display, window, timestamp);
serial = XNextRequest (x11_display->xdisplay);
meta_x11_display_update_focus_window (x11_display, window, serial, TRUE);
--
GitLab
From 1f39a0cb24df58ad02d066e16550ee18e40edb0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 21 Dec 2022 15:09:11 +0100
Subject: [PATCH] x11/events: Do not update focus XWindow during grabs
During grabs, it is expected that the X11 focus does not correspond
to the display's focus window, as focus should be on the stage's
XWindow instead.
This still messes up the keyboard focus even after we stopped moving
the X11 focus, because we end up with a presumed X11 focus window
of None, and as a result the stage is considered unfocused.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776>
(cherry picked from commit 0e6395d93284422848ca3a5ffb88d48fbce7d471)
---
src/x11/events.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/x11/events.c b/src/x11/events.c
index 639b3f5807..8b9c108253 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1009,6 +1009,9 @@ handle_input_xevent (MetaX11Display *x11_display,
break;
case XI_FocusIn:
case XI_FocusOut:
+ if (clutter_stage_get_grab_actor (stage) != NULL)
+ break;
+
if (handle_window_focus_event (x11_display, window, enter_event, serial) &&
enter_event->event == enter_event->root)
{
@@ -1929,7 +1932,8 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
if (x11_display->focused_by_us &&
event->xany.serial > x11_display->focus_serial &&
display->focus_window &&
- !window_has_xwindow (display->focus_window, x11_display->server_focus_window))
+ !window_has_xwindow (display->focus_window, x11_display->server_focus_window) &&
+ meta_display_windows_are_interactable (display))
{
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed",
display->focus_window->desc);
--
GitLab
From 8aa9916c8b3707c2b8c5978c9d05cc45824ba07a Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 8 Feb 2023 15:25:32 +0100
Subject: [PATCH] x11: Do not move X11 input focus during grabs
On X11, the stage itself is backed by an XWindow, and moving the
input focus elsewhere will bypass any Clutter-level grabs.
This effectively allows newly opened windows to steal the focus
from gnome-shell itself, which is clearly undesirable. To prevent
that, only allow moving the X11 focus to a Window when no grab is
in place, just like commit 50e89e376 did for the stage focus.
But particularly the updating of x11_display->focus_xwindow is not
prevented. Since it's more consistent to the MetaDisplay/MetaX11Display
dual focus tracking and across Wayland/X11 backends, ensure the X11
input focus is actually set on the last focus Window after the
grabs are gone and windows became interactable again.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2832>
(cherry picked from commit a68b8e95954772cd6f5d676a803e01c13e48c83f)
---
src/core/events.c | 4 ++++
src/x11/meta-x11-display-private.h | 2 ++
src/x11/meta-x11-display.c | 20 ++++++++++++++++++++
3 files changed, 26 insertions(+)
diff --git a/src/core/events.c b/src/core/events.c
index aaf6f49aec..f6477b7835 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -34,6 +34,7 @@
#include "core/display-private.h"
#include "core/window-private.h"
#include "meta/meta-backend.h"
+#include "x11/meta-x11-display-private.h"
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
@@ -260,6 +261,9 @@ meta_display_handle_event (MetaDisplay *display,
display->grabbed_in_clutter = FALSE;
meta_compositor_grab_end (compositor);
}
+
+ if (display->x11_display)
+ meta_x11_display_sync_input_focus (display->x11_display);
}
device = clutter_event_get_device (event);
diff --git a/src/x11/meta-x11-display-private.h b/src/x11/meta-x11-display-private.h
index a811131325..d8be49e5be 100644
--- a/src/x11/meta-x11-display-private.h
+++ b/src/x11/meta-x11-display-private.h
@@ -258,6 +258,8 @@ void meta_x11_display_set_input_focus (MetaX11Display *x11_display,
gboolean focus_frame,
uint32_t timestamp);
+void meta_x11_display_sync_input_focus (MetaX11Display *x11_display);
+
MetaDisplay * meta_x11_display_get_display (MetaX11Display *x11_display);
#endif /* META_X11_DISPLAY_PRIVATE_H */
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 729d8c0f80..09cd332d07 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1944,6 +1944,10 @@ meta_x11_display_set_input_focus_internal (MetaX11Display *x11_display,
Window xwindow,
uint32_t timestamp)
{
+ if (xwindow != None &&
+ !meta_display_windows_are_interactable (x11_display->display))
+ return;
+
meta_x11_error_trap_push (x11_display);
/* In order for mutter to know that the focus request succeeded, we track
@@ -2016,6 +2020,22 @@ meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display,
x11_display->display->last_focus_time = timestamp;
}
+void
+meta_x11_display_sync_input_focus (MetaX11Display *x11_display)
+{
+ guint timestamp;
+
+ if (!meta_display_windows_are_interactable (x11_display->display))
+ return;
+
+ meta_x11_error_trap_push (x11_display);
+ timestamp = meta_display_get_current_time (x11_display->display);
+ meta_x11_display_set_input_focus_internal (x11_display,
+ x11_display->focus_xwindow,
+ timestamp);
+ meta_x11_error_trap_pop (x11_display);
+}
+
static MetaX11DisplayLogicalMonitorData *
get_x11_display_logical_monitor_data (MetaLogicalMonitor *logical_monitor)
{
--
GitLab
From a63755bdad7d8bffdbbc649178d759c37dacce01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Sat, 11 Feb 2023 19:24:29 +0100
Subject: [PATCH] Bump version to 43.3
Update NEWS.
---
NEWS | 28 ++++++++++++++++++++++++++++
meson.build | 2 +-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index 87b5451b62..20651e4372 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,31 @@
+43.3
+====
+* Skip resize effects for tiled windows during user grabs [Michael; !2579]
+* Disable direct scanout during drag-n-drop operations [Robert; !2677]
+* Ignore unmapped subsurfaces in direct scanout check [Robert; !2755]
+* Fix cursor disappearing over windows during grabs [Carlos; !2754]
+* Fix pointer constrains with subsurfaces [Robert; !2717]
+* Make wl_output mode independent of the orientation [Sebastian; !2723]
+* Improve focus handling on workspace switches [Sebastian; !2747]
+* Fix cursor position in window screencasts [Georges; !2737]
+* Do not require a physical device to update pointer visibility [Carlos; !2766]
+* Fix initialization of keyboard accessibility [Carlos; !2750, !2778]
+* Fix freeze when crossing monitors under some conditions [Carlos; !2803]
+* Don't allow window activation to break global grabs
+ [Florian, Carlos; !2776, !2832]
+* Fixed crashes [Georges, Daniel, Jonas; !2736, !2674, !2794]
+* Plugged leak [Niels; !2799]
+* Misc. bug fixes and cleanups [Robert, Jonas, Georges, Carlos; !2671, !2707,
+ !2762, !2767, !2811, gnome-shell#6137]
+
+Contributors:
+ Carlos Garnacho, Niels De Graef, Robert Mader, Florian Müllner,
+ Georges Basile Stavracas Neto, Daniel van Vugt, Michael Webster,
+ Sebastian Wick, Jonas Ã…dahl
+
+Translators:
+ Aleksandr Melman [ru]
+
43.2
====
* Fix edge resistance and window snapping regression [John; !2687]
diff --git a/meson.build b/meson.build
index 07460c0f12..bcacf4baeb 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('mutter', 'c',
- version: '43.2',
+ version: '43.3',
meson_version: '>= 0.58.0',
license: 'GPLv2+'
)
--
GitLab

View file

@ -1,8 +1,8 @@
Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
Source: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441
Editor: Mingi Sung <FiestaLake@protonmail.com>
Commit: 01f700fc1c5bd9f6265577d0b86f2f407e256cc4
Last Updated: 10/27/22 (Mutter 43.0+r87+g986d3be7a-1)
Editor: Mingi Sung <fiestalake@disroot.org>
Commit: a6f23c151c94912c8fc074facd07b0d6aa70f939
Last Updated: 2/22/23 (Mutter 43.3-1)
---
Use triple buffering if and when the previous frame is running late.
@ -2783,3 +2783,82 @@ index 6595eb5a290e02f91c8968085f424bbd3afef816..42f7e62760416ded2c7c7bcb146f617f
g_signal_handler_disconnect (stage, before_update_handler_id);
g_signal_handler_disconnect (stage, before_paint_handler_id);
diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c
index 6c8245f8cb..79cf789634 100644
--- a/src/backends/native/meta-onscreen-native.c
+++ b/src/backends/native/meta-onscreen-native.c
@@ -71,8 +71,8 @@ typedef struct _MetaOnscreenNativeSecondaryGpuState
struct {
MetaDrmBufferDumb *current_dumb_fb;
- MetaDrmBufferDumb *dumb_fbs[2];
- MetaDrmBuffer *source_fbs[2];
+ MetaDrmBufferDumb *dumb_fbs[3];
+ MetaDrmBuffer *source_fbs[3];
} cpu;
gboolean noted_primary_gpu_copy_ok;
@@ -717,12 +717,17 @@ static MetaDrmBufferDumb *
secondary_gpu_get_next_dumb_buffer (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
{
MetaDrmBufferDumb *current_dumb_fb;
+ const int n_dumb_fbs = G_N_ELEMENTS (secondary_gpu_state->cpu.dumb_fbs);
+ int i;
current_dumb_fb = secondary_gpu_state->cpu.current_dumb_fb;
- if (current_dumb_fb == secondary_gpu_state->cpu.dumb_fbs[0])
- return secondary_gpu_state->cpu.dumb_fbs[1];
- else
- return secondary_gpu_state->cpu.dumb_fbs[0];
+ for (i = 0; i < n_dumb_fbs; i++)
+ {
+ if (current_dumb_fb == secondary_gpu_state->cpu.dumb_fbs[i])
+ return secondary_gpu_state->cpu.dumb_fbs[(i + 1) % n_dumb_fbs];
+ }
+
+ return secondary_gpu_state->cpu.dumb_fbs[0];
}
static MetaDrmBuffer *
diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c
index 1a16b048bf..78f8dde9b4 100644
--- a/clutter/clutter/clutter-frame-clock.c
+++ b/clutter/clutter/clutter-frame-clock.c
@@ -457,7 +457,7 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
int64_t refresh_interval_us;
int64_t min_render_time_allowed_us;
int64_t max_render_time_allowed_us;
- int64_t next_presentation_time_us;
+ int64_t next_presentation_time_us = 0;
int64_t next_update_time_us;
now_us = g_get_monotonic_time ();
@@ -501,7 +501,24 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
*
*/
last_presentation_time_us = frame_clock->last_presentation_time_us;
- next_presentation_time_us = last_presentation_time_us + refresh_interval_us;
+ switch (frame_clock->state)
+ {
+ case CLUTTER_FRAME_CLOCK_STATE_INIT:
+ case CLUTTER_FRAME_CLOCK_STATE_IDLE:
+ case CLUTTER_FRAME_CLOCK_STATE_SCHEDULED:
+ next_presentation_time_us = last_presentation_time_us +
+ refresh_interval_us;
+ break;
+ case CLUTTER_FRAME_CLOCK_STATE_DISPATCHED_ONE:
+ case CLUTTER_FRAME_CLOCK_STATE_DISPATCHED_ONE_AND_SCHEDULED:
+ next_presentation_time_us = last_presentation_time_us +
+ 2 * refresh_interval_us;
+ break;
+ case CLUTTER_FRAME_CLOCK_STATE_DISPATCHED_TWO:
+ next_presentation_time_us = last_presentation_time_us +
+ 3 * refresh_interval_us;
+ break;
+ }
/*
* However, the last presentation could have happened more than a frame ago.
--

View file

@ -1,8 +1,8 @@
Author: Robert Mader <robert.mader@posteo.de>
Source: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2763
Editor: Mingi Sung <FiestaLake@protonmail.com>
Commit: 93dbad3f376787a9e402bbf38745f3ed30bd575c
Last Updated: 12/30/22 (Mutter 43.2+r3+g97dd7fb10-2)
Editor: Mingi Sung <fiestalake@disroot.org>
Commit: 4b97f45a5ab0883c12d0a20359b36cc8dbf9d5e0
Last Updated: 1/22/23 (Mutter 43.3-1)
---
!2677 (merged)
@ -20,6 +20,7 @@ Revert 74dd9037
!2766 (merged)
!2750 (merged)
!2778 (merged)
!2763 (merged)
---
diff --git a/clutter/clutter/clutter-actor-private.h b/clutter/clutter/clutter-actor-private.h
@ -839,3 +840,63 @@ index 9d066b19cb4d555b720f908b3f099ee8fbab4235..b3888650a18c62ca80e77a1ac0cb28e4
continue;
actor_surface = META_WAYLAND_ACTOR_SURFACE (surface->role);
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index cc75f14e8c..71d193e5f3 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -455,7 +455,7 @@ guess_candidates (MetaInputMapper *mapper,
g_assert (META_IS_MONITOR (l->data));
- if (match_edid (input, l->data, &edid_match))
+ if (integrated && match_edid (input, l->data, &edid_match))
match.score |= 1 << edid_match;
if (integrated && match_size (input, l->data))
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index 71d193e5f3..10d67dd99c 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -425,6 +425,8 @@ guess_candidates (MetaInputMapper *mapper,
GList *monitors, *l;
gboolean builtin = FALSE;
gboolean integrated = TRUE;
+ gboolean automatic;
+ g_autoptr (GVariant) user_value = NULL;
#ifdef HAVE_LIBWACOM
if (clutter_input_device_get_device_type (input->device) != CLUTTER_TOUCHSCREEN_DEVICE)
@@ -446,6 +448,9 @@ guess_candidates (MetaInputMapper *mapper,
}
#endif
+ user_value = g_settings_get_user_value (input->settings, "output");
+ automatic = user_value == NULL;
+
monitors = meta_monitor_manager_get_monitors (mapper->monitor_manager);
for (l = monitors; l; l = l->next)
@@ -455,16 +460,16 @@ guess_candidates (MetaInputMapper *mapper,
g_assert (META_IS_MONITOR (l->data));
- if (integrated && match_edid (input, l->data, &edid_match))
+ if (automatic && integrated && match_edid (input, l->data, &edid_match))
match.score |= 1 << edid_match;
- if (integrated && match_size (input, l->data))
+ if (automatic && integrated && match_size (input, l->data))
match.score |= 1 << META_MATCH_SIZE;
- if (builtin && match_builtin (mapper, l->data))
+ if (automatic && builtin && match_builtin (mapper, l->data))
match.score |= 1 << META_MATCH_IS_BUILTIN;
- if (match_config (input, l->data))
+ if (!automatic && match_config (input, l->data))
match.score |= 1 << META_MATCH_CONFIG;
if (match.score > 0)
--