Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] sway: patch for popup menu flickers with Firefox
@ 2021-03-29  5:37 CameronNemo
  2021-03-29 11:55 ` [PR PATCH] [Merged]: " ericonr
  0 siblings, 1 reply; 2+ messages in thread
From: CameronNemo @ 2021-03-29  5:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

There is a new pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages swaywm-ff-glitch
https://github.com/void-linux/void-packages/pull/29840

sway: patch for popup menu flickers with Firefox
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ x ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29840.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-swaywm-ff-glitch-29840.patch --]
[-- Type: text/x-diff, Size: 6036 bytes --]

From c5686a67946c4956fe6dd6842eb73dc3c42e64ea Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Sun, 28 Mar 2021 22:35:56 -0700
Subject: [PATCH] sway: patch for popup menu flickers with Firefox

---
 srcpkgs/sway/patches/6046.patch | 133 ++++++++++++++++++++++++++++++++
 srcpkgs/sway/template           |   3 +-
 2 files changed, 135 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sway/patches/6046.patch

diff --git a/srcpkgs/sway/patches/6046.patch b/srcpkgs/sway/patches/6046.patch
new file mode 100644
index 000000000000..34845cd99b59
--- /dev/null
+++ b/srcpkgs/sway/patches/6046.patch
@@ -0,0 +1,133 @@
+Upstream: yes
+Source: https://github.com/swaywm/sway/pull/6046
+Reason: Popup menu flickers on Firefox
+(https://bugzilla.mozilla.org/show_bug.cgi?id=1696662)
+
+From cf03185561e919f1c337f087194fec150425eef5 Mon Sep 17 00:00:00 2001
+From: Kenny Levinsen <kl@kl.wtf>
+Date: Fri, 19 Feb 2021 18:39:54 +0100
+Subject: [PATCH 1/3] view: Recursively check mapped of view_child tree
+
+A subsurface may be set to mapped without its parent.
+---
+ sway/tree/view.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/sway/tree/view.c b/sway/tree/view.c
+index ad79b2294..c8a4ea6b6 100644
+--- a/sway/tree/view.c
++++ b/sway/tree/view.c
+@@ -982,8 +982,18 @@ static void view_child_subsurface_create(struct sway_view_child *child,
+ 	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;
+@@ -1082,7 +1092,7 @@ void view_child_init(struct sway_view_child *child,
+ }
+ 
+ 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);
+ 	}
+ 
+
+From e2ec65d0a32797edd0846758bc24cf685e2d19d5 Mon Sep 17 00:00:00 2001
+From: Kenny Levinsen <kl@kl.wtf>
+Date: Fri, 19 Feb 2021 18:41:04 +0100
+Subject: [PATCH 2/3] view: Mark subchildren as unmapped in view_child_destroy
+
+The subchildren lose their parent association at this point, so they
+will not be able to see that the parent is unmapped.
+
+Instead, just set the subchildren to be unmapped directly.
+---
+ sway/tree/view.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sway/tree/view.c b/sway/tree/view.c
+index c8a4ea6b6..978271c24 100644
+--- a/sway/tree/view.c
++++ b/sway/tree/view.c
+@@ -1105,6 +1105,9 @@ void view_child_destroy(struct sway_view_child *child) {
+ 	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);
+
+From c06a926e0d89e952e5a3892b63f07d5b802b34ef Mon Sep 17 00:00:00 2001
+From: Kenny Levinsen <kl@kl.wtf>
+Date: Fri, 19 Feb 2021 18:33:20 +0100
+Subject: [PATCH 3/3] view: Set parent for view_child subsurfaces on init
+
+view_child_init was calling view_init_subsurfaces, which did not set the
+parent attribute for the subchildren. This lead to the subchildren
+acting as standalone children. If the parent was an xdg_popup, this
+would make the subchild unaware of the popup position.
+
+Introduce view_child_init_subsurfaces for view_child_init to use
+instead.
+
+Closes: https://github.com/swaywm/sway/issues/6038
+---
+ sway/tree/view.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/sway/tree/view.c b/sway/tree/view.c
+index 978271c24..8a2a8178d 100644
+--- a/sway/tree/view.c
++++ b/sway/tree/view.c
+@@ -465,6 +465,9 @@ static void view_subsurface_create(struct sway_view *view,
+ 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 =
+@@ -1033,6 +1036,14 @@ static void view_init_subsurfaces(struct sway_view *view,
+ 	}
+ }
+ 
++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 =
+@@ -1088,7 +1099,7 @@ void view_child_init(struct sway_view_child *child,
+ 		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) {
diff --git a/srcpkgs/sway/template b/srcpkgs/sway/template
index 98ade688f1e0..2858c7026b56 100644
--- a/srcpkgs/sway/template
+++ b/srcpkgs/sway/template
@@ -1,7 +1,7 @@
 # Template file for 'sway'
 pkgname=sway
 version=1.5.1
-revision=1
+revision=2
 build_style=meson
 conf_files="/etc/sway/config"
 hostmakedepends="pkg-config wayland-devel scdoc git"
@@ -14,6 +14,7 @@ license="MIT"
 homepage="https://swaywm.org"
 distfiles="https://github.com/swaywm/${pkgname}/archive/${version}.tar.gz"
 checksum=095f983c9a5f80d761bc2fb19df8166839b9290124ccd47f3e74119a1335490f
+patch_args="-Np1"
 
 post_patch() {
 	vsed -e 's/werror=true/werror=false/g' -i meson.build

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: sway: patch for popup menu flickers with Firefox
  2021-03-29  5:37 [PR PATCH] sway: patch for popup menu flickers with Firefox CameronNemo
@ 2021-03-29 11:55 ` ericonr
  0 siblings, 0 replies; 2+ messages in thread
From: ericonr @ 2021-03-29 11:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

There's a merged pull request on the void-packages repository

sway: patch for popup menu flickers with Firefox
https://github.com/void-linux/void-packages/pull/29840

Description:
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ x ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-29 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29  5:37 [PR PATCH] sway: patch for popup menu flickers with Firefox CameronNemo
2021-03-29 11:55 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).