Ubuntu – Google Chrome Kiosk screen does not maximize

google-chromekioskx11

I have set up a Chrome Kiosk using a custom session in X to run Google Chrome.

It generally runs pretty well except except for a screen size issue.

I have a "chrome.desktop" session file saved in /usr/share/xsessions with the following contents.

[Desktop Entry]
Name=Chrome
Comment=This session logs you into Google Chrome
Exec=/usr/share/xsessions/chromeKiosk.sh
Icon=
Type=Application
Encoding=UTF-8

There is also a chromeKiosk.sh file that is used to execute Chrome. It is also in /usr/share/xsessions. The contents are as follows.

#!/bin/bash
while true; do google-chrome http://news.bbc.co.uk --kiosk --start-maximized --disable-restore-background-contents --login-screen-size="1024,768" --disable-translate --disable-new-tab-first-run --enable-vertical-tabs; sleep 5s; done

The problem that I am having is that Google Chrome (or Firefox, or Opera. I have tried various apps), will not maximise to the entire 1024×768 display. It seems to be leaving approximately 1 centimetre of space on the right hand side of the display (I can see the desktop), and also some space at the bottom of the screen.

I have tried this on at least 2 different computers. One had a higher resolution screen. It left an even bigger gap.

It is as if the application that it being run thinks the screen is smaller than it actually is.

Does anybody have any idea what is going on? I am going nuts with this problem.

Here is an image so you can see the border

Google Chrome Kiosk Xsession with odd border

That image is from a screen with a 1280 width.

Best Answer

Not sure why Chrome is doing this, but if you have a look at:

/home/{kiosk_user}/.config/google-chrome/Default/Preferences  

-- you will see browser.window_placement and you should see a difference of about 20 pixels between bottom and work_area_bottom, and right and work_area_right.

I edited the values to be the full extents of the display size, and saved Preferences, then chown'd then to root:root and chmod'd them to 644 so that Chrome (running as the kiosk_user) cannot modify the settings.

I restarted the kiosk_user session and tada, Chrome was running full full screen.

Hope this helps you.