From 3fc026de3c1a7acc8a8d4a1be98401e519abcf9b Mon Sep 17 00:00:00 2001
From: Adam Vogt <vogt.adam@gmail.com>
Date: Tue, 1 Mar 2011 04:37:36 +0100
Subject: Fix xinerama workspace swapping with A.CopyWindow.killAllOtherCopies

Ignore-this: de5727d1248d94447c4634a05a90d1cc

Spotted by arlinius in #xmonad, and this only shows up for xinerama setups.
Using an algorithm that scales better with number of workspaces would probably
be shorter too (visiting them in turn, rather than doing random access), but
probably not worth the effort.

darcs-hash:20110301033736-1499c-682fd02d5794573ba2076878a625819d22b2ecb6.gz
---
 XMonad/Actions/CopyWindow.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'XMonad')

diff --git a/XMonad/Actions/CopyWindow.hs b/XMonad/Actions/CopyWindow.hs
index 49fa30c..191c17f 100644
--- a/XMonad/Actions/CopyWindow.hs
+++ b/XMonad/Actions/CopyWindow.hs
@@ -145,7 +145,9 @@ killAllOtherCopies = do ss <- gets windowset
       delFromAllButCurrent w ss = foldr ($) ss $
                                   map (delWinFromWorkspace w . W.tag) $
                                   W.hidden ss ++ map W.workspace (W.visible ss)
-      delWinFromWorkspace w wid = W.modify Nothing (W.filter (/= w)) . W.view wid
+      delWinFromWorkspace w wid = viewing wid $ W.modify Nothing (W.filter (/= w))
+
+      viewing wis f ss = W.view (W.currentTag ss) $ f $ W.view wis ss
 
 -- | A list of hidden workspaces containing a copy of the focused window.
 wsContainingCopies :: X [WorkspaceId]
-- 
cgit v1.2.3