Don't change the ordering of the window list we get from _NET_CLIENT_LIST, as that is the order we tab through
This commit is contained in:
parent
0b92eda1bb
commit
4292cbce3e
2 changed files with 8 additions and 11 deletions
|
@ -317,7 +317,7 @@ taskbarRunner :: Phi -> Display -> IO ()
|
|||
taskbarRunner phi dispvar = do
|
||||
let screens = getScreens dispvar
|
||||
(windows, states, icons, scaledIcons, windowScreens) <- liftIO $ withDisplay dispvar $ \disp -> do
|
||||
(windows, states, icons, scaledIcons, windowScreens) <- getWindowStates disp screens (getAtoms dispvar) [] M.empty M.empty M.empty M.empty
|
||||
(windows, states, icons, scaledIcons, windowScreens) <- getWindowStates disp screens (getAtoms dispvar) M.empty M.empty M.empty M.empty
|
||||
desktopCount <- getDesktopCount disp (getAtoms dispvar)
|
||||
current <- getCurrentDesktop disp (getAtoms dispvar)
|
||||
activeWindow <- getActiveWindow disp (getAtoms dispvar)
|
||||
|
@ -367,7 +367,7 @@ handleEvent phi dispvar XExtras.PropertyEvent {XExtras.ev_atom = atom, XExtras.e
|
|||
sendMessage phi Repaint
|
||||
when (atom == atom_NET_CLIENT_LIST atoms) $ do
|
||||
(windows, windowStates, icons, scaledIcons, windowScreens) <- get
|
||||
(windows', windowStates', icons', scaledIcons', windowScreens') <- liftIO $ getWindowStates disp screens atoms windows windowStates icons scaledIcons windowScreens
|
||||
(windows', windowStates', icons', scaledIcons', windowScreens') <- liftIO $ getWindowStates disp screens atoms windowStates icons scaledIcons windowScreens
|
||||
|
||||
when (windows /= windows') $ do
|
||||
sendMessage phi $ WindowListUpdate windows' windowStates' icons' scaledIcons' windowScreens'
|
||||
|
@ -425,10 +425,10 @@ getActiveWindow :: Xlib.Display -> Atoms -> IO Window
|
|||
getActiveWindow disp atoms =
|
||||
liftM (fromIntegral . fromMaybe 0 . join . fmap listToMaybe) $ XExtras.getWindowProperty32 disp (atom_NET_ACTIVE_WINDOW atoms) $ Xlib.defaultRootWindow disp
|
||||
|
||||
getWindowStates :: Xlib.Display -> [Xlib.Rectangle] -> Atoms -> [Window] -> M.Map Window WindowState -> M.Map Window [(Int, Surface)] -> M.Map Window (IORef (Maybe (Int, Surface))) -> M.Map Window Xlib.Rectangle
|
||||
getWindowStates :: Xlib.Display -> [Xlib.Rectangle] -> Atoms -> M.Map Window WindowState -> M.Map Window [(Int, Surface)] -> M.Map Window (IORef (Maybe (Int, Surface))) -> M.Map Window Xlib.Rectangle
|
||||
-> IO ([Window], M.Map Window WindowState, M.Map Window [(Int, Surface)], M.Map Window (IORef (Maybe (Int, Surface))), M.Map Window Xlib.Rectangle)
|
||||
getWindowStates disp screens atoms oldWindows windowStates windowIcons windowScaledIcons windowScreens = do
|
||||
windows <- getWindowList disp atoms oldWindows
|
||||
getWindowStates disp screens atoms windowStates windowIcons windowScaledIcons windowScreens = do
|
||||
windows <- getWindowList disp atoms
|
||||
|
||||
let windowStates' = map (\w -> (w, M.lookup w windowStates)) windows
|
||||
windowIcons' = map (\w -> (w, M.lookup w windowIcons)) windows
|
||||
|
@ -543,11 +543,8 @@ showWindow disp atoms window = do
|
|||
]
|
||||
|
||||
|
||||
getWindowList :: Xlib.Display -> Atoms -> [Window] -> IO [Window]
|
||||
getWindowList disp atoms windows = do
|
||||
newWindows <- liftM (map fromIntegral . join . maybeToList) $ XExtras.getWindowProperty32 disp (atom_NET_CLIENT_LIST atoms) $ Xlib.defaultRootWindow disp
|
||||
return $ (filter (flip elem newWindows) windows) ++ (filter (not . flip elem windows) newWindows)
|
||||
|
||||
getWindowList :: Xlib.Display -> Atoms -> IO [Window]
|
||||
getWindowList disp atoms = liftM (map fromIntegral . join . maybeToList) $ XExtras.getWindowProperty32 disp (atom_NET_CLIENT_LIST atoms) $ Xlib.defaultRootWindow disp
|
||||
|
||||
taskbar :: TaskbarConfig -> Widget
|
||||
taskbar config = do
|
||||
|
|
|
@ -41,7 +41,7 @@ main = do
|
|||
}
|
||||
|
||||
|
||||
theTaskbar = taskbar defaultTaskbarConfig { normalTaskStyle = taskStyle {taskIconStyle = desaturateIconStyle 0.7}
|
||||
theTaskbar = taskbar defaultTaskbarConfig { normalTaskStyle = taskStyle {taskIconStyle = desaturateIconStyle 0.6}
|
||||
, activeTaskStyle = taskStyle {taskBorder = activeTaskBorder}
|
||||
, desktopStyle = Just (normalDesktopStyle, currentDesktopStyle)
|
||||
}
|
||||
|
|
Reference in a new issue