Article View: comp.windows.x
Article #38260Re: -display on command line and opening X connection.
From: der Mouse
Date: Sat, 25 Jan 1992 10:43
Date: Sat, 25 Jan 1992 10:43
59 lines
3961 bytes
3961 bytes
In article <7978@baird.cs.strath.ac.uk>, amurphy@cs.strath.ac.uk (Allan Murphy CS4) writes: > Der Mouse writes: >> I wrote: >>> Is there a standard technique / bit of code that X applications are >>> supposed to carry out when the user specifies a display other than >>> $DISPLAY ? >> I haven't seen anything noteworthy - just use the specified string >> in the XOpenDisplay call instead of the default. > What I didn't write [...] was that the application is a graphics demo > for the networked machines in the CS department here; all of these > machines use the same file server; you can login to any of them with > the same username/password..... [I've tried to cut this down to something not too huge without doing too much violence to Allan's explanation. I hope I succeeded....] > Since my app. is unlikely to be ported ( very unlikely ), this might > ( covers his ass ) be a safe thing to do ?? ["this" refers to taking a machine name and appending ":0.0".] > This a graphics demo for twerps; none of them are going to try run it > on a display connected to a machine outside this department.... they > are liable to try something like % demo -display <machine>. If the argument contains no colons, appending :0.0 would not strike me as terribly unreasonable, particularly if the given string is a valid hostname (this may not be worth checking for). However, I would argue that doing this for a -display argument is a bad idea because it introduces an inconsistency: very few other programs that take -display will accept a bare machine name, so getting your `twerps' used to using a bare machine name after a -display is liable to confuse them the first time they run into a mainstream X application with a -display argument. If you want to use a different flag (-remote or something, maybe), and document it as the remote machine rather than as the display name, I would have no problems with what you suggest. Well, almost none. While you may now think that your code is unlikely to be ported, there are at least two reasons for doing it the Right Way anyway: (a) much code that was never intended to be ported ends up all over the place - witness UCB talk(1), and (b) it strikes me as a bad habit to get into. ((b) is rather ill-defined; it's an aesthetic judgement....) >>> rsh to the remote machine and do an xhost +local machine name >> ( embarrassingly large list of problems with this idea removed in >> order to preserve my ego by not having them posted twice ) Well, the idea wasn't to do violence to your ego! It just sounded as though you hadn't really thought about it in much depth; it looked like the sort of thing that someone with the fabled "little learning" might suggest - an instance of the "it works on my machine" problem. Your explanation makes it clear that (whether or not you did think about it in depth :-) it's not nearly as inappropriate to your situation as my list of problems may have made it sound. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu
Technical Details
Message-ID:
<1992Jan25.104351.15512@thunder.mcrcim.mcgill.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouseReferences:
<1992Jan12.121737.14962@trevan.uucp> <7880@baird.cs.strath.ac.uk> <7978@baird.cs.strath.ac.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103734,7664f740ba377765 X-Google-Attributes: gid103734,public X-Google-Thread: 1048e3,7664f740ba377765 X-Google-Attributes: gid1048e3,public X-Google-Thread: 134180,7664f740ba377765 X-Google-Attributes: gid134180,public X-Google-ArrivalTime: 1992-01-25 02:50:11 PST Path: arc1-ca.pugleaf.net!sparky!uunet!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.windows.x,comp.unix.sysv386,biz.sco.opendesktop Subject: Re: -display on command line and opening X connection. Message-ID: <1992Jan25.104351.15512@thunder.mcrcim.mcgill.edu> Date: 25 Jan 92 10:43:51 GMT References: <1992Jan12.121737.14962@trevan.uucp> <7880@baird.cs.strath.ac.uk> <7978@baird.cs.strath.ac.uk> Organization: McGill Research Centre for Intelligent Machines Lines: 60