Copyright | (c) Spencer Janssen 2007 |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | dons@cse.unsw.edu.au |
Stability | unstable |
Portability | not portable, Typeable deriving, mtl, posix |
Safe Haskell | None |
Language | Haskell98 |
Operations.
Synopsis
- manage :: Window -> X ()
- unmanage :: Window -> X ()
- killWindow :: Window -> X ()
- kill :: X ()
- windows :: (WindowSet -> WindowSet) -> X ()
- modifyWindowSet :: (WindowSet -> WindowSet) -> X ()
- windowBracket :: (a -> Bool) -> X a -> X a
- windowBracket_ :: X Any -> X ()
- scaleRationalRect :: Rectangle -> RationalRect -> Rectangle
- setWMState :: Window -> Int -> X ()
- setWindowBorderWithFallback :: Display -> Window -> String -> Pixel -> X ()
- hide :: Window -> X ()
- reveal :: Window -> X ()
- setInitialProperties :: Window -> X ()
- refresh :: X ()
- clearEvents :: EventMask -> X ()
- tileWindow :: Window -> Rectangle -> X ()
- containedIn :: Rectangle -> Rectangle -> Bool
- nubScreens :: [Rectangle] -> [Rectangle]
- getCleanedScreenInfo :: MonadIO m => Display -> m [Rectangle]
- rescreen :: X ()
- setButtonGrab :: Bool -> Window -> X ()
- setTopFocus :: X ()
- focus :: Window -> X ()
- setFocusX :: Window -> X ()
- sendMessage :: Message a => a -> X ()
- broadcastMessage :: Message a => a -> X ()
- sendMessageWithNoRefresh :: Message a => a -> Workspace WorkspaceId (Layout Window) Window -> X ()
- updateLayout :: WorkspaceId -> Maybe (Layout Window) -> X ()
- setLayout :: Layout Window -> X ()
- screenWorkspace :: ScreenId -> X (Maybe WorkspaceId)
- withFocused :: (Window -> X ()) -> X ()
- isClient :: Window -> X Bool
- extraModifiers :: X [KeyMask]
- cleanMask :: KeyMask -> X KeyMask
- initColor :: Display -> String -> IO (Maybe Pixel)
- data StateFile = StateFile {
- sfWins :: StackSet WorkspaceId String Window ScreenId ScreenDetail
- sfExt :: [(String, String)]
- writeStateToFile :: X ()
- readStateFile :: (LayoutClass l Window, Read (l Window)) => XConfig l -> X (Maybe XState)
- migrateState :: (Functor m, MonadIO m) => String -> String -> m ()
- restart :: String -> Bool -> X ()
- floatLocation :: Window -> X (ScreenId, RationalRect)
- pointScreen :: Position -> Position -> X (Maybe (Screen WorkspaceId (Layout Window) Window ScreenId ScreenDetail))
- pointWithin :: Position -> Position -> Rectangle -> Bool
- float :: Window -> X ()
- mouseDrag :: (Position -> Position -> X ()) -> X () -> X ()
- mouseMoveWindow :: Window -> X ()
- mouseResizeWindow :: Window -> X ()
- type D = (Dimension, Dimension)
- mkAdjust :: Window -> X (D -> D)
- applySizeHints :: Integral a => Dimension -> SizeHints -> (a, a) -> D
- applySizeHintsContents :: Integral a => SizeHints -> (a, a) -> D
- applySizeHints' :: SizeHints -> D -> D
- applyAspectHint :: (D, D) -> D -> D
- applyResizeIncHint :: D -> D -> D
- applyMaxSizeHint :: D -> D -> D
Documentation
manage :: Window -> X () Source #
Window manager operations manage. Add a new window to be managed in the current workspace. Bring it into focus.
Whether the window is already managed, or not, it is mapped, has its border set, and its event mask set.
unmanage :: Window -> X () Source #
unmanage. A window no longer exists, remove it from the window list, on whatever workspace it is.
killWindow :: Window -> X () Source #
Kill the specified window. If we do kill it, we'll get a delete notify back from X.
There are two ways to delete a window. Either just kill it, or if it supports the delete protocol, send a delete event (e.g. firefox)
windows :: (WindowSet -> WindowSet) -> X () Source #
windows. Modify the current window list with a pure function, and refresh
modifyWindowSet :: (WindowSet -> WindowSet) -> X () Source #
Modify the WindowSet
in state with no special handling.
windowBracket :: (a -> Bool) -> X a -> X a Source #
Perform an X
action and check its return value against a predicate p.
If p holds, unwind changes to the WindowSet
and replay them using windows
.
windowBracket_ :: X Any -> X () Source #
A version of windowBracket
that discards the return value, and handles an
X
action reporting its need for refresh via Any
.
scaleRationalRect :: Rectangle -> RationalRect -> Rectangle Source #
Produce the actual rectangle from a screen and a ratio on that screen.
setWindowBorderWithFallback :: Display -> Window -> String -> Pixel -> X () Source #
Set the border color using the window's color map, if possible,
otherwise fallback to the color in Pixel
.
reveal :: Window -> X () Source #
reveal. Show a window by mapping it and setting Normal this is harmless if the window was already visible
setInitialProperties :: Window -> X () Source #
Set some properties when we initially gain control of a window
refresh. Render the currently visible workspaces, as determined by
the StackSet
. Also, set focus to the focused window.
This is our view
operation (MVC), in that it pretty prints our model
with X calls.
clearEvents :: EventMask -> X () Source #
clearEvents. Remove all events of a given type from the event queue.
tileWindow :: Window -> Rectangle -> X () Source #
tileWindow. Moves and resizes w such that it fits inside the given rectangle, including its border.
containedIn :: Rectangle -> Rectangle -> Bool Source #
Returns True
if the first rectangle is contained within, but not equal
to the second.
nubScreens :: [Rectangle] -> [Rectangle] Source #
Given a list of screens, remove all duplicated screens and screens that are entirely contained within another.
getCleanedScreenInfo :: MonadIO m => Display -> m [Rectangle] Source #
Cleans the list of screens according to the rules documented for nubScreens.
rescreen. The screen configuration may have changed (due to xrandr), update the state and refresh the screen, and reset the gap.
setButtonGrab :: Bool -> Window -> X () Source #
setButtonGrab. Tell whether or not to intercept clicks on a given window
setTopFocus :: X () Source #
Set the focus to the window on top of the stack, or root
focus :: Window -> X () Source #
Set focus explicitly to window w
if it is managed by us, or root.
This happens if X notices we've moved the mouse (and perhaps moved
the mouse to a new screen).
sendMessage :: Message a => a -> X () Source #
Throw a message to the current LayoutClass
possibly modifying how we
layout the windows, in which case changes are handled through a refresh.
broadcastMessage :: Message a => a -> X () Source #
Send a message to all layouts, without refreshing.
sendMessageWithNoRefresh :: Message a => a -> Workspace WorkspaceId (Layout Window) Window -> X () Source #
Send a message to a layout, without refreshing.
updateLayout :: WorkspaceId -> Maybe (Layout Window) -> X () Source #
Update the layout field of a workspace
screenWorkspace :: ScreenId -> X (Maybe WorkspaceId) Source #
Return workspace visible on screen sc
, or Nothing
.
withFocused :: (Window -> X ()) -> X () Source #
Apply an X
operation to the currently focused window, if there is one.
extraModifiers :: X [KeyMask] Source #
Combinations of extra modifier masks we need to grab keys/buttons for. (numlock and capslock)
A type to help serialize xmonad's state to a file.
StateFile | |
|
writeStateToFile :: X () Source #
Write the current window state (and extensible state) to a file so that xmonad can resume with that state intact.
readStateFile :: (LayoutClass l Window, Read (l Window)) => XConfig l -> X (Maybe XState) Source #
Read the state of a previous xmonad instance from a file and return that state. The state file is removed after reading it.
migrateState :: (Functor m, MonadIO m) => String -> String -> m () Source #
Deprecated: will be removed some point in the future.
Migrate state from a previously running xmonad instance that used
the older --resume
technique.
floatLocation :: Window -> X (ScreenId, RationalRect) Source #
Floating layer support
Given a window, find the screen it is located on, and compute the geometry of that window wrt. that screen.
pointScreen :: Position -> Position -> X (Maybe (Screen WorkspaceId (Layout Window) Window ScreenId ScreenDetail)) Source #
Given a point, determine the screen (if any) that contains it.
pointWithin :: Position -> Position -> Rectangle -> Bool Source #
pointWithin x y r
returns True
if the (x, y)
co-ordinate is within
r
.
mouseMoveWindow :: Window -> X () Source #
drag the window under the cursor with the mouse while it is dragged
mouseResizeWindow :: Window -> X () Source #
resize the window under the cursor with the mouse while it is dragged
mkAdjust :: Window -> X (D -> D) Source #
Given a window, build an adjuster function that will reduce the given dimensions according to the window's border width and size hints.
applySizeHints :: Integral a => Dimension -> SizeHints -> (a, a) -> D Source #
Reduce the dimensions if needed to comply to the given SizeHints, taking window borders into account.
applySizeHintsContents :: Integral a => SizeHints -> (a, a) -> D Source #
Reduce the dimensions if needed to comply to the given SizeHints.
applyAspectHint :: (D, D) -> D -> D Source #
Reduce the dimensions so their aspect ratio falls between the two given aspect ratios.