xpra icon
Bug tracker and wiki

Version 7 (modified by Antoine Martin, 5 years ago) (diff)

--

Fake Xinerama

What is Xinerama?

Xinerama is an extension to the X Window System that enables X applications and window managers to use two or more physical displays as one large virtual display.

In the context of xpra, it is the library that client applications running on the xpra server may use to inquire about the layout of the display in multiple screen configurations.

For more information see Xinerama (wikipedia)

Fake?

Fake xinerama allows us to tell X11 client applications running on the xpra server that the display is in fact made of multiple screens whose geometry can be made to match that of the client exactly, despite the fact that the virtual display that we start (usually Xdummy) only has one virtual screen defined.

It is shared library that we preload into each child application that we start, so that it will use our fake version instead of the standard Xinerama library supplied with the system.

Source Code

Since the upstream version no longer seems to exist, we carry the source code here: src/fakexinerama.

In order to support multiple virtual screens under the same user, the original code was modified to lookup its configuration file as .$DISPLAY-fakexinerama instead of just .fakexinerama, though it will use the latter as fallback.

We also build it under a different name to prevent conflicting with the real libXinerama library.

Installation

Xpra version 0.12 onwards will try to find this library at runtime in the usual library paths (LD_LIBRARY_PATH followed by /usr/lib[64]). So that's where you should place it.

We do provide binary RPMs for various distributions based on this spec file: libfakeXinerama.spec

Usage

Xpra will automatically generate this file when a new client connects.

Any application started from within the context of an xpra "start-child" process will inherit the preload environment variable and should "just work".


To use it without Xpra, simply run:

LD_PRELOAD=/path/to/libfakeXinerama.so.1 your-x11-client-application

Caveats

The LD_PRELOAD trick only tells the application how to query for Xinerama screen information, it does not and cannot tell the application when it should refresh this data. Unfortunately, this means that many applications will only query this data once and cache the results.

This means that you MUST connect your client (which will cause the Xpra server to generate a suitable fake xinerama configuration file) BEFORE starting the X11 client application that will use fake Xinerama..

Configuration File Format

The .$DISPLAY-fakexinerama is a simple text file using the following format:

  • "\n" is the end of line character
  • use "#" at the beginning of a line for comments
  • the first line that is not a comment MUST contain the number of screens defined in the file
  • the number of screens MUST be a valid positive number between 1 and 10
  • each of the following lines that are not comments MUST define each of the screens
  • all screens MUST be defined
  • each screen MUST consist of four numeric values separated by a single space: x y w h, this defines the area of the display that belongs to the given screen


Here is an example configuration file for a two screen setup:

# 2 monitors:
2
# DISPLAY1
0 0 1600 900
# DISPLAY2
1600 0 1600 900