Skip to content
Commits on Source (9)
mutter (3.38.1-2ubuntu1) groovy; urgency=medium
* Merge with debian, including various upstream fixes. Remaining changes:
- debian/gbp.conf: update upstream branch to point to ubuntu/master
- debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
+ X11: Add support for fractional scaling using Randr
-- Marco Trevisan (Treviño) <marco@ubuntu.com> Fri, 23 Oct 2020 12:43:24 +0200
mutter (3.38.1-2) unstable; urgency=medium
* debian/patches: Wayland start Xwayland on public X11 sockets as well
(LP: #1897224)
* debian/patches: Don't override window tile monitor (LP: #1900009)
* debian/patches: Fix resizing issues (LP: #1878293)
-- Marco Trevisan (Treviño) <marco@ubuntu.com> Fri, 23 Oct 2020 12:38:01 +0200
mutter (3.38.1-1ubuntu1) groovy; urgency=medium
* Merge with debian, including new upstream version, remaining changes:
......
From: James Henstridge <james@jamesh.id.au>
Date: Sat, 17 Oct 2020 11:50:31 +0800
Subject: Revert "wayland: Drop Xwayland abstract socket"
This reverts commit e2123768f635ee892702c8c515cf987261ba5518. Various
container/chroot (e.g. Snaps, pressure-vessel) systems still depend on
the presence of the abstract X11 socket.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1508
Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1897224
---
src/wayland/meta-wayland-private.h | 1 +
src/wayland/meta-xwayland.c | 70 +++++++++++++++++++++++++++++++++-----
2 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index 074644e..727009b 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -46,6 +46,7 @@ typedef struct
{
int display_index;
char *lock_file;
+ int abstract_fd;
int unix_fd;
char *name;
} MetaXWaylandConnection;
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index f2d193e..4a9d07e 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -237,6 +237,46 @@ create_lock_file (int display, int *display_out)
return filename;
}
+static int
+bind_to_abstract_socket (int display,
+ gboolean *fatal)
+{
+ struct sockaddr_un addr;
+ socklen_t size, name_size;
+ int fd;
+
+ fd = socket (PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ if (fd < 0)
+ {
+ *fatal = TRUE;
+ g_warning ("Failed to create socket: %m");
+ return -1;
+ }
+
+ addr.sun_family = AF_LOCAL;
+ name_size = snprintf (addr.sun_path, sizeof addr.sun_path,
+ "%c/tmp/.X11-unix/X%d", 0, display);
+ size = offsetof (struct sockaddr_un, sun_path) + name_size;
+ if (bind (fd, (struct sockaddr *) &addr, size) < 0)
+ {
+ *fatal = errno != EADDRINUSE;
+ g_warning ("failed to bind to @%s: %m", addr.sun_path + 1);
+ close (fd);
+ return -1;
+ }
+
+ if (listen (fd, 1) < 0)
+ {
+ *fatal = errno != EADDRINUSE;
+ g_warning ("Failed to listen on abstract socket @%s: %m",
+ addr.sun_path + 1);
+ close (fd);
+ return -1;
+ }
+
+ return fd;
+}
+
static int
bind_to_unix_socket (int display)
{
@@ -343,18 +383,26 @@ meta_xwayland_override_display_number (int number)
static gboolean
open_display_sockets (MetaXWaylandManager *manager,
int display_index,
+ int *abstract_fd_out,
int *unix_fd_out,
gboolean *fatal)
{
- int unix_fd;
+ int abstract_fd, unix_fd;
+
+ abstract_fd = bind_to_abstract_socket (display_index,
+ fatal);
+ if (abstract_fd < 0)
+ return FALSE;
unix_fd = bind_to_unix_socket (display_index);
if (unix_fd < 0)
{
*fatal = FALSE;
+ close (abstract_fd);
return FALSE;
}
+ *abstract_fd_out = abstract_fd;
*unix_fd_out = unix_fd;
return TRUE;
@@ -383,6 +431,7 @@ choose_xdisplay (MetaXWaylandManager *manager,
}
if (!open_display_sockets (manager, display,
+ &connection->abstract_fd,
&connection->unix_fd,
&fatal))
{
@@ -588,9 +637,10 @@ meta_xwayland_start_xserver (MetaXWaylandManager *manager,
launcher = g_subprocess_launcher_new (flags);
g_subprocess_launcher_take_fd (launcher, xwayland_client_fd[1], 3);
- g_subprocess_launcher_take_fd (launcher, manager->public_connection.unix_fd, 4);
- g_subprocess_launcher_take_fd (launcher, displayfd[1], 5);
- g_subprocess_launcher_take_fd (launcher, manager->private_connection.unix_fd, 6);
+ g_subprocess_launcher_take_fd (launcher, manager->public_connection.abstract_fd, 4);
+ g_subprocess_launcher_take_fd (launcher, manager->public_connection.unix_fd, 5);
+ g_subprocess_launcher_take_fd (launcher, displayfd[1], 6);
+ g_subprocess_launcher_take_fd (launcher, manager->private_connection.abstract_fd, 7);
g_subprocess_launcher_setenv (launcher, "WAYLAND_SOCKET", "3", TRUE);
@@ -605,14 +655,16 @@ meta_xwayland_start_xserver (MetaXWaylandManager *manager,
args[i++] = manager->auth_file;
args[i++] = "-listen";
args[i++] = "4";
- args[i++] = "-displayfd";
+ args[i++] = "-listen";
args[i++] = "5";
+ args[i++] = "-displayfd";
+ args[i++] = "6",
#ifdef HAVE_XWAYLAND_INITFD
args[i++] = "-initfd";
- args[i++] = "6";
+ args[i++] = "7";
#else
args[i++] = "-listen";
- args[i++] = "6";
+ args[i++] = "7";
#endif
for (j = 0; j < G_N_ELEMENTS (x11_extension_names); j++)
{
@@ -747,12 +799,14 @@ meta_xwayland_init (MetaXWaylandManager *manager,
{
if (!open_display_sockets (manager,
manager->public_connection.display_index,
+ &manager->public_connection.abstract_fd,
&manager->public_connection.unix_fd,
&fatal))
return FALSE;
if (!open_display_sockets (manager,
manager->private_connection.display_index,
+ &manager->private_connection.abstract_fd,
&manager->private_connection.unix_fd,
&fatal))
return FALSE;
@@ -763,7 +817,7 @@ meta_xwayland_init (MetaXWaylandManager *manager,
if (policy == META_DISPLAY_POLICY_ON_DEMAND)
{
- g_unix_fd_add (manager->public_connection.unix_fd, G_IO_IN,
+ g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN,
xdisplay_connection_activity_cb, manager);
}
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 14 Oct 2020 10:30:53 +0200
Subject: constraints: Use "orig" rectangle for interactive resize
Bug 448183 fixed an issue with _NET_WM_MOVERESIZE_WINDOW not moving a
window by basing the resize on the current (new) rectangle instead of
the original rectangle.
While this fixes the issue with _NET_WM_MOVERESIZE_WINDOW, this also
causes windows with a size increment to move when the resize also
implies a move, such windows might drift while resizing.
Make sure to use the current rectangle for non-interactive resizes only.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/543
(cherry picked from commit 7ab3eac0e27e62642bdd8dc1ddad3bf9acf5a02d)
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1878293
---
src/core/constraints.c | 34 +++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 168a55b..90e9a03 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -469,6 +469,16 @@ setup_constraint_info (ConstraintInfo *info,
info->entire_monitor.width, info->entire_monitor.height);
}
+static MetaRectangle *
+get_start_rect_for_resize (MetaWindow *window,
+ ConstraintInfo *info)
+{
+ if (!info->is_user_action && info->action_type == ACTION_MOVE_AND_RESIZE)
+ return &info->current;
+ else
+ return &info->orig;
+}
+
static void
place_window_if_needed(MetaWindow *window,
ConstraintInfo *info)
@@ -1368,13 +1378,7 @@ constrain_size_increments (MetaWindow *window,
new_height = client_rect.height;
}
- /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
- * See bug 448183
- */
- if (info->action_type == ACTION_MOVE_AND_RESIZE)
- start_rect = &info->current;
- else
- start_rect = &info->orig;
+ start_rect = get_start_rect_for_resize (window, info);
/* Resize to the new size */
meta_rectangle_resize_with_gravity (start_rect,
@@ -1424,13 +1428,7 @@ constrain_size_limits (MetaWindow *window,
new_width = CLAMP (info->current.width, min_size.width, max_size.width);
new_height = CLAMP (info->current.height, min_size.height, max_size.height);
- /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
- * See bug 448183
- */
- if (info->action_type == ACTION_MOVE_AND_RESIZE)
- start_rect = &info->current;
- else
- start_rect = &info->orig;
+ start_rect = get_start_rect_for_resize (window, info);
meta_rectangle_resize_with_gravity (start_rect,
&info->current,
@@ -1570,13 +1568,7 @@ constrain_aspect_ratio (MetaWindow *window,
new_height = client_rect.height;
}
- /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
- * See bug 448183
- */
- if (info->action_type == ACTION_MOVE_AND_RESIZE)
- start_rect = &info->current;
- else
- start_rect = &info->orig;
+ start_rect = get_start_rect_for_resize (window, info);
meta_rectangle_resize_with_gravity (start_rect,
&info->current,
......@@ -3,4 +3,10 @@ theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch
meson-add-back-default_driver-option.patch
debian/synaptics-support.patch
debian/tests-Tag-unstable-tests-as-flaky.patch
Revert-wayland-Drop-Xwayland-abstract-socket.patch
wayland-start-Xwayland-on-connection-to-either-public-X11.patch
window-Don-t-override-tile-monitor.patch
window-Do-not-go-past-size-hints-on-resize.patch
window-props-Check-for-actual-size-hints-changes.patch
constraints-Use-orig-rectangle-for-interactive-resize.patch
x11-Add-support-for-fractional-scaling-using-Randr.patch
From: James Henstridge <james@jamesh.id.au>
Date: Sat, 17 Oct 2020 12:01:44 +0800
Subject: wayland: start Xwayland on connection to either public X11 socket
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1454
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1508
Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1897224
---
src/wayland/meta-wayland-private.h | 3 +++
src/wayland/meta-xwayland.c | 13 +++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index 727009b..da0b565 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -56,6 +56,9 @@ typedef struct
MetaXWaylandConnection private_connection;
MetaXWaylandConnection public_connection;
+ guint abstract_fd_watch_id;
+ guint unix_fd_watch_id;
+
guint xserver_grace_period_id;
struct wl_display *wayland_display;
struct wl_client *client;
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 4a9d07e..fc18442 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -716,11 +716,16 @@ xdisplay_connection_activity_cb (gint fd,
GIOCondition cond,
gpointer user_data)
{
+ MetaXWaylandManager *manager = user_data;
MetaDisplay *display = meta_get_display ();
meta_display_init_x11 (display, NULL,
(GAsyncReadyCallback) on_init_x11_cb, NULL);
+ /* Stop watching both file descriptors */
+ g_clear_handle_id (&manager->abstract_fd_watch_id, g_source_remove);
+ g_clear_handle_id (&manager->unix_fd_watch_id, g_source_remove);
+
return G_SOURCE_REMOVE;
}
@@ -817,8 +822,12 @@ meta_xwayland_init (MetaXWaylandManager *manager,
if (policy == META_DISPLAY_POLICY_ON_DEMAND)
{
- g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN,
- xdisplay_connection_activity_cb, manager);
+ manager->abstract_fd_watch_id =
+ g_unix_fd_add (manager->public_connection.abstract_fd, G_IO_IN,
+ xdisplay_connection_activity_cb, manager);
+ manager->unix_fd_watch_id =
+ g_unix_fd_add (manager->public_connection.unix_fd, G_IO_IN,
+ xdisplay_connection_activity_cb, manager);
}
return TRUE;
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 13 Oct 2020 17:59:38 +0200
Subject: window: Do not go past size hints on resize
On interactive resize, mutter calculates the difference in size based on
the pointer location and relies on window constraints to ensure the
minimum size is honored.
Wayland however does asynchronous window configuration, meaning that not
checking for size hints early enough may lead to the window moving as
the locations was initially computed on a size which will be invalidate
by the client eventually.
Make sure to respect the client size hint on update_resize() so that we
don't end up with a window moving unexpectedly when the client
eventually acked the configuration.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1495
(cherry picked from commit 03c69ed8cf8059d98089929b9d79b92df0167fbe)
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1878293
---
src/core/window.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/core/window.c b/src/core/window.c
index c7ff7c7..71295c5 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6248,9 +6248,9 @@ update_resize (MetaWindow *window,
gboolean force)
{
int dx, dy;
- int new_w, new_h;
MetaGravity gravity;
- MetaRectangle old;
+ MetaRectangle new_rect;
+ MetaRectangle old_rect;
double remaining = 0;
window->display->grab_latest_motion_x = x;
@@ -6269,8 +6269,8 @@ update_resize (MetaWindow *window,
dy *= 2;
}
- new_w = window->display->grab_anchor_window_pos.width;
- new_h = window->display->grab_anchor_window_pos.height;
+ new_rect.width = window->display->grab_anchor_window_pos.width;
+ new_rect.height = window->display->grab_anchor_window_pos.height;
/* Don't bother doing anything if no move has been specified. (This
* happens often, even in keyboard resizing, due to the warping of the
@@ -6299,14 +6299,16 @@ update_resize (MetaWindow *window,
}
if (window->display->grab_op & META_GRAB_OP_WINDOW_DIR_EAST)
- new_w += dx;
+ new_rect.width += dx;
else if (window->display->grab_op & META_GRAB_OP_WINDOW_DIR_WEST)
- new_w -= dx;
+ new_rect.width -= dx;
if (window->display->grab_op & META_GRAB_OP_WINDOW_DIR_SOUTH)
- new_h += dy;
+ new_rect.height += dy;
else if (window->display->grab_op & META_GRAB_OP_WINDOW_DIR_NORTH)
- new_h -= dy;
+ new_rect.height -= dy;
+
+ ensure_size_hints_satisfied (&new_rect, &window->size_hints);
/* If we're waiting for a request for _NET_WM_SYNC_REQUEST, we'll
* resize the window when the window responds, or when we time
@@ -6336,7 +6338,7 @@ update_resize (MetaWindow *window,
/* Remove any scheduled compensation events */
g_clear_handle_id (&window->display->grab_resize_timeout_id, g_source_remove);
- meta_window_get_frame_rect (window, &old);
+ meta_window_get_frame_rect (window, &old_rect);
/* One sided resizing ought to actually be one-sided, despite the fact that
* aspect ratio windows don't interact nicely with the above stuff. So,
@@ -6344,10 +6346,10 @@ update_resize (MetaWindow *window,
*/
if ((window->display->grab_op & (META_GRAB_OP_WINDOW_DIR_WEST | META_GRAB_OP_WINDOW_DIR_EAST)) == 0)
- new_w = old.width;
+ new_rect.width = old_rect.width;
if ((window->display->grab_op & (META_GRAB_OP_WINDOW_DIR_NORTH | META_GRAB_OP_WINDOW_DIR_SOUTH)) == 0)
- new_h = old.height;
+ new_rect.height = old_rect.height;
/* compute gravity of client during operation */
gravity = meta_resize_gravity_from_grab_op (window->display->grab_op);
@@ -6355,17 +6357,20 @@ update_resize (MetaWindow *window,
/* Do any edge resistance/snapping */
meta_window_edge_resistance_for_resize (window,
- &new_w,
- &new_h,
+ &new_rect.width,
+ &new_rect.height,
gravity,
update_resize_timeout,
snap,
FALSE);
- meta_window_resize_frame_with_gravity (window, TRUE, new_w, new_h, gravity);
+ meta_window_resize_frame_with_gravity (window, TRUE,
+ new_rect.width, new_rect.height,
+ gravity);
/* Store the latest resize time, if we actually resized. */
- if (window->rect.width != old.width || window->rect.height != old.height)
+ if (window->rect.width != old_rect.width ||
+ window->rect.height != old_rect.height)
window->display->grab_last_moveresize_time = g_get_real_time ();
}
From: =?utf-8?q?Florian_M=C3=BCllner?= <fmuellner@gnome.org>
Date: Mon, 12 Oct 2020 12:08:28 +0000
Subject: window: Don't override tile monitor
Commit 033f0d11bf added a fallback in case the tile monitor wasn't
set before, but didn't actually check for a previously set value.
As a result, the "fallback" is not set unconditionally, which may
differ from the expected monitor: The tile monitor is determined
by the pointer position, while the window's monitor is the one
where the biggest part of the window resides on.
https://gitlab.gnome.org/GNOME/mutter/-/issues/1389
(cherry picked from commit 64ced1632e277e4fc0b1f4de3f5bf229c6cf885b)
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1900009
---
src/core/window.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/window.c b/src/core/window.c
index 681805c..c7ff7c7 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3158,7 +3158,7 @@ meta_window_tile (MetaWindow *window,
window->tile_monitor_number = -1;
return;
}
- else
+ else if (window->tile_monitor_number < 0)
{
window->tile_monitor_number = window->monitor->number;
}
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 15 Oct 2020 14:23:41 +0200
Subject: window-props: Check for actual size hints changes
The XSizeHints set by X11 clients give a hint to the window manager
about size increment, aspect ratio, base, minimum and maximum size, etc.
When an X11 client changes those values, there is a good chance that it
will affect the actual window size in some way, and mutter rightfully
queue a window resize in that case.
However, mutter does not check if any of the hints have actually changed
and unconditionally queue a window resize whenever a client changes its
WM_NORMAL_HINTS property.
That can be a problem when a zealous client such as xterm decides to
update its WM_NORMAL_HINTS property on resize, because in return mutter
will queue a non-user driven resize in the middle of user-driven events,
hence defeating the purpose of the META_MOVE_RESIZE_USER_ACTION flag.
To avoid that issue, make mutter a bit smarter and avoid queuing a
window resize if the XSizeHints haven't actually changed.
https://gitlab.gnome.org/GNOME/mutter/-/issues/543
(cherry picked from commit deaa9480a84938cc0120e433fa9f3607acdfa29c)
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1878293
---
src/x11/window-props.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index 11bf50c..d919a2a 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -1138,6 +1138,22 @@ spew_size_hints_differences (const XSizeHints *old,
old->win_gravity, new->win_gravity);
}
+static gboolean
+hints_have_changed (const XSizeHints *old,
+ const XSizeHints *new)
+{
+ return FLAG_CHANGED (old, new, USPosition) ||
+ FLAG_CHANGED (old, new, USSize) ||
+ FLAG_CHANGED (old, new, PPosition) ||
+ FLAG_CHANGED (old, new, PSize) ||
+ FLAG_CHANGED (old, new, PMinSize) ||
+ FLAG_CHANGED (old, new, PMaxSize) ||
+ FLAG_CHANGED (old, new, PResizeInc) ||
+ FLAG_CHANGED (old, new, PAspect) ||
+ FLAG_CHANGED (old, new, PBaseSize) ||
+ FLAG_CHANGED (old, new, PWinGravity);
+}
+
void
meta_set_normal_hints (MetaWindow *window,
XSizeHints *hints)
@@ -1488,6 +1504,7 @@ reload_normal_hints (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID)
{
XSizeHints old_hints;
+ gboolean hints_have_differences;
meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n", window->desc);
@@ -1495,12 +1512,16 @@ reload_normal_hints (MetaWindow *window,
meta_set_normal_hints (window, value->v.size_hints.hints);
- spew_size_hints_differences (&old_hints, &window->size_hints);
-
- meta_window_recalc_features (window);
+ hints_have_differences = hints_have_changed (&old_hints,
+ &window->size_hints);
+ if (hints_have_differences)
+ {
+ spew_size_hints_differences (&old_hints, &window->size_hints);
+ meta_window_recalc_features (window);
- if (!initial)
- meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
+ if (!initial)
+ meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
+ }
}
}
......@@ -3643,7 +3643,7 @@ index 37d04bb..93a2b6b 100644
void
meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
diff --git a/src/core/window.c b/src/core/window.c
index 681805c..c632d8f 100644
index 71295c5..1fb3a17 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -227,6 +227,7 @@ enum
......