xpra icon
Bug tracker and wiki

http://xpra.org/icons/X11.png

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.

It allows to specify the screen layout that X11 client application will see.

For more information see Xinerama (wikipedia)

See also:

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

The upstream version can be found here: http://home.kde.org/~seli/fakexinerama/, our modified source code can be found here: fakexinerama, and the released versions are here: http://xpra.org/src/

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

For more information on LD_PRELOAD, see What is preloading?, What is the LD_PRELOAD trick? and for a lot more information see LD_NOT_PRELOADED_FOR_REAL.

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.

Xpra solves this by always re-setting the display dimensions using RandR, which is usually enough to make the application re-query Xinerama, but not always.

If you have SELinux enabled, you may need to relabel the library after installation (but packaged versions ought to have taken care of that for you already):

/sbin/restorecon -v /usr/lib64/libfakeXinerama.so*

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
Last modified 4 months ago Last modified on 01/30/17 05:18:10