하나xprop
이러한 창을 호출하면 _NET_WM_STATE
속성에 다음 두 플래그가 표시됩니다.
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE, _NET_WM_STATE_STICKY
...
WM_NAME(UTF8_STRING) = "Picture in picture"
_NET_WM_NAME(UTF8_STRING) = "Picture in picture"
우리가 어떻게 설정했는지xmonad두 플래그를 모두 존중하시겠습니까?
답변1
해결책은 다음과 같습니다.
- 창을
_NET_WM_STATE_ABOVE
부동으로 표시합니다. - 표시된 창을
_NET_WM_STATE_STICKY
모든 작업 공간에 복사합니다.
import Data.Maybe ( fromMaybe )
import XMonad.Actions.CopyWindow ( copyToAll )
import XMonad.Util.WindowProperties ( getProp32 )
-- Other standard xmonad imports omitted.
myManageHook =
composeAll
$ [ hasNetWMState "_NET_WM_STATE_ABOVE" --> doFloat
, hasNetWMState "_NET_WM_STATE_STICKY" --> doF copyToAll
, ...
]
where
-- | Get the `_NET_WM_STATE` property as a list of atoms.
getNetWMState :: Window -> X [Atom]
getNetWMState w = do
atom <- getAtom "_NET_WM_STATE"
map fromIntegral . fromMaybe [] <$> getProp32 atom w
hasNetWMState :: String -> Query Bool
hasNetWMState state = do
window <- ask
wmstate <- liftX $ getNetWMState window
atom <- liftX $ getAtom state
return $ elem atom wmstate