codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

Actions.DynamicWorkspaceGroups viewWSGroup changes which workspace has focus incorrectly #568

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When running viewWSGroup, the focus is set to whichever display is last in the 
windowset's visible set.  It would be better, IMHO, if focus were considered 
part of the WSGroup.  Simply reversing the list of workspaces should mean that 
the last greedyView serves to restore focus to the workspace (and screen) 
focused-at-group-creation-time.

--- old-XMonadContrib/XMonad/Actions/DynamicWorkspaceGroups.hs  2014-05-06 
20:26:25.919864085 -0400
+++ new-XMonadContrib/XMonad/Actions/DynamicWorkspaceGroups.hs  2014-05-06 
20:26:26.163865644 -0400
@@ -93,7 +93,7 @@
 -- | Give a name to the current workspace group.
 addCurrentWSGroup :: WSGroupId -> X ()
 addCurrentWSGroup name = withWindowSet $ \w ->
-  addWSGroup name $ map (W.tag . W.workspace) (W.current w : W.visible w)
+  addWSGroup name $ map (W.tag . W.workspace) (reverse $ W.current w : 
W.visible w)

 -- | Delete the named workspace group from the list of workspace
 --   groups.  Note that this has no effect on the workspaces involved;

A different, equally-defensible behavior, would be to consider the focus to not 
be part of the WSGroup and to hold the current focus across the viewWSGroup 
operation.  A wrapper like this may be useful:

holdScreenFocus a = do
  s <- gets (S.screen . S.current . windowset)
  r <- a
  screenWorkspace s >>= maybe (return ()) (windows . S.view)
  return r

Thanks!
--nwf;

Original issue reported on code.google.com by nwfila...@gmail.com on 7 May 2014 at 12:31

GoogleCodeExporter commented 8 years ago
Both these seem reasonable to me.  Does anyone else who uses 
DynamicWorkspaceGroups have a preference?

Original comment by byor...@gmail.com on 13 May 2014 at 1:33

GoogleCodeExporter commented 8 years ago
Since no one expressed an opinion, I went ahead and pushed the version with 
'reverse'.

Original comment by byor...@gmail.com on 13 Sep 2014 at 5:45