mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
vanadium/xmonad: check if current before move
This commit is contained in:
parent
09d5f8e0c8
commit
587b4a4e20
1 changed files with 14 additions and 14 deletions
|
|
@ -151,23 +151,23 @@ myManageHook =
|
||||||
myEventHandleHook :: Event -> X All
|
myEventHandleHook :: Event -> X All
|
||||||
myEventHandleHook =
|
myEventHandleHook =
|
||||||
-- TODO: is there a way to always open certain sites in new windows in firefox?
|
-- TODO: is there a way to always open certain sites in new windows in firefox?
|
||||||
|
-- TODO: stop full screen when move happens
|
||||||
onTitleChange $ composeAll
|
onTitleChange $ composeAll
|
||||||
[ isSpotify --> doShiftAndViewIfMoved multimediaWS
|
[ isSpotify --> doShiftAndViewIfCurrent multimediaWS
|
||||||
, isYouTube --> doShiftAndViewIfMoved multimediaWS
|
, isYouTube --> doShiftAndViewIfCurrent multimediaWS
|
||||||
, isDiscord --> doShiftAndViewIfMoved chatWS
|
, isDiscord --> doShiftAndViewIfCurrent chatWS
|
||||||
, isWhatsApp --> doShiftAndViewIfMoved chatWS
|
, isWhatsApp --> doShiftAndViewIfCurrent chatWS
|
||||||
, isElement --> doShiftAndViewIfMoved chatWS
|
, isElement --> doShiftAndViewIfCurrent chatWS
|
||||||
]
|
]
|
||||||
|
|
||||||
-- If the title changes in the background, we don't want to greedy view that workspace.
|
-- | If the title changes in the background, we don't want to greedy view that workspace.
|
||||||
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
||||||
-- We prevent this by checking if the window is already there.
|
-- We prevent this by checking if the window is in the current workspace
|
||||||
doShiftAndViewIfMoved :: WorkspaceId -> Query (Endo WindowSet)
|
doShiftAndViewIfCurrent :: WorkspaceId -> Query (Endo WindowSet)
|
||||||
doShiftAndViewIfMoved n = doF . shiftAndViewIfMoved n =<< ask
|
doShiftAndViewIfCurrent n = doF . go =<< ask
|
||||||
|
where go :: Window -> WindowSet -> WindowSet
|
||||||
shiftAndViewIfMoved :: WorkspaceId -> Window -> WindowSet -> WindowSet
|
go w s = case W.findTag w s of
|
||||||
shiftAndViewIfMoved n w s = case W.findTag w s of
|
Just from | from == W.currentTag s -> W.greedyView n $ W.shiftWin n w s
|
||||||
Just from | n `W.tagMember` s && n /= from -> W.greedyView n $ W.shiftWin n w s
|
|
||||||
_ -> s
|
_ -> s
|
||||||
|
|
||||||
myStartupHook :: X ()
|
myStartupHook :: X ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue