How to make Chrome scale correctly in full screen mode in Xmonad

When I enter full screen mode with the F11 key, or click the full screen button in Youtube or Netflix, Chrome seems to scale the page to fit the size of the screen, and the page would be cropped to its containing window. However, after toggling the layout with mod + space, it then scales to fit the containing window correctly.

How do I make Chrome's scaling to fit its window instead of the entire screen when first entering full screen mode?

I tried the functions in XMonad.Hooks.EwmhDesktops and XMonad.Layout.Fullscreen but still couldn't figure out a way.

I'm using Google Chrome 57.0.2987.98 and xmonad 0.13 on Arch. Thanks!

This problem has bothered me for a while too. I tried all sorts of combinations in my xmonad config file but with no luck. But I've recently found 'Vivaldi', a browser based on the Chromium engine and headed by the ex-CEO of the Opera browser. It achieves exactly what you want by using the 'Toggle UI' option (by default, Ctrl-F11).

google-chrome - 如何在Xmonad中以全屏模式正确缩放 , How to make Chrome scale correctly in full screen mode in Xmonad. When I enter full screen mode with the F11 key, or click the full screen button in Youtube or� The quickest way Windows users can get Chrome in full-screen mode is by hitting F11 on the keyboard. The other way is through Chrome's menu: In the top-right corner of Chrome, select the menu (three-dot) icon. Locate the Zoom section, and select the square icon to the far right.

My solution is to use this modified version of fullscreenEventHook from EWMH.

fullscreenEventHook :: Event -> Bool -> X All
fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) isChrome = do
  wmstate <- getAtom "_NET_WM_STATE"
  fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
  wstate <- fromMaybe [] `fmap` getProp32 wmstate win

  let isFull = fromIntegral fullsc `elem` wstate

      -- Constants for the _NET_WM_STATE protocol:
      remove = 0
      add = 1
      toggle = 2
      ptype = 4 -- The atom property type for changeProperty
      chWstate f = io $ changeProperty32 dpy win wmstate ptype propModeReplace (f wstate)

      uglyChromeHack x = do
        when (not isChrome) x
        when isChrome $ windows W.swapUp >> windows W.swapDown

  when (typ == wmstate && fi fullsc `elem` dats) $ do
    when (action == add || (action == toggle && not isFull)) $ do
      chWstate (fi fullsc:)
      uglyChromeHack $ windows $ W.float win $ W.RationalRect 0 0 1 1
    when (action == remove || (action == toggle && isFull)) $ do
      chWstate $ delete (fi fullsc)
      uglyChromeHack $ windows $ W.sink win

  return $ All True

fullscreenEventHook _ _ = return $ All True


butNotChrome :: Event -> X All
butNotChrome e@(ClientMessageEvent _ _ _ _ win _ _) = do
  isChrome <- runQuery (appName =? "google-chrome") win
  fullscreenEventHook e isChrome
butNotChrome _ = return $ All True

This bit windows W.swapUp >> windows W.swapDown seems to kick chrome just hard enough.

Make everything bigger in xmonad : xmonad, I'm still trying to configure xmonad, my problem now is that my screen is 4K (I use an To scale most things (Firefox, Sakura, GTK-apps): set Xft.dpi: 150 in, say, This makes Chromium's windows display way too big fonts, however, so to fix that at first I was having problems with borders and fullscreen, but I have recently� Go to the Google Chrome shortcut on your desktop and right-click it. Choose Properties from the menu. Go to the Target section and add the text below to the end of the parameter: /high-dpi-support=1 /force-device-scale-factor=1. Save the changes by clicking Apply and OK. Remember to unpin and re-pin Chrome on your taskbar if you had a shortcut there.

You need to add the following to your config (xmonad.hs):

import XMonad.Hooks.EwmhDesktops
main = xmonad $ ewmh (yourExistingConfigValueGoesHereExample { handleEventHook =
       handleEventHook def <+> fullscreenEventHook })

More information can be found here: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html


This functionality is also bundled into desktopConfig (a sort of sane default for xmonad). https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Config-Desktop.html

StackOverflow Bot on Twitter: "How to make Chrome scale correctly , How to make Chrome scale correctly in full screen mode in Xmonad http:// stackoverflow.com/questions/42873367 … #google-chrome #haskell� Provides a ManageHook and an EventHook that sends layout messages with information about fullscreening windows. This allows layouts to make their own decisions about what they should to with a window that requests fullscreen. The module also includes a few layout modifiers as an illustration of how such layouts should behave.

google-chrome - 如何在Xmonad中以全屏模式正确 , 首次进入全屏模式时,如何使Chrome的缩放适合其窗口而不是整个. How to make Chrome scale correctly in full screen mode in Xmonad. Click the menu button, and then click on the full-screen mode icon (the empty square) located next to Zoom mode about halfway down the menu. Alternatively, press the F11 key on your keyboard to activate full-screen mode (if you’re using a Chromebook, look for the key that looks just like the icon represented in the menu).

full screen shortcut - Google Chrome Community, To get Full-screen or developer mode, I have to open a menu every time? Why is that? It would be much easier, just to click on a key in the toolbar� Simple fullscreen mode. Renders the focused window fullscreen. The builtin tiling mode of xmonad. Supports Shrink, what proportion of the screen to devote to

xmonad – Balise's Blog, Posts about xmonad written by Balise. something on the main screen” or “chat window when I'm playing in full screen on the main screen”. Let's start some clients, to fill the screen. xmonad uses the mod1 key (alt) by default, and we can start by launching a terminal with mod-shift-return. The new terminal will fill the screen (and we'll use a bit of image processing to contrast the

Comments
  • It would be helpful to include your config
  • Thanks for the suggestion. This "Toggle UI" function in Vivaldi is a pretty good workaround. I only hope it can handle the full-screen button on sites like Youtube or Vimeo as well.
  • This setting would make XMonad behave like other desktop environments or OSes and make Chrome to fit to the entire screen, which may be what most people want. However, I'm trying to make Chrome stay in its window in full-screen mode, so that we can, say, put 2 full "screen" Youtube videos side by side in the same screen.
  • It's a bit of a hack but you could use something like xbindkeys and xdotool to bind F12 to (F11)+(Mod+space), so essentially automate what you're doing manually.