12

I found when I want to change input method, I should restart X. But I don't want to close all applications. How to do that?

10

You can't.

What you can do is start a new X-session on a different tty (screen) which should leave the apps running in the first session untouched. (This is how some display managers [e.g., KDM] allow multiple log-ins of different users using the the same physical display/keyboard.)

Source: http://www.linuxquestions.org/questions/linux-desktop-74/how-to-restart-x-without-having-to-close-connected-applications-689430/

| improve this answer | |
  • 1
    Could you give the command to do that in this answer? Would be nice not to have to google :) – Aditya M P Oct 4 '14 at 3:16
2

The apps started over X will be killed if you restart X. You cannot avoid that.

| improve this answer | |
  • Does anyone know what signal these apps receive when X is terminated? And does it depend on what signal terminates X? I can imagine reasons for the system to be designed so they receive SIGHUP, SIGINT, SIGTERM, or SIGKILL (or some combination of these, separated by a time interval during which the app can do its own cleanup). – Eliah Kagan Jun 15 '12 at 2:39
  • Eliah: it's not a really a signal: the socket that the X clients (your apps) are communicating with Xorg over is closed. This may cause the client to receive a SIGPIPE on the next write to the socket, or that the write fails. It's certainly possible that applications can perform cleanup here. – Jeremy Kerr Jun 15 '12 at 8:51
  • Would it be possible to run some kind of proxy in front of Xorg socket to allow redirecting socket traffic to newly restarted X? – Mikko Rantalainen Mar 6 '17 at 17:32
  • 2
    @MikkoRantalainen if you manage to get it to work, xmove does exactly this. The problem is, it hasn't been maintained for 14 years. This could probably also be done with Xpra, which is still maintained, but its main purpose is quite different, so it would require fiddling. – franga2000 Aug 29 '18 at 20:48

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.