0

I want to create a virtual monitor, add it to my current display as a seperate screen (In X sense) and share it over VNC. Now what I want to do is neatly described below in Arch Linux Wiki article on Multihead setup

This is the original way of configuring multiple monitors with X, and it has been around for decades. Each physical monitor is assigned as an X screen, and while you can move the mouse between them, they are more or less independent. Normally the X display has a single identifier such as :0 set in the DISPLAY environment variable, but in this configuration each screen has a different $DISPLAY value. The first screen is :0.0, the second is :0.1 and so on. With this configuration, it is not possible to move windows between screens, apart from a few special programs like GIMP and Emacs which have multi-screen support. For most programs you must change the DISPLAY environment variable when launching to have the program appear on another screen:

# Launch a terminal on the second screen
$ DISPLAY=:0.1 urxvt &

Alternatively, if you have a terminal on each screen launching programs will inherit the DISPLAY value and appear on the same screen they were launched on. But moving an application between screens involves closing it and reopening it again on the other screen. Working this way does have certain advantages, such as windows popping up on one screen will not steal the focus away from you if you are working on another screen - each screen is quite independent.

Tl;dr: A display like :0.1

I have created virtual displays at past which are extenstion of current screen, with xrandr.

xrandr --newmode "1024x768_60.00"  64.11  1024 1080 1184 1344  768 769 772 795  -HSync +Vsync
xrandr --addmode VIRTUAL1 1024x768_60.00  
xrandr --output VIRTUAL1 

The problem which arise that I need to pull the windows between monitors (Pull from actual monitor to VNC monitor). How can I specify to make the new display to be a new screen ? I want to do thing opposite to this question, inducing the "problem", so that windows open in same monitor it is called from.

1 Answer 1

0

The problem which arise that I need to pull the windows between screens.

You can't, unless the application is specifically written to support at (which most X applications are not). Read man XOpenDisplay, and you'll see that X applications get back list of screens on that display, but already toolkit operations like XtOpenDisplay force you to specify a screen.

If you want to move windows for arbitrary X applications "between screens", that means the "screens" must not be X screens, but part of the same X display/screen combinations.

So what you want is a single framebuffer, displayed on two monitors (that part is easy), and then the framebuffer for one monitor needs to be shared over VNC. And I don't know if this is possible without patching whatever VNC server you are using.

4
  • What I can't ? As Arch wiki "This is the original way of configuring multiple monitors with X, and it has been around for decades", so it is only possible for real monitors and not for virtual ? Sep 11, 2021 at 16:00
  • Corrected, "The problem which arise that I need to pull the windows between screens." it would be "monitor" instead of "screen" Sep 11, 2021 at 16:03
  • You can configure multiple monitors this way, but you cannot move windows between them, unless the specific X application that produces the windows has support for this (and I know of none that does). Read the man pages.
    – dirkt
    Sep 11, 2021 at 17:59
  • Yes, that what I want to do. But how to setup a virual display like that? Sep 11, 2021 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .