PDA

View Full Version : How to switch XServer with console command / XLib ?



scrawl
April 16th, 2010, 03:54 PM
Hi,

In my program, I would like to switch to another XServer, for example switch to Display :1 . I tried emulating the Keyboard commands (Ctrl+Alt+F8) with xautomation, but that doesnt seem to work, I guess these commands are caught somewhere else so I cant emulate them.

So is there any other way to switch to another XServer in my program? Maybe directly via XLib?

falconindy
April 16th, 2010, 03:58 PM
Look at XOpenDisplay(3).

scrawl
April 16th, 2010, 04:38 PM
Well, I can use this function and it doesnt give an error. But nothing happens. Do I need to activate it somehow?

cdekter
April 17th, 2010, 11:42 AM
What you are trying to do is switch to a different TTY. This in fact has nothing to do with X. It's handled in the kernel, so unless the kernel exposes some kind of API for it, you're out of luck.

scrawl
April 17th, 2010, 12:18 PM
I dont want to switch to another TTY. I want to switch to another running XServer. And it has to be possible, because the fast-user-switcher-applet does this too when switching users. I looked at the source, but its Greek to me.