Hide border when switching to full screen

Hi,
Currently, if a window goes into full screen mode (e.g., if I hit "f" while
watching a youtube video in Chrome), I would like it to take up the entire
screen and also remove the window border. I have tried doing this with the
code snippets I've included below (full xmonad.hs
https://pastebin.com/uDqdETiF). However this only works partially. The
window resizes to take up the entire screen, including toggling struts.
However, the border does not toggle off. Is there anything I can do
differently? Thank you.
-- Define a function which toggles borders and also does full float
doFullFloatNoBorders :: ManageHook
doFullFloatNoBorders = do
liftX $ withFocused toggleBorder
doFullFloat
myManageHook :: [ManageHook]
myManageHook =
[ isFullscreen --> doFullFloatNoBorders
-- more rules
]
where role = stringProperty "WM_WINDOW_ROLE"
unfloat = ask >>= doF . W.sink
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ -- Toggle borders
((modMask .|. shiftMask, xK_b ), withFocused toggleBorder)
-- more key definitions
]
-- Main configuration
myConfig = ewmhFullscreen $ ewmh def
{ modMask = mod1Mask
, keys = myKeys
, manageHook = manageDocks <+> composeAll myManageHook
-- more configuration
}
-- Key binding to toggle the gap for the bar.
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask .|.
controlMask, xK_b)
main = xmonad =<< statusBar "xmonad" def toggleStrutsKey myConfig
--
*Eyal Erez <**oneself@gmail.com*

You don't handle app-initiated fullscreen mode. There's a rework of
EwmhDesktops somewhere that would let you register a handler for
`_NET_WM_STATE_FULLSCREEN` to toggle the border, but no ETA for it to land,
so you would have to use `handleEventHook` to watch for the `_NET_WM_STATE`
event being sent to the root window, extract the target window from it,
check that the requested state flag is `_NET_WM_STATE_FULLSCREEN`, and set
or toggle the border appropriately. See
https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm462011428...
at "To change the state of a mapped window".
On Sat, Jan 13, 2024 at 9:10 AM Eyal Erez
Hi,
Currently, if a window goes into full screen mode (e.g., if I hit "f" while watching a youtube video in Chrome), I would like it to take up the entire screen and also remove the window border. I have tried doing this with the code snippets I've included below (full xmonad.hs https://pastebin.com/uDqdETiF). However this only works partially. The window resizes to take up the entire screen, including toggling struts. However, the border does not toggle off. Is there anything I can do differently? Thank you.
-- Define a function which toggles borders and also does full float doFullFloatNoBorders :: ManageHook doFullFloatNoBorders = do liftX $ withFocused toggleBorder doFullFloat
myManageHook :: [ManageHook] myManageHook = [ isFullscreen --> doFullFloatNoBorders -- more rules ] where role = stringProperty "WM_WINDOW_ROLE" unfloat = ask >>= doF . W.sink
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ [ -- Toggle borders ((modMask .|. shiftMask, xK_b ), withFocused toggleBorder) -- more key definitions ]
-- Main configuration myConfig = ewmhFullscreen $ ewmh def { modMask = mod1Mask , keys = myKeys , manageHook = manageDocks <+> composeAll myManageHook -- more configuration } -- Key binding to toggle the gap for the bar. toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask .|. controlMask, xK_b)
main = xmonad =<< statusBar "xmonad" def toggleStrutsKey myConfig
-- *Eyal Erez <**oneself@gmail.com*
*>* There are 10 types of people, those who know binary and those who don't.
_______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
-- brandon s allbery kf8nh allbery.b@gmail.com

Brandon, On Sat, Jan 13, 2024 at 04:16:01PM -0500, Brandon Allbery wrote:
There's a rework of EwmhDesktops somewhere that would let you register a handler for `_NET_WM_STATE_FULLSCREEN` to toggle the border, but no ETA for it to land,
It's been in for a while: https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.17.1.9/XMonad-Hooks-Ew... But for Eyal's usecase smartBorders is a better solution I believe. But yeah, in theory you could use those hooks to explicitly toggle borders of windows being (un)fullscreened. -- Tomáš "liskin" ("Pivník") Janoušek, https://lisk.in/

smartBorders seems close enough to what I need.
On Sun, Jan 14, 2024 at 12:15 PM Tomas Janousek
Brandon,
On Sat, Jan 13, 2024 at 04:16:01PM -0500, Brandon Allbery wrote:
There's a rework of EwmhDesktops somewhere that would let you register a handler for _NET_WM_STATE_FULLSCREEN to toggle the border, but no ETA for it to land,
It's been in for a while:
https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.17.1.9/XMonad-Hooks-Ew...
But for Eyal's usecase smartBorders is a better solution I believe. But yeah, in theory you could use those hooks to explicitly toggle borders of windows being (un)fullscreened. --
Tomáš "liskin" ("Pivník") Janoušek, https://lisk.in/
--
*Eyal Erez <**oneself@gmail.com*

Hi, On Sat, Jan 13, 2024 at 04:10:07PM +0200, Eyal Erez wrote:
Currently, if a window goes into full screen mode (e.g., if I hit "f" while watching a youtube video in Chrome), I would like it to take up the entire screen and also remove the window border.
Try this: https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Layout-NoBorders.... I believe it does exactly what you want. -- Tomáš "liskin" ("Pivník") Janoušek, https://lisk.in/
participants (3)
-
Brandon Allbery
-
Eyal Erez
-
Tomas Janousek