]> git.pld-linux.org Git - packages/i3.git/commitdiff
add patch for remembering workspace<->output assignment; rel 2 auto/th/i3-4.19.2-2
authorJan Palus <atler@pld-linux.org>
Sat, 20 Mar 2021 10:53:28 +0000 (11:53 +0100)
committerJan Palus <atler@pld-linux.org>
Sat, 20 Mar 2021 10:53:28 +0000 (11:53 +0100)
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 [new file with mode: 0644]
i3.spec

diff --git a/i3-remember_ws_output.patch b/i3-remember_ws_output.patch
new file mode 100644 (file)
index 0000000..d753369
--- /dev/null
@@ -0,0 +1,41 @@
+From d463eb0c2f630d026e9ced0f5f26616f1bf78bc0 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@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
+
diff --git a/i3.spec b/i3.spec
index 3e117435e142616dee47527a58f8bc473704c573..1669faa38ef37634b05e570815d77685deed86cb 100644 (file)
--- 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
This page took 0.14258 seconds and 4 git commands to generate.