16

I'm running XFCE 4.12 with 3 monitors setup into two X screens and two video cards on the same computer. Two of the monitors form a single X screen using nvidia twinview functionality, which is Screen0 on Device0 in the Xorg config. The 3rd monitor is for the second screen which is Screen1 on Device1 in the Xorg config. I can drag windows fine between the monitors on Screen0. I can also move my mouse freely between Screen0 and Screen1 and even the clipboard data is carried between the two X screens ok.

Both of these X screens act as independent desktops which have their own set of viewports. I like it this way and its useful for making one side "stick" automatically. However if I start a program on one X screen, I can't move it to the other X screen by simply dragging it. If I want to run that program on the other screen I have to restart it on that screen.

My question is if there is way to move the program while its running to the other screen using some command or other function of X windows. Thanks.

Update: I'm going to start a bounty on this question but I've been wondering about this for a while. To earn the bounty, you have to provide some citation for proof.

  • 1
    xpra offers something pretty similar to what you are asking... – vlp Oct 30 '15 at 19:43
  • googling also reveals xmove – user140866 Oct 31 '15 at 9:05
  • I do not remember that I had to change something on CentOS 5 or 6 to get that behaviour. What distribution in which version are you using here? – Nils Oct 31 '15 at 21:59
  • This looks like a duplicate of unix.stackexchange.com/questions/152291/… – Nathan Fellman Nov 3 '15 at 14:29
  • @NathanFellman Possibly, but I don't even think in my case I'm talking about moving between displays. According to my process list, I'm only running once instance of the X process, which is :0. There is no :1 or :2, etc. Maybe this is just a problem with how XFCE manages multiple screens or something in my configuration. Regarding the programs mentioned so far, none of them seem to be still maintained or available. xmove is almost 20 years old and I can't find a copy of XiMove. xpra also seems like the wrong kind of program for what I'm trying to do. – deltaray Nov 3 '15 at 19:09
13

You cannot move an X application started directly with the X server the application is ultimately displayed on, this is due to an X client being "tied to the X server (X display) it was started on for its lifetime"[1] This is most likely to do with metadata that the X server holds about a client's windows that cannot be easily transferred between X servers.

The same is true of separately configured screens (when not using extensions such as Xinerama or Twinview) for programs that don't have multi-screen support explicitly written in - "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."[2]

In theory if an application was designed to cope with an X server context switch, it could be provided with the new display/screen number, save the state of it's windows, connect to the new X server/screen and resurrect it's windows, but few applications would be designed in this way and would necessarily involve either a lot of boilerplate or the inclusion of a library that would facilitate this somehow.

The best option for you is probably to use other applications that can act as a proxy between an X client and the displaying X server in a similar way that GNU screen can be used for console applications and the terminal. Xmove and Xpra [3&4] seem to be the most widely used implementations for doing this. The caveat of using those is that the applications that you start have to register with Xmove or Xpra as their X server in order to be able to context switch between different display servers.

Finally there is another question, on SuperUser, that is asking a similar question for a slightly different purpose (reconnect to X after X crash, rather than deliberate disconnect/reconnect of client)[5]

  • 2
    Thanks for trying to answer but this just isn't what the problem is. I'm talking about moving between X screens in the same server, not between X Servers. – deltaray Nov 10 '15 at 18:19
  • 5
    I missed that nuance originally, apologies. Unfortunately without an extension such as Xinerama that merges several screens into one, it seems applications treat separate screens on the same server as separate logical servers, and manage connections to them separately - see the link [2] I have added in the last edit. The workaround for moving an application between X servers should also hold for moving between screens, you will just have to specify the screen part of the DISPLAY environment variable when (for example) attaching Xpra. – Benjamin Nov 13 '15 at 14:35

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.