-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NamedScratchpads somewhat broken. #728
Comments
Are you using NamedScratchpad or standard Scratchpad? I suspected the new scratchpad implementation would break the latter, and I'm surprised it's taken this long for a report to come in. |
Sorry, I missed the title. I've been using several NamedScratchpads without issue since that commit, so I'm not sure what could be wrong. |
Could you perhaps try to produce a (minimal) example with which you can reproduce this? Much like @geekosaur, I've been using scratchpads extensively since this commit and I've never noticed this |
ok, so: fmSP, ghciSP, ocamlSP, musicSP, terminalSP :: String
fmSP = "FFF"
ghciSP = "GHCI"
ocamlSP = "OCaml"
musicSP = "Music"
terminalSP = "Terminal"
scratchpads :: [NamedScratchpad]
scratchpads = [ NS { name = ghciSP
, query = isGHCI
, cmd = spawnGHCI
, hook = centerFloat
}
, NS { name = ocamlSP
, query = isOcaml
, cmd = spawnOcaml
, hook = centerFloat
}
, NS { name = musicSP
, query = isMusic
, cmd = spawnMusic
, hook = centerFloat
}
, NS { hook = topFloat
, name = terminalSP
, query = isTerminal
, cmd = spawnTerminal
}
, NS { name = fmSP
, query = isFM
, cmd = spawnFM
, hook = centerFloat
}
] where
spawnFM, spawnGHCI, spawnOcaml, spawnMusic, spawnTerminal :: String
spawnFM = unwords [term, "-c", fmSP, "-e", files]
spawnGHCI = unwords [term, "-c", ghciSP, "-e", "stack exec -- ghci", "-v0", "-ghci-script", configHome </> "ghci/ghci.conf"]
spawnOcaml = unwords [term, "-c", ocamlSP, "-e", "myutop"]
spawnMusic = unwords [term, "-c", musicSP, "-e", music]
spawnTerminal = unwords [term, "-c", terminalSP]
isFM, isGHCI, isOcaml, isMusic, isTerminal :: Query Bool
isFM = className =? fmSP
isGHCI = className =? ghciSP
isOcaml = className =? ocamlSP
isMusic = className =? musicSP
isTerminal = className =? terminalSP
topFloat, centerFloat :: ManageHook
topFloat = customFloating $ RationalRect 0 0 1 0.45
centerFloat = customFloating $ RationalRect (1/6) (1/6) (2/3) (2/3) thats the scratchpad part and the calling i do with the function |
This isn't quite enough information. You might want to compare to how I use them in my config; note in particular lines 56–74 (definition), 122 ( |
windowManager = mconcat [ tileBelow
, transience'
, manageSpawn
, manageHook def
, isRole =? "About" --> doCenterFloat
, namedScratchpadManageHook scratchpads
, isRole =? "pop-up" --> forceCenterFloat
, className =? "Sxiv" --> hasBorder False
, className =? "Picker" --> doCenterFloat
, isName =? "Library" --> forceCenterFloat
, className =? "Places" --> forceCenterFloat
, className =? "New VM" --> forceCenterFloat
, className =? "Ripcord" --> shiftFocus (at 5)
, className =? "discord" --> shiftFocus (at 5)
, className =? "Filezilla" --> shiftFocus (at 6)
, className =? "qutebrowser" --> shiftFocus (at 2)
, className =? "Signal Beta" --> shiftFocus (at 5)
, isDialog --> mconcat [doF siftUp, doCenterFloat]
, isName =? "Picture-in-Picture" --> forceCenterFloat
, className =? "TelegramDesktop" --> shiftFocus (at 5)
, className =? "mpv" --> mconcat [doF siftUp, unFloat]
, isRole =? "GtkFileChooserDialog" --> forceCenterFloat
, className =? "st-float" --> mconcat [doFocus, doFloat]
, className =? "Ripcord" <&&> isName =? "Preferences" --> forceCenterFloat
, className =? "help" --> mconcat [forceCenterFloat, doF siftUp, hasBorder False]
, isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_SPLASH" --> doCenterFloat
] this is my managehook |
Could you perhaps post a _complete_ minimal example that we can just
copy-paste into an xmonad.hs file? Just snippets won't really do us any
good (as in, not much more than you posting your entire configuration).
|
import XMonad
import XMonad.Util.NamedScratchpad
musicSP :: String
musicSP = "Music"
music :: String
music = "ncmpcpp"
term :: String
term = "st"
scratchpads :: [NamedScratchpad]
scratchpads = [ NS { name = musicSP
, query = isMusic
, cmd = spawnMusic
, hook = centerFloat
}
] where
spawnMusic :: String
spawnMusic = unwords [term, "-c", musicSP, "-e", music]
isMusic:: Query Bool
isMusic = className =? musicSP
centerFloat :: ManageHook
centerFloat = customFloating $ RationalRect (1/6) (1/6) (2/3) (2/3)
keymap :: XConfig l -> Map (KeyMask, KeySym) (X ())
keymap _ = fromList [ ((mod4Mask, xK_w), withFocused killWindow)
, ((mod4Mask, xK_m), namedScratchpadAction scratchpads musicSP)
]
managehook :: ManageHook
managehook = composeAll [ manageHook def
, namedScratchpadManageHook scratchpads
]
main :: IO ()
main = xmonad $ def { manageHook = managehook
, keys = keymap
} |
is that good? |
Yes, thank you! Since the scratchpads are now added in |
The root window (singular) is always mapped and behaves as if it were |
Yeah I was expecting that someone would have reported it already too. |
Tho it might be just my setup thats breaking. |
Since 3fc830a, scratchpads are now added in namedScratchpadManageHook. This, however, means that we need some kind of MapRequestEvent to happen before processing scratchpads, otherwise the manageHook didn't run yet and our extensible state is being left empty. When trying to open a scratchpad right after starting xmonad—i.e., before having opened a window—this may not be the case. Fixes: xmonad#728
Since 3fc830a, scratchpads are now added in namedScratchpadManageHook. This, however, means that we need some kind of MapRequestEvent to happen before processing scratchpads, otherwise the manageHook didn't run yet and our extensible state is being left empty. When trying to open a scratchpad right after starting xmonad—i.e., before having opened a window—this may not be the case. Fixes: xmonad#728
Fixed by #730. |
Since 3fc830a, scratchpads are now added in namedScratchpadManageHook. This, however, means that we need some kind of MapRequestEvent to happen before processing scratchpads, otherwise the manageHook didn't run yet and our extensible state is being left empty. When trying to open a scratchpad right after starting xmonad—i.e., before having opened a window—this may not be the case. Fixes: xmonad#728
Since 3fc830a, scratchpads are now added in namedScratchpadManageHook. This, however, means that we need some kind of MapRequestEvent to happen before processing scratchpads, otherwise the manageHook didn't run yet and our extensible state is being left empty. When trying to open a scratchpad right after starting xmonad—i.e., before having opened a window—this may not be the case. Fixes: xmonad#728
Since 3fc830a, scratchpads are now added in namedScratchpadManageHook. This, however, means that we need some kind of MapRequestEvent to happen before processing scratchpads, otherwise the manageHook didn't run yet and our extensible state is being left empty. When trying to open a scratchpad right after starting xmonad—i.e., before having opened a window—this may not be the case. Fixes: xmonad#728
Problem Description
After commit 3fc830a my scratchpads suddenly stopped working after I restarted the window manager, it does however fix itself after opening a new window but having to do that after every time I restart the wm and want to bring my scratchpad is kinda... annoying, don't you think?
Steps to Reproduce
Run a version of xmonad-contrib pushed after the 1st of April, restart the window manager and then press your scratchpad keybind.
Configuration File
Quite difficult to post here since my setup is split into multiple files, so you better take a look at my dotfiles
Checklist
I've read CONTRIBUTING.md
I tested my configuration
xmonad
version 0.17 (commit master)xmonad-contrib
version 0.17 (commit master and the one mentioned above)The text was updated successfully, but these errors were encountered: