Update to 44.rc

This commit is contained in:
Florian Müllner 2023-03-06 17:43:58 +01:00
parent e5aa1384a4
commit d02de5d32e
6 changed files with 11 additions and 303 deletions

1
.gitignore vendored
View File

@ -204,3 +204,4 @@ mutter-2.31.5.tar.bz2
/mutter-43.1.tar.xz /mutter-43.1.tar.xz
/mutter-43.2.tar.xz /mutter-43.2.tar.xz
/mutter-44.beta.tar.xz /mutter-44.beta.tar.xz
/mutter-44.rc.tar.xz

View File

@ -1,102 +0,0 @@
From faa003812c10ab14bc69d6add078ff10528dc78b Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 13 Feb 2023 20:12:38 +0100
Subject: [PATCH 1/3] x11: Avoid updating focus on wayland compositor
Reading upon the history of this code branch (commits 6891ce95dce
and 7a4c808e43d4 are most relevant), it seems this code is meant to
synchronize Mutter focus state taking the Xserver state as true.
That is, if Mutter tried to change the focus but something truncated
that action, Mutter focus will be changed to be in sync with the
Xserver again.
This sounds backwards in a Wayland session. Mutter focus should be
the canonical source, and not second-guessed from the current Xserver
focus window. These race conditions might still apply between X11
clients, so make these paths only apply in that case.
An example of this breaking can be reproduced with a Spotify and
Firefox window, moving the focus from the first to the second by
going to the GNOME Shell overview in between, and clicking the
Firefox window from there. The Firefox window will be raised, but
refuse to take focus.
It's unclear what made this an issue recently, perhaps commit
0e6395d9328 since the now possibly ignored XI_FocusIn/Out events
affect this accounting of the Xserver focused window. Anyhow it
sounds better to ignore these paths for Wayland/native altogether.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2841>
---
src/x11/events.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/x11/events.c b/src/x11/events.c
index fd0f84c4a..89733ba33 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1928,60 +1928,61 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
bypass_gtk = bypass_compositor = TRUE;
goto out;
}
#ifdef HAVE_XWAYLAND
wayland_compositor = meta_context_get_wayland_compositor (context);
if (meta_is_wayland_compositor () &&
meta_xwayland_manager_handle_xevent (&wayland_compositor->xwayland_manager,
event))
{
bypass_gtk = bypass_compositor = TRUE;
goto out;
}
#endif
if (process_selection_event (x11_display, event))
{
bypass_gtk = bypass_compositor = TRUE;
goto out;
}
display->current_time = event_get_time (x11_display, event);
if (META_IS_BACKEND_X11 (backend))
meta_backend_x11_handle_event (META_BACKEND_X11 (backend), event);
if (x11_display->focused_by_us &&
event->xany.serial > x11_display->focus_serial &&
display->focus_window &&
+ display->focus_window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
!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);
meta_x11_display_update_focus_window (x11_display,
x11_display->server_focus_window,
x11_display->server_focus_serial,
FALSE);
meta_display_update_focus_window (display,
meta_x11_display_lookup_x_window (x11_display,
x11_display->server_focus_window));
}
if (event->xany.window == x11_display->xroot)
{
cursor_tracker = meta_backend_get_cursor_tracker (backend);
if (META_IS_CURSOR_TRACKER_X11 (cursor_tracker))
{
MetaCursorTrackerX11 *cursor_tracker_x11 =
META_CURSOR_TRACKER_X11 (cursor_tracker);
if (meta_cursor_tracker_x11_handle_xevent (cursor_tracker_x11, event))
{
bypass_gtk = bypass_compositor = TRUE;
goto out;
}
}
}
--
2.39.2

View File

@ -1,101 +0,0 @@
From 184c4fd7b8d13767ce8fd525040b211c1f133dbf Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 28 Feb 2023 22:02:05 +0100
Subject: [PATCH 2/3] x11: Ignore _NET_ACTIVE_WINDOW client messages while
grabbed
When a X11 application is started, typically what happens is:
- A startup notification token is created, with a _TIME%d suffix
- The application being spawned receives it through the environment
- (dbus piping, maybe)
- The application replies the startup notification token, and
fetches the timestamp from it
- The application makes a _NET_ACTIVE_WINDOW client message request
with this timestamp
- Mutter handles this client request and activates/focuses the window
Prevent this last step if windows are not interactable (e.g. there is
a compositor grab) and ignore the focus request. This specifically
applies to X11 clients requesting focus themselves, and unlike previous
approaches, doesn't try to prevent focus changes that do come through
interaction with Mutter/GNOME Shell.
This should only break if applications do not observe _NET_ACTIVE_WINDOW
and perform XSetInputFocus on themselves, but in that case the X11
keyboard focus is stolen from our hands already.
---
src/x11/window-x11.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 34dbeb855..36728555a 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -3421,61 +3421,62 @@ meta_window_x11_client_message (MetaWindow *window,
if (window_drag && (button_mask & (1 << button)) == 0)
meta_window_drag_end (window_drag);
}
}
return TRUE;
}
else if (event->xclient.message_type ==
x11_display->atom__NET_MOVERESIZE_WINDOW)
{
MetaGravity gravity;
guint value_mask;
gravity = (MetaGravity) (event->xclient.data.l[0] & 0xff);
value_mask = (event->xclient.data.l[0] & 0xf00) >> 8;
/* source = (event->xclient.data.l[0] & 0xf000) >> 12; */
if (gravity == 0)
gravity = window->size_hints.win_gravity;
meta_window_move_resize_request(window,
value_mask,
gravity,
event->xclient.data.l[1], /* x */
event->xclient.data.l[2], /* y */
event->xclient.data.l[3], /* width */
event->xclient.data.l[4]); /* height */
}
else if (event->xclient.message_type ==
- x11_display->atom__NET_ACTIVE_WINDOW)
+ x11_display->atom__NET_ACTIVE_WINDOW &&
+ meta_display_windows_are_interactable (window->display))
{
MetaClientType source_indication;
guint32 timestamp;
meta_verbose ("_NET_ACTIVE_WINDOW request for window '%s', activating",
window->desc);
source_indication = event->xclient.data.l[0];
timestamp = event->xclient.data.l[1];
if (source_indication > META_CLIENT_TYPE_MAX_RECOGNIZED)
source_indication = META_CLIENT_TYPE_UNKNOWN;
if (timestamp == 0)
{
/* Client using older EWMH _NET_ACTIVE_WINDOW without a timestamp */
meta_warning ("Buggy client sent a _NET_ACTIVE_WINDOW message with a "
"timestamp of 0 for %s",
window->desc);
timestamp = meta_display_get_current_time (display);
}
meta_window_activate_full (window, timestamp, source_indication, NULL);
return TRUE;
}
else if (event->xclient.message_type ==
x11_display->atom__NET_WM_FULLSCREEN_MONITORS)
{
MetaLogicalMonitor *top, *bottom, *left, *right;
--
2.39.2

View File

@ -1,90 +0,0 @@
From 6ccd0c2ea3f0628b3ffe8158ec69bee9420e9089 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 1 Mar 2023 13:58:13 +0100
Subject: [PATCH 3/3] core: Avoid focusing windows on map during grabs
Normally, mutter implicitly allows a window being shown to take
focus. This is normally desired, except it steals input from
GNOME Shell self. Avoid focusing the just shown window in those
situations.
---
src/core/window.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/core/window.c b/src/core/window.c
index 2ec62c22c..f137e6822 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1967,60 +1967,69 @@ window_is_terminal (MetaWindow *window)
else if (strcmp (window->res_class, "Terminal") == 0)
return TRUE;
return FALSE;
}
/* This function determines what state the window should have assuming that it
* and the focus_window have no relation
*/
static void
window_state_on_map (MetaWindow *window,
gboolean *takes_focus,
gboolean *places_on_top)
{
gboolean intervening_events;
intervening_events = intervening_user_event_occurred (window);
*takes_focus = !intervening_events;
*places_on_top = *takes_focus;
/* don't initially focus windows that are intended to not accept
* focus
*/
if (!meta_window_is_focusable (window))
{
*takes_focus = FALSE;
return;
}
+ /* Do not focus window on map if input is already taken by the
+ * compositor.
+ */
+ if (!meta_display_windows_are_interactable (window->display))
+ {
+ *takes_focus = FALSE;
+ return;
+ }
+
/* Terminal usage may be different; some users intend to launch
* many apps in quick succession or to just view things in the new
* window while still interacting with the terminal. In that case,
* apps launched from the terminal should not take focus. This
* isn't quite the same as not allowing focus to transfer from
* terminals due to new window map, but the latter is a much easier
* approximation to enforce so we do that.
*/
if (*takes_focus &&
meta_prefs_get_focus_new_windows () == G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
!window->display->allow_terminal_deactivation &&
window_is_terminal (window->display->focus_window) &&
!meta_window_is_ancestor_of_transient (window->display->focus_window,
window))
{
meta_topic (META_DEBUG_FOCUS,
"focus_window is terminal; not focusing new window.");
*takes_focus = FALSE;
*places_on_top = FALSE;
}
switch (window->type)
{
case META_WINDOW_UTILITY:
case META_WINDOW_TOOLBAR:
*takes_focus = FALSE;
*places_on_top = FALSE;
break;
case META_WINDOW_DOCK:
case META_WINDOW_DESKTOP:
--
2.39.2

View File

@ -1,5 +1,6 @@
%global glib_version 2.69.0 %global glib_version 2.75.1
%global gtk3_version 3.19.8 %global gtk3_version 3.19.8
%global gtk4_version 4.0.0
%global gsettings_desktop_schemas_version 40~alpha %global gsettings_desktop_schemas_version 40~alpha
%global json_glib_version 0.12.0 %global json_glib_version 0.12.0
%global libinput_version 1.19.0 %global libinput_version 1.19.0
@ -11,8 +12,8 @@
%global tarball_version %%(echo %{version} | tr '~' '.') %global tarball_version %%(echo %{version} | tr '~' '.')
Name: mutter Name: mutter
Version: 44~beta Version: 44~rc
Release: 3%{?dist} Release: 1%{?dist}
Summary: Window and compositing manager based on Clutter Summary: Window and compositing manager based on Clutter
License: GPLv2+ License: GPLv2+
@ -28,11 +29,6 @@ Patch1: 0001-Revert-build-Do-not-provide-built-sources-as-libmutt.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1936991 # https://bugzilla.redhat.com/show_bug.cgi?id=1936991
Patch2: mutter-42.alpha-disable-tegra.patch Patch2: mutter-42.alpha-disable-tegra.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2173985
Patch30001: 0001-x11-Avoid-updating-focus-on-wayland-compositor.patch
Patch30002: 0002-x11-Ignore-_NET_ACTIVE_WINDOW-client-messages-while-.patch
Patch30003: 0003-core-Avoid-focusing-windows-on-map-during-grabs.patch
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0 BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(sm)
@ -75,7 +71,7 @@ BuildRequires: pkgconfig(gsettings-desktop-schemas) >= %{gsettings_desktop_schem
BuildRequires: pkgconfig(gnome-settings-daemon) BuildRequires: pkgconfig(gnome-settings-daemon)
BuildRequires: meson BuildRequires: meson
BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(gnome-desktop-3.0) BuildRequires: pkgconfig(gnome-desktop-4)
BuildRequires: pkgconfig(gudev-1.0) BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libstartup-notification-1.0) BuildRequires: pkgconfig(libstartup-notification-1.0)
@ -93,6 +89,7 @@ Requires: control-center-filesystem
Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version} Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version}
Requires: gnome-settings-daemon Requires: gnome-settings-daemon
Requires: gtk3%{?_isa} >= %{gtk3_version} Requires: gtk3%{?_isa} >= %{gtk3_version}
Requires: gtk4%{?_isa} >= %{gtk4_version}
Requires: json-glib%{?_isa} >= %{json_glib_version} Requires: json-glib%{?_isa} >= %{json_glib_version}
Requires: libinput%{?_isa} >= %{libinput_version} Requires: libinput%{?_isa} >= %{libinput_version}
Requires: pipewire%{_isa} >= %{pipewire_version} Requires: pipewire%{_isa} >= %{pipewire_version}
@ -176,6 +173,9 @@ the functionality of the installed %{name} package.
%{_datadir}/mutter-%{mutter_api_version}/tests %{_datadir}/mutter-%{mutter_api_version}/tests
%changelog %changelog
* Mon Mar 06 2023 Florian Müllner <fmuellner@redhat.com> - 44~rc-1
- Update to 44.rc
* Sat Mar 04 2023 Ray Strode <rstrode@redhat.com> - 44~beta-3 * Sat Mar 04 2023 Ray Strode <rstrode@redhat.com> - 44~beta-3
- Add some backports of Carlos's focus fixes - Add some backports of Carlos's focus fixes
Related: #2173985 Related: #2173985

View File

@ -1 +1 @@
SHA512 (mutter-44.beta.tar.xz) = 26520492d563401961abd42cde3ce140b22994615f458e03b9b5093678914cbe9da9cffc6d715d09c3da8e64297bfd5db21ee5bb466c306a941c95a19af1bac2 SHA512 (mutter-44.rc.tar.xz) = 1d7659f9b4bb96ea50c32f122a8e621639007d023970cfeeb2afe5351abc38b9a697163019e26c85cad611f65eccbcd9f940ff1ff5ab10509fda8122c43f9a66