mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
NamedWindows: if fetchName returns Nothing sets the name to resName ClassHint
fetchName may return a Nothing if the window's name contains multi byte characters. In such a case the resName string of the ClassHints of that window will be used instead.
This commit is contained in:
parent
3b66626801
commit
7ce8ed2f8b
@ -28,7 +28,7 @@ import Control.Monad.State ( gets )
|
|||||||
import qualified StackSet as W ( peek )
|
import qualified StackSet as W ( peek )
|
||||||
|
|
||||||
import Graphics.X11.Xlib
|
import Graphics.X11.Xlib
|
||||||
import Graphics.X11.Xlib.Extras ( fetchName )
|
import Graphics.X11.Xlib.Extras
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
|
|
||||||
@ -45,7 +45,8 @@ instance Show NamedWindow where
|
|||||||
show (NW n _) = n
|
show (NW n _) = n
|
||||||
|
|
||||||
getName :: Window -> X NamedWindow
|
getName :: Window -> X NamedWindow
|
||||||
getName w = asks display >>= \d -> do n <- maybe "" id `fmap` io (fetchName d w)
|
getName w = asks display >>= \d -> do s <- io $ getClassHint d w
|
||||||
|
n <- maybe (resName s) id `fmap` io (fetchName d w)
|
||||||
return $ NW n w
|
return $ NW n w
|
||||||
|
|
||||||
unName :: NamedWindow -> Window
|
unName :: NamedWindow -> Window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user