Skip to content

Commit

Permalink
Fix fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
texttheater committed Jul 28, 2019
1 parent d32cd9f commit ba91dd4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
14 changes: 10 additions & 4 deletions README.md
Expand Up @@ -18,10 +18,16 @@ and indicators.
Recent Ubuntu releases support this requirement *almost* out of the box, thanks
to a dedicated GNOME Flashback session that uses xmonad as the window manager.
However, with an empty configuration, you won't have panels. With the default
`XMonad.Config.Gnome`, many keybindings won't work properly due to conflicts
with GNOME keybindings or bugs. So I thought I'd put together a curated minimal
xmonad config that fixes these issues but otherwise gives you a clean slate to
add your own favorite configuration options.
`XMonad.Config.Gnome`, there are still some unacceptable problems:

* Many keybindings won't work properly due to conflicts with GNOME keybindings
or bugs.
* Applications going fullscreen (like media players or browsers) is not
supported.

So I thought I'd put together a curated minimal xmonad config that fixes these
issues but otherwise gives you a clean slate to add your own favorite
configuration options.

Setup
-----
Expand Down
35 changes: 34 additions & 1 deletion xmonad.hs
@@ -1,13 +1,46 @@
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName (setWMName)
import XMonad.Util.EZConfig
import XMonad.Util.Run

main = xmonad $ gnomeConfig {
-- Use Win key rather than Alt. Alt is used by GNOME for many things.
modMask = mod4Mask
modMask = mod4Mask,
startupHook = composeAll [
startupHook gnomeConfig,
-- fix fullscreen for Firefox
-- https://gist.github.com/sboehler/5f48017a6b53805485180a9a6d81196b
setFullscreenSupported
],
handleEventHook = composeAll [
handleEventHook gnomeConfig,
-- fix fullscreen
fullscreenEventHook
]
} `additionalKeys` [
-- Workaround for
-- https://bugs.launchpad.net/ubuntu/+source/xmonad/+bug/1813049
((mod4Mask .|. shiftMask, xK_q), spawn "gnome-session-quit --logout")
]

setFullscreenSupported :: X ()
setFullscreenSupported = withDisplay $ \dpy -> do
r <- asks theRoot
a <- getAtom "_NET_SUPPORTED"
c <- getAtom "ATOM"
supp <- mapM getAtom [
"_NET_WM_STATE_HIDDEN",
"_NET_WM_STATE_FULLSCREEN", -- XXX Copy-pasted to add this line
"_NET_NUMBER_OF_DESKTOPS",
"_NET_CLIENT_LIST",
"_NET_CLIENT_LIST_STACKING",
"_NET_CURRENT_DESKTOP",
"_NET_DESKTOP_NAMES",
"_NET_ACTIVE_WINDOW",
"_NET_WM_DESKTOP",
"_NET_WM_STRUT"
]
io $ changeProperty32 dpy r a c propModeReplace (fmap fromIntegral supp)
setWMName "xmonad"

0 comments on commit ba91dd4

Please sign in to comment.