The problem is that toggleWS simply assumes that the "previous workspace"
is the one
at the head of xmonad's internal list of hidden workspaces. But there are
operations other than switching away from a workspace which will also place
it at the
head of this list. There is nothing special about scratchpads here; if you
window on the current workspace to another workspace, that other workspace
be the "previous workspace" as far as toggleWS is concerned.
The real problem is that the order of workspaces in xmonad's list of hidden
workspaces is not really supposed to mean anything, so toggleWS is
undefined behavior. The only way to really fix this would be to have
the workspace history itself.
Here's a sketch of a possible solution: CycleWS could use the new
extensible state to
track the workspace history, and provide something to put in the logHook
notify CycleWS every time the current workspace changes. (It would be nicer
putting something in the logHook was not necessary, but otherwise it is not
CycleWS would find out about workspace changes.)
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
Attached is an implementation of Brent's idea. It's backwards-compatible:
the toggling behaviour should remain exactly the same for all users that
don't install the supplied logHook. I've also written it as a separate
module so that other modules can make use of it, since it's not a