1

I am running the latest Raspbian which uses LXDE and Openbox, and I want to treat the 2 discrete outputs as 1. When I click Maximize or full screen, I want the application to span both monitors.

Eventually I will be using this in an automated fashion with chromium-browser --kiosk, so manually dragging an application across both screens is not an option. I would also like the flexibility to use different programs, so chromium-specific command line options are not desired.

I've tried to get Compiz to work because I saw a tutorial on how to get it to span 2 outputs and treat them as 1 display, but I can't seem to get it running. compiz --replace discards my window decorations and throws some warnings (see below), and I can't use the desktop until I do openbox --replace. I'm not sure I want a solution as heavy as a compositing window manager, anyway--although at this point I'll take whatever I can get working.

BTW, there is a ton of way-outdated information about Xinerama out there.

I am open to any option that accomplishes the goal of being able to run chromium-browser --kiosk and have that one window stretch across both displays.

pi@raspberrypi:~ $ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 7680 x 7680
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm
   1920x1080     60.00*+  60.00    50.00    59.94  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1280x720      60.00    60.00    50.00    59.94  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94    59.94  
   640x480       75.00    60.00    59.94    59.94  
   720x400       70.08  
HDMI-2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 509mm x 286mm
   1920x1080     60.00*+  60.00    50.00    59.94  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1280x720      60.00    60.00    50.00    59.94  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94    59.94  
   640x480       75.00    60.00    59.94    59.94  
   720x400       70.08  
pi@raspberrypi:/etc/X11/openbox $ compiz --replace

(process:10097): dbind-WARNING **: 22:08:01.498: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

(process:10097): dbind-WARNING **: 22:08:01.500: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
dbus[10097]: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 6080.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted
0

Solution

https://gist.github.com/eslindsey/70bbc0080e335b38836fab09d19686d0

This Gist allows you to supply an arbitrary command (and optional arguments), and detects the created window and screen size automatically.

Concept

chromium-browser --kiosk <url> &
sleep 5
wmctrl -r Chromium -b remove,fullscreen
wmctrl -r Chromium -b remove,maximized_vert,maximized_horz
wmctrl -r Chromium -e 0,0,0,3840,1080

The --kiosk argument is to get rid of the address bar, etc. from chromium-browser. The sleep is to make sure the window has time to show up. The first two wmctrl lines remove the maximized and full screen properties from the window (and cannot be combined because wmctrl only allows you to remove "up to two window properties simultaneously"). The final wmctrl does the work of actually moving the window. g,x,y,w,h are the arguments (g is gravity). 3840x1080 covers my two 1920x1080 side-by-side displays with a single Chromium browser running in kiosk mode.

Tested On

This works in the current release of Raspbian:

Raspbian Buster with desktop
Image with desktop based on Debian Buster
Version:July 2019
Release date:2019-07-10
Kernel version:4.19
Size: 1149 MB
SHA-256:6a1a5f20329e580d5161a0255b3d4163db6f56c3997e1c3b36bdd51140bd768e

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.