You are not logged in.

#1 2005-03-23 23:44:02

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

using Xnest?

ok, I don't really understand the usage of Xnest...

it starts fine with "Xnest :1" but I cannot execute anything in that display (DISPLAY=":1" xterm fails... cannot connect to display :1.0)

I'd like to use xnest to mess with other window managers w/o leaving X... does anyone know how to do this?

Offline

#2 2005-03-24 00:03:01

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: using Xnest?

#!/bin/sh
Xnest :1 -name "Bla" +kb -ac &
export DISPLAY=:1
xsetroot -display :1 -solid black &
exec the_actual_wm

Offline

#3 2005-03-24 01:10:04

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: using Xnest?

i like that this subject is discussed ...

here some things i never figured out how to do - hopefully someone out there knows how to solve them.

- how can i have the same keyboard settings in the nested X as in the main X (whenever i use Xnest, i have a us keyboard inside :1 but in :0 my correct "XkbLayout" "de_CH")

- is there a way to specify the size of the :1?

- is there a way that :1 addapts to the window-size it is nested in? (resizing window <-> geometry of X changes) [if not, the window must not be resizable, but it is]

- is there a way to copy-paste across X'es?

- funny thing i figured out once: start kde in :0 start a nested X and start xfwm in it, start xfce4-panel in it and press the "exit" button on the xfce panel. the reaction is not that xfce exits but that kde asks to end session --- why?


The impossible missions are the only ones which succeed.

Offline

#4 2005-03-24 01:33:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: using Xnest?

i3839 wrote:
#!/bin/sh
Xnest :1 -name "Bla" +kb -ac &
export DISPLAY=:1
xsetroot -display :1 -solid black &
exec the_actual_wm

hmm maybe my error was that I was just assuming "DISPLAY=:1" would take care of everything... is it required to pass the "-display :1" args still?

Offline

#5 2005-03-24 12:16:37

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: using Xnest?

- Maybe the "+kb -ac" option takes care of the keyboard stuff, no idea where I got it from.

- For the size use -geometry, see the Xnest manpage.

- Probably not, as xrandr doesn't work.

- Don't think so, as it are two seperate X servers, and that's the whole point, isn't it?

- Buggy program that doesn't expect multiple X servers running. To see how it does it look at the source or do a strace.

For programs that don't check the DISPLAY environment variable but do have a -display option it is needed.

Offline

#6 2005-03-24 14:08:07

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: using Xnest?

dp wrote:

- funny thing i figured out once: start kde in :0 start a nested X and start xfwm in it, start xfce4-panel in it and press the "exit" button on the xfce panel. the reaction is not that xfce exits but that kde asks to end session --- why?

it may have ":0" hardcoded for the display... or the env variable wasn't set before starting the xfce4-panel (most WMs use XOpenDisplay(NULL) which gets the display based on the env variable DISPLAY

Offline

#7 2005-03-24 15:45:09

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: using Xnest?

XNEST(1)                                  XNEST(1)

[mod: the rest of this post is the manpage of xnest - dp]


:?

Offline

#8 2005-03-24 16:10:39

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: using Xnest?

dude... don't post man pages... that's a waste of space...

Offline

#9 2005-03-24 16:51:10

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: using Xnest?

When I use:

Xnest :1 &
DISPLAY=:1
exec xfce4-session

everything works fine

btw.: could some moderator please delete the 'man-page-post'?

Offline

#10 2005-03-24 16:54:04

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: using Xnest?

i3839 wrote:

- Maybe the "+kb -ac" option takes care of the keyboard stuff, no idea where I got it from.

- For the size use -geometry, see the Xnest manpage.

- Probably not, as xrandr doesn't work.

- Don't think so, as it are two seperate X servers, and that's the whole point, isn't it?

- Buggy program that doesn't expect multiple X servers running. To see how it does it look at the source or do a strace.

For programs that don't check the DISPLAY environment variable but do have a -display option it is needed.

i3839, thank you very much for the comments

keyboard: i use +kb ... it is, as if it does not check the settings ... anyway

size: -geometry :oops: yes ... i forgot

resizable window: it is logical that you cannot resize an X server live (this would be a cool feature request ;-) ) ... the confusing part is, that kde let's you make the window with the nested :1 smaller but the nested X does not have scrollbars. when you resize :1 to it's original size, you get faulty graphics in the regions that were closed (feature request: scrollbars in nested X server, as moving of mouse does not scroll the virtual screen in the window the nested X is running in (in a real X server, if you have a virtual size that is larger that the effective resolution, the screen is moved by the mouse))

copy/paste: i use vnc to copy/paste between them, but this means having lots of windows around and the advantage of a nested X is lost ... that's why i asked ... if there is no simply way, never mind

i tried strace xfce4-panel in the nested X but after some seconds, strace crashed :1 and :0  :evil:  ... anyway, it is only a module of the xfce4-panel and i in most cases use xfce4 in the :0 and run something else in :1 so no problem with this


The impossible missions are the only ones which succeed.

Offline

#11 2005-03-24 17:34:52

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: using Xnest?

Yes, it Xnest crashes very fast, not sure what it is. I only used it to try out xfce4 without messing up anything else. No idea for what else than testing you'd use it though.

Offline

#12 2005-03-27 20:55:31

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: using Xnest?

hackerssidekick wrote:

Just a thought, would you be able to resize the Xnest window using something like <ctrl><alt><+/->, like you can do in X?

i tried it, but it doesn't work ... it was worth a try ;-)

hackerssidekick wrote:

On a sidenote, I've never actually figured out what is required in the config file(s) in order to be able to go <ctrl><alt><+/-> in X and have it change resolution. Sometimes it works and sometimes it doesn't...

me neither ... and since i have this laptop without the numbers-part of the keyboard (you need [+] and [-] from the numbers part of the keyboard) i dropped my illusions and use software-solution only (xrandr)


The impossible missions are the only ones which succeed.

Offline

#13 2005-03-27 21:17:36

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: using Xnest?

Ctrl+Alt+-/+ can only change between the modes given in the X config file. Other than that, it works always except if you explicitly disable it in the X config. Problem of this method is that the X programs can't know about the changes, as they aren't notified. That's solved by Xrandr, which is much better and should be used if possible. Xrandr is a X extension which must be supported by the X driver (e.g. nv).

Offline

Board footer

Powered by FluxBB