diff -Nru sway-1.5.1/debian/changelog sway-1.5.1/debian/changelog --- sway-1.5.1/debian/changelog 2021-02-14 12:36:51.000000000 +0100 +++ sway-1.5.1/debian/changelog 2021-06-14 21:24:42.000000000 +0200 @@ -1,3 +1,11 @@ +sway (1.5.1-2ubuntu1) UNRELEASED; urgency=medium + + * debian/patches/9999-backport-subsurface-parent-fix-lp-1924800.patch: + Backport fix for subsurface parent bug that causes firefox popups to + flicker + + -- Wouter Horré Mon, 14 Jun 2021 21:24:42 +0200 + sway (1.5.1-2) unstable; urgency=medium * Update dependency on wlroots (0.12 or higher) diff -Nru sway-1.5.1/debian/patches/9999-backport-subsurface-parent-fix-lp-1924800.patch sway-1.5.1/debian/patches/9999-backport-subsurface-parent-fix-lp-1924800.patch --- sway-1.5.1/debian/patches/9999-backport-subsurface-parent-fix-lp-1924800.patch 1970-01-01 01:00:00.000000000 +0100 +++ sway-1.5.1/debian/patches/9999-backport-subsurface-parent-fix-lp-1924800.patch 2021-06-14 21:24:42.000000000 +0200 @@ -0,0 +1,131 @@ +## Description: Backported subsurface parent fixes +## Origin/Author: https://github.com/swaywm/sway/pull/6283 +## Bug: https://github.com/swaywm/sway/issues/6038 +Index: sway-1.5.1/.builds/alpine.yml +=================================================================== +--- sway-1.5.1.orig/.builds/alpine.yml ++++ sway-1.5.1/.builds/alpine.yml +@@ -16,10 +16,10 @@ packages: + - wayland-dev + - wayland-protocols + - xcb-util-image-dev +- - xorg-server-xwayland ++ - xwayland + sources: + - https://github.com/swaywm/sway +- - https://github.com/swaywm/wlroots ++ - https://github.com/swaywm/wlroots#0.12.0 + tasks: + - wlroots: | + cd wlroots +Index: sway-1.5.1/.builds/archlinux.yml +=================================================================== +--- sway-1.5.1.orig/.builds/archlinux.yml ++++ sway-1.5.1/.builds/archlinux.yml +@@ -3,6 +3,7 @@ packages: + - cairo + - gdk-pixbuf2 + - json-c ++ - libegl + - libinput + - libxcb + - libxkbcommon +@@ -12,10 +13,10 @@ packages: + - wayland + - wayland-protocols + - xcb-util-image +- - xorg-server-xwayland ++ - xorg-xwayland + sources: + - https://github.com/swaywm/sway +- - https://github.com/swaywm/wlroots ++ - https://github.com/swaywm/wlroots#0.12.0 + tasks: + - wlroots: | + cd wlroots +Index: sway-1.5.1/.builds/freebsd.yml +=================================================================== +--- sway-1.5.1.orig/.builds/freebsd.yml ++++ sway-1.5.1/.builds/freebsd.yml +@@ -24,7 +24,7 @@ packages: + - x11/xcb-util-wm + sources: + - https://github.com/swaywm/sway +-- https://github.com/swaywm/wlroots ++- https://github.com/swaywm/wlroots#0.12.0 + tasks: + - setup: | + cd sway +Index: sway-1.5.1/sway/tree/view.c +=================================================================== +--- sway-1.5.1.orig/sway/tree/view.c ++++ sway-1.5.1/sway/tree/view.c +@@ -464,6 +464,9 @@ static void view_subsurface_create(struc + static void view_init_subsurfaces(struct sway_view *view, + struct wlr_surface *surface); + ++static void view_child_init_subsurfaces(struct sway_view_child *view_child, ++ struct wlr_surface *surface); ++ + static void view_handle_surface_new_subsurface(struct wl_listener *listener, + void *data) { + struct sway_view *view = +@@ -906,8 +909,18 @@ static void view_child_subsurface_create + view_child_damage(&subsurface->child, true); + } + ++static bool view_child_is_mapped(struct sway_view_child *child) { ++ while (child) { ++ if (!child->mapped) { ++ return false; ++ } ++ child = child->parent; ++ } ++ return true; ++} ++ + static void view_child_damage(struct sway_view_child *child, bool whole) { +- if (!child || !child->mapped || !child->view || !child->view->container) { ++ if (!child || !view_child_is_mapped(child) || !child->view || !child->view->container) { + return; + } + int sx, sy; +@@ -947,6 +960,14 @@ static void view_init_subsurfaces(struct + } + } + ++static void view_child_init_subsurfaces(struct sway_view_child *view_child, ++ struct wlr_surface *surface) { ++ struct wlr_subsurface *subsurface; ++ wl_list_for_each(subsurface, &surface->subsurfaces, parent_link) { ++ view_child_subsurface_create(view_child, subsurface); ++ } ++} ++ + static void view_child_handle_surface_map(struct wl_listener *listener, + void *data) { + struct sway_view_child *child = +@@ -1002,11 +1023,11 @@ void view_child_init(struct sway_view_ch + wlr_surface_send_enter(child->surface, workspace->output->wlr_output); + } + +- view_init_subsurfaces(child->view, surface); ++ view_child_init_subsurfaces(child, surface); + } + + void view_child_destroy(struct sway_view_child *child) { +- if (child->mapped && child->view->container != NULL) { ++ if (view_child_is_mapped(child) && child->view->container != NULL) { + view_child_damage(child, true); + } + +@@ -1019,6 +1040,9 @@ void view_child_destroy(struct sway_view + wl_list_for_each_safe(subchild, tmpchild, &child->children, link) { + wl_list_remove(&subchild->link); + subchild->parent = NULL; ++ // The subchild lost its parent link, so it cannot see that the parent ++ // is unmapped. Unmap it directly. ++ subchild->mapped = false; + } + + wl_list_remove(&child->surface_commit.link); diff -Nru sway-1.5.1/debian/patches/series sway-1.5.1/debian/patches/series --- sway-1.5.1/debian/patches/series 2021-02-14 12:36:51.000000000 +0100 +++ sway-1.5.1/debian/patches/series 2021-06-14 21:22:45.000000000 +0200 @@ -1,2 +1,3 @@ 0001-Install-zsh-completions-into-the-correct-directory.patch 0002-Modify-default-configuration-for-Debian.patch +9999-backport-subsurface-parent-fix-lp-1924800.patch