]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 14 Sep 2012 11:18:04 +0000 (13:18 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 14 Sep 2012 11:18:04 +0000 (13:18 +0200)
src/con.c
src/scratchpad.c
testcases/t/198-regression-scratchpad-crash.t [new file with mode: 0644]

index cb756b6d4a63252ad49d1996803cb866ba35a073..1d86d73a9825f44d7cdb8ca7e98efcd4ad857e8d 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -678,7 +678,9 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
      * con focused. Otherwise, we leave the focus on the current workspace as we
      * don’t want to focus invisible workspaces */
     if (source_output != dest_output &&
-        workspace_is_visible(workspace)) {
+        workspace_is_visible(workspace) &&
+        workspace->name[0] != '_' &&
+        workspace->name[1] != '_') {
         DLOG("Moved to a different output, focusing target\n");
     } else {
         /* Descend focus stack in case focus_next is a workspace which can
index 6bba823fa2893512ad1f66924414935b08f0c744..5072280bf35b47fbc1b99c55e0f234c83a445740 100644 (file)
@@ -60,7 +60,8 @@ void scratchpad_move(Con *con) {
 
     /* 4: Fix focus. Normally, when moving a window to a different output, the
      * destination output gets focused. In this case, we don’t want that. */
-    con_focus(focus_next);
+    if (con_get_workspace(focus_next) == con_get_workspace(focused))
+        con_focus(focus_next);
 }
 
 /*
diff --git a/testcases/t/198-regression-scratchpad-crash.t b/testcases/t/198-regression-scratchpad-crash.t
new file mode 100644 (file)
index 0000000..8f732ba
--- /dev/null
@@ -0,0 +1,19 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+# When using a command which moves a window to scratchpad from an invisible
+# (e.g. unfocused) workspace and immediately shows that window again, i3
+# crashed.
+# Bug still in: 4.2-305-g22922a9
+use i3test;
+
+my $ws1 = fresh_workspace;
+my $invisible_window = open_window;
+my $other_focusable_window = open_window;
+
+my $ws2 = fresh_workspace;
+my $id = $invisible_window->id;
+cmd qq|[id="$id"] move scratchpad, scratchpad show|;
+
+does_i3_live;
+
+done_testing;