[packages/i3] add patch for remembering workspace<->output assignment; rel 2
atler
atler at pld-linux.org
Sat Mar 20 11:56:37 CET 2021
commit 761e03e8b62e51cabb672129c6c10926b47aba31
Author: Jan Palus <atler at pld-linux.org>
Date: Sat Mar 20 11:53:28 2021 +0100
add patch for remembering workspace<->output assignment; rel 2
i3 destroys workspace which is not visible and does not have windows
effectively loosing output assignment; rejected upstream:
https://github.com/i3/i3/pull/4391
i3-remember_ws_output.patch | 41 +++++++++++++++++++++++++++++++++++++++++
i3.spec | 4 +++-
2 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/i3.spec b/i3.spec
index 3e11743..1669faa 100644
--- a/i3.spec
+++ b/i3.spec
@@ -1,11 +1,12 @@
Summary: improved tiling wm
Name: i3
Version: 4.19.2
-Release: 1
+Release: 2
License: BSD
Group: X11/Window Managers
Source0: https://i3wm.org/downloads/%{name}-%{version}.tar.xz
# Source0-md5: 8c38be87d6ec7d734065dcc5864abb37
+Patch0: %{name}-remember_ws_output.patch
URL: http://i3wm.org/
BuildRequires: asciidoc
BuildRequires: bison
@@ -56,6 +57,7 @@ Header files for %{name}.
%prep
%setup -q
+%patch0 -p1
%{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' i3-save-tree i3-migrate-config-to-v4 i3-dmenu-desktop
%build
diff --git a/i3-remember_ws_output.patch b/i3-remember_ws_output.patch
new file mode 100644
index 0000000..d753369
--- /dev/null
+++ b/i3-remember_ws_output.patch
@@ -0,0 +1,41 @@
+From d463eb0c2f630d026e9ced0f5f26616f1bf78bc0 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus at fastmail.com>
+Date: Thu, 18 Mar 2021 20:39:07 +0100
+Subject: [PATCH] Maintain runtime ws assignments after moving to output
+
+---
+ src/workspace.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/src/workspace.c b/src/workspace.c
+index 739358a8..94161a2e 100644
+--- a/src/workspace.c
++++ b/src/workspace.c
+@@ -1044,6 +1044,24 @@ void workspace_move_to_output(Con *ws, Output *output) {
+
+ ewmh_update_desktop_properties();
+
++ struct Workspace_Assignment *assignment;
++ bool assignment_found = false;
++ TAILQ_FOREACH (assignment, &ws_assignments, ws_assignments) {
++ if (strcmp(ws->name, assignment->name) == 0) {
++ FREE(assignment->output);
++ assignment->output = sstrdup(output_primary_name(output));
++ assignment_found = true;
++ break;
++ }
++ }
++
++ if (!assignment_found) {
++ assignment = scalloc(1, sizeof(struct Workspace_Assignment));
++ assignment->name = sstrdup(ws->name);
++ assignment->output = sstrdup(output_primary_name(output));
++ TAILQ_INSERT_TAIL(&ws_assignments, assignment, ws_assignments);
++ }
++
+ if (!previously_visible_ws) {
+ return;
+ }
+--
+2.31.0
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/i3.git/commitdiff/761e03e8b62e51cabb672129c6c10926b47aba31
More information about the pld-cvs-commit
mailing list