From 65e9036837f18f39135d4f8dcaa1104b8ea46d79 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 9 May 2010 23:20:49 +0200 Subject: [PATCH] =?utf8?q?bugfix:=20don=E2=80=99t=20clean=20up=20workspace?= =?utf8?q?=20when=20switching=20to=20the=20same=20workspace?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/workspace.c | 2 ++ testcases/t/17-workspace.t | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/workspace.c b/src/workspace.c index 9b5593d6..1829370c 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -101,6 +101,8 @@ void workspace_show(const char *num) { old = con_get_workspace(focused); workspace = workspace_get(num); + if (workspace == old) + return; workspace->fullscreen_mode = CF_OUTPUT; /* disable fullscreen */ TAILQ_FOREACH(current, &(workspace->parent->nodes_head), nodes) diff --git a/testcases/t/17-workspace.t b/testcases/t/17-workspace.t index c350d9d9..bb30bd02 100644 --- a/testcases/t/17-workspace.t +++ b/testcases/t/17-workspace.t @@ -4,7 +4,7 @@ # Tests whether we can switch to a non-existant workspace # (necessary for further tests) # -use i3test tests => 2; +use i3test tests => 3; use v5.10; my $i3 = i3("/tmp/nestedcons"); @@ -33,4 +33,9 @@ diag("Other temporary workspace name: $otmp\n"); $i3->command("workspace $otmp")->recv; ok(!workspace_exists($tmp), 'old workspace cleaned up'); +# Switch to the same workspace again to make sure it doesn’t get cleaned up +$i3->command("workspace $otmp")->recv; +$i3->command("workspace $otmp")->recv; +ok(workspace_exists($otmp), 'other workspace still exists'); + diag( "Testing i3, Perl $], $^X" ); -- 2.39.5