[xmonad] ManageHook and child windows

Matthew Hague matthewhague at zoho.com
Sun Jul 8 16:34:07 CEST 2012


> >>> On Sat, Jun 23, 2012 at 2:30 PM, Raghavendra D Prabhu
> >>> <raghu.prabhu13 at gmail.com> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> I am using ManageHook to assign windows to workspaces; however,
> >>>> sometimes I
> >>>> tend to move the window to other workspace and after that happens, any
> >>>> dialog/child window  of this window appears in the original assigned
> >>>> workspace and not in the new workspace.
> >>>>
> >>>> Is there a way to fix / workaround this?

Not really a fix to the problem, but my workaround for this is to use
manageHook to say which workspaces Firefox should *not* appear on, rather than
which ones it should appear on.  Whether this makes sense for you depends on
your set up really.  So i have something like this in my manageHooks:


    myManageHook = composeOne . concat $ 
               [ [ resource =? t -?> doViewShift specialWorkspace1 | t <- mySpecials1 ] 
               [ [ resource =? t -?> doViewShift specialWorkspace2 | t <- mySpecials2 ] 
               , [ fmap Just doAvoidSpecial ] ]
               where 
                   doViewShift = doF . viewShift
                   viewShift = liftM2 (.) W.greedyView W.shift
                   doAvoidSpecial = doF avoidSpecial 
                   avoidSpecial ss = viewShift ws ss
                                     where
                                         curws = W.currentTag ss
                                         ws = if (curws `elem` mySpecialWorkspaces)
                                              then defaultWorkspace
                                              else curws

where viewShift was taken from the online tutorials, and composeOne comes from managehelpers.

Matt



More information about the xmonad mailing list