Reputation: 1015
I am looking for a way to replicate the behaviour of doCenterFloat
in my managehook to a keybinding.
I would like to keep the windows 'natural' size. For example, when i create an OpenGL window with size 800x600, I would manually have to add the title of the window to my XMonad config, otherwise it would be tiled and the contents of the window would be stretched.
Here is the code i am trying to replicate to a key binding
myManageHook = composeAll
[ title =? "OpenGL" --> doCenterFloat ]
The above code makes the window display correctly. I have tried functions that toggle a normal float (not centerFloat) but they display at the tiled sized, like this Xmonad: Float and resize windows to its “natural size
Any help is much appreciated
Upvotes: 1
Views: 178
Reputation: 33881
runQuery :: Query a -> Window -> X a
http://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Config-Prime.html#v:runQuery
withFocused :: (Window -> X ()) -> X ()
http://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Config-Prime.html#v:withFocused
Using the above two functions, where myQuery
would be set your your Query
(like doCenterFloat
).
myQuery = undefined :: Query
withFocused (\window -> runQuery myQuery window)
Upvotes: 1