home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / windows / x / 20157 < prev    next >
Encoding:
Text File  |  1992-12-12  |  4.4 KB  |  108 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!rhbnc!lt5.cs.rhbnc.ac.uk!jamesd
  3. From: jamesd@lt5.cs.rhbnc.ac.uk (James Driscoll)
  4. Subject: Re: HELP: Finding the complete display name for an app
  5. Message-ID: <1992Dec12.135834.15905@csqx.cs.rhbnc.ac.uk>
  6. Lines: 94
  7. Sender: news@csqx.cs.rhbnc.ac.uk (USENET News System)
  8. Nntp-Posting-Host: lt5.cs.rhbnc.ac.uk
  9. Reply-To: jamesd@lt5.cs.rhbnc.ac.uk (James Driscoll)
  10. Organization: Royal Holloway, University of London
  11. References: <1992Dec8.155553.900@csqx.cs.rhbnc.ac.uk> <1992Dec11.100529.28050@thunder.mcrcim.mcgill.edu>
  12. Date: Sat, 12 Dec 1992 13:58:34 GMT
  13.  
  14.  
  15. |>> How can I find out the complete name of the Display that an
  16. |>> application is displayed on?
  17. |>
  18. |>"the" "complete" name of "the" Display?  Those three words embody
  19. |>possibly-invalid assumptions which are part of the reason you're
  20. |>having
  21. |>so much trouble.
  22. |>
  23. |>(1) The assumption that the application is displaying on exactly one
  24. |>    display (the second "the").
  25. |>
  26. |>(2) The assumption that some names are "incomplete" and some are
  27. |>    "complete".  See below for more on this.
  28. |>
  29. |>(3) The assumption that every display has exactly one "complete"
  30. |>name.
  31. |>
  32. |>> I've tried :
  33. |>
  34. |>>     o    DisplayString(display); which tends to return :0.0
  35. |>
  36. |>>     o    getenv("DISPLAY");    which returns NULL for applications
  37. |>>                     started with -display.
  38. |>
  39. |>I assume the former is an example of a display name which you would
  40. |>consider not "complete".  What's incomplete about it?  It specifies
  41. |>everything the client needs to know in order to contact the display
  42. |>in
  43. |>question.  It has a well-defined meaning: display 0 on the machine
  44. |>the
  45. |>client is running on, with screen 0 as the default screen.
  46. |>
  47. |>> Is there any function that returns the form I want (eg
  48. |>> cad1a.cs.rhbnc.ac.uk:0.0)
  49. |>
  50. |>So, a "complete" display name is defined as - what?  One with
  51. |>something
  52. |>before the colon?  One with a FQDN before the colon?  One with a
  53. |>machine name before the colon?  A name that'll work for another X
  54. |>client anywhere?
  55. |>
  56. |>If you want "something before the colon", just prepend 127.0.0.1 when
  57. |>you see a name with nothing before the colon; that's the standard
  58. |>loopback address.  If you want a FQDN before the colon, this is not
  59. |>possible; not all machines have FQDN names, not even all machines
  60. |>running X servers.  If you want a machine name before the colon, this
  61. |>too may not be possible, since not all machines have names, and even
  62. |>those that do don't always have names that are usable by X clients. 
  63. |>If
  64. |>you want a name that'll work anywhere, that's not possible either
  65. |>since
  66. |>the name-to-machine mapping varies depending on who's performing the
  67. |>lookup operation.  Even if you're willing to require that an FQDN
  68. |>exist
  69. |>for the machine, that's not enough; there are lots of machines on the
  70. |>Internet that are utterly incapable of figuring out FQDNs they haven't
  71. |>been explicitly told about.
  72. |>
  73. |>> or is there something that contains this information or will I have
  74. |>> to write a "fudge" to get around it, and if so how?
  75. |>
  76. |>If you can define precisely what semantics you want, I may be able to
  77. |>help.  But I think it more likely that as you try to pin down exactly
  78. |>what you want to ask, you'll discover the *real* problem.
  79. |>
  80. |>                    der Mouse
  81. |>
  82. |>                mouse@larry.mcrcim.mcgill.edu
  83. |>
  84.  
  85. I obviously better go in to a bit more detail as to what I require.
  86.  
  87. I am writing a mutli-process application that needs to share information. Each
  88. instance of the application needs to know about the contents of 4 or 5 data
  89. fields and when they change. Hence I am storing the data in Xproperties on the
  90. root window of the display upon which the first instance is started up. As
  91. subsequent processes can occur elsewhere on the network (and hence on different
  92. displays) the have to be able to make a connection to that display. Therefore
  93. when getenv("DISPLAY"); returns "0.0" it is insufficient as an identifier to the
  94. display containing the root window where the properties are stored.
  95.  
  96. Thus I need some way of being able to get an accurate identifier to the display
  97. where the properties are stored so that all other processes can make connections
  98. to that display and retrieve the desired information and setup a
  99. PropertyNotify event handler to trap any changes in the data stored there.
  100.  
  101. Perhaps I'm going about this in the wrong way - if so would you be kind enough to
  102. make a few suggestions?
  103.  
  104. Thanks very much in advance,
  105.  
  106. -James
  107.  
  108.