X and -owncmap

Grant McDorman grant "at" isgtec.com
Wed, 21 Oct 1998 15:05:27 +0000


This message is in MIME format
--_=XFMail.1.3.p0.Solaris:981021095729:18016=_
Content-Type: multipart/mixed;
 boundary="_=XFMail.1.3.p0.Solaris:981021095723:18016=_"

This message is in MIME format
--_=XFMail.1.3.p0.Solaris:981021095723:18016=_
Content-Type: text/plain; charset=iso-8859-1

Try the attached patch for the X viewer (against 3.3.2, but the X viewer
didn't change in 3.3.2R2). I don't know that this will fix your problem, but
it may help.

I sent at least one version of this to ORL; I'm not sure they got the last
one, though. Their philosophy with respect to colourmaps differs from mine,
too.

What this does: 
  * adds -sharedcmap and -searchcmap options
  * changes colourmap handling as follows:
    in the absence of -owncmap and -sharedcmap, a private colourmap will be
      used for 256-colour (PseudoColour) displays
    with -sharedcmap, the -searchcmap option makes the view look for all
      currently allocated colours in the colourmap that are sharable and
      usable for the BGR233 mapping 

More details are in the patch, as comments.

The current vncviewer colour handing is significantly flawed, in that it uses
whatever is in the colourmap without checking to see if the colour is
sharable, and without allocating that colour (so it can't be changed). This
can result in nasty behaviour; try displaying a colourful image on an 8-bit
display, starting vncviewer, and then displaying a different image: the
vncviewer window will go psychedelic on you.

The patch also fixes some other problems with the viewer's scrollbars in
private colourmaps.

If you prefer the viewer to default to using the shared colourmap (i.e.
-sharedcmap), as is the case now, then change the line in the patched args.c
from
 Bool forceOwnCmap = -1;             /* -1: unspecifed                   GRM*/
to
 Bool forceOwnCmap = False;          /* -1: unspecifed                   GRM*/

On 21-Oct-98 06:15:14 Stuart Midgley wrote:
>  I am new to VNC.
>  
>  I am trying to use VNCServer on a mac and a VNCClient on a DUnix4.0d box. 
>  It is
>  working OK, though the server is quite unstable.  I look forward to an
>  improved
>  version.
>  
>  Anyway, since I only have 256 colours on my Alpha box, I would like to use
>  the
>  -owncmap.  When I specify it (vncviewer -owncmap) all I get is a black
>  screen
>  with the little squareblock cursor (with white border).
>  
>  Is this a common problem?  Is there a fix for it?
>  
>  Thanks
>  
>  Stu.
>  
>  
>  -- 
>  <--------------------------------------------------------------------------
>  --->
>    Stuart Midgley                      |  stuart "at" physics.uwa.edu.au
>    Department of Physics               |  08 9380 7898   Wk
>    University of Western Australia     |  08 9380 1014   Fax
>  
>  
>  
>  ---------------------------------------------------------------------
>  The VNC mailing list     -   see http://www.orl.co.uk/vnc/intouch.html
>  ---------------------------------------------------------------------

---

Grant McDorman <grant "at" isgtec.com>
ISG Technologies, Inc.  http://www.isgtec.com
Mississauga, Ontario, Canada


--_=XFMail.1.3.p0.Solaris:981021095723:18016=_
Content-Disposition: attachment; filename="vnc-3.3.2-cmappatch-III"
Content-Transfer-Encoding: base64
Content-Description: vnc-3.3.2-cmappatch-III
Content-Type: application/octet-stream;
 name=vnc-3.3.2-cmappatch-III; SizeOnDisk=22268

KioqIHZuY3ZpZXdlci5oLm9yaWcJVHVlIE1heSAxMiAwODo1MTowNCAxOTk4Ci0tLSB2bmN2aWV3
ZXIuaAlXZWQgSnVuICAzIDE1OjA0OjA0IDE5OTgKKioqKioqKioqKioqKioqCioqKiA2Miw2NyAq
KioqCi0tLSA2Miw3MCAtLS0tCiAgZXh0ZXJuIEJvb2wgYWRkSGV4dGlsZTsKICBleHRlcm4gQm9v
bCB1c2VCR1IyMzM7CiAgZXh0ZXJuIEJvb2wgZm9yY2VPd25DbWFwOworIGV4dGVybiBCb29sIGZv
cmNlU2hhcmVkQ21hcDsgICAgICAgLyogdXNlIHNoYXJlZCBwc2V1ZG9jb2xvdXIgdmlzdWFsICAg
IEdSTSAqLworIGV4dGVybiBCb29sIGZvcmNlRXhpc3RpbmdDb2xvdXJzOyAgLyogdXNlIG90aGVy
IGFsbG9jYXRlZCBzaGFyZWQgY29sb3Vyc0dSTSAqLworIGV4dGVybiBpbnQgZm9yY2VNYXBTaXpl
OyAgICAgICAgICAgICAvKiBkZWZhdWx0IHNoYXJlZCBCR1IyMzMgbWFwIHNpemUgIEdSTSAqLwog
IGV4dGVybiBCb29sIGZvcmNlVHJ1ZW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seSwgd2hlbiB0aGUgVk5D
IHNlcnZlciBpcyBkcml2aW5nCiEgICAgICAqICAgdGhlIGNvbG91cm1hcCwgd2UgY2FuIG9ubHkg
Z3Vlc3MuKQohICAgICAgKiAKISAgICAgICogICBOb3RlIHRoYXQgaXQgaXMgaGFybWxlc3MgdG8g
YWxsb2NhdGUgYmxhY2sgaW4gdGhlIGRlZmF1bHQgY29sb3VybWFwLAohICAgICAgKiAgIGVzcGVj
aWFsbHkgc2luY2UgdGhhdCBjb2xvdXIgaXMgdXN1YWxseSBwcmUtYWxsb2NhdGVkIGFueXdheS4K
ISAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgW0dSTV0gKi8KISAgICAgY29sb3VyQ2VsbC5yZWQgPSBjb2xvdXJDZWxsLmdy
ZWVuID0gY29sb3VyQ2VsbC5ibHVlID0gMDsKISAgICAgaWYgKCFYQWxsb2NDb2xvcihkcHksIGNt
YXAsICZjb2xvdXJDZWxsKSkgewohICAgICAgICAgaWYgKHVzZUJHUjIzMykgewohICAgICAgICAg
ICAgIGNvbG91ckNlbGwucGl4ZWwgPSBCR1IyMzNUb1BpeGVsWzBdOwohICAgICAgICAgfSBlbHNl
IHsKISAgICAgICAgICAgICBpZiAoIW15Rm9ybWF0LnRydWVDb2xvdXIpIHsKISAgICAgICAgICAg
ICAgICAgZnByaW50ZihzdGRlcnIsICI4LWJpdCBjb2xvdXJtYXBwZWQgLWFzc3VtaW5nIHBpeGVs
IDEgaXMgd2hpdGVcbiIpOwohICAgICAgICAgICAgICAgICBjb2xvdXJDZWxsLnBpeGVsID0gMTsK
ISAgICAgICAgICAgICB9IGVsc2UgewohICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwg
IkNvdWxkbid0IGFsbG9jYXRlIGJsYWNrIGNvbG91ciAtIGdpdmluZyB1cC5cbiIpOwohICAgICAg
ICAgICAgICAgICBleGl0KDEpOwohICAgICAgICAgICAgIH0KISAgICAgICAgIH0KISAgICAgfQoh
ICAgICBibGFja1BpeGVsID0gY29sb3VyQ2VsbC5waXhlbDsKISAgICAgYXR0ci5iYWNrZ3JvdW5k
X3BpeGVsID0gY29sb3VyQ2VsbC5waXhlbDsKISAgICAgLyogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQgW0dSTV0gKi8KICAgICAgYXR0ci5l
dmVudF9tYXNrID0gTGVhdmVXaW5kb3dNYXNrfFN0cnVjdHVyZU5vdGlmeU1hc2s7CiAgICAgIGF0
dHIuY29sb3JtYXAgPSBjbWFwOwogIAoqKioqKioqKioqKioqKioKKioqIDE3NiwxODIgKioqKgog
IAogICAgICAvKiBDcmVhdGUgdGhlIHNjcm9sbGJhcnMgKi8KICAKISAgICAgYXR0ci5iYWNrZ3Jv
dW5kX3BpeGVsID0gV2hpdGVQaXhlbE9mU2NyZWVuKERlZmF1bHRTY3JlZW5PZkRpc3BsYXkoZHB5
KSk7CiAgICAgIGF0dHIuZXZlbnRfbWFzayA9IEJ1dHRvblByZXNzTWFzazsKICAKICAgICAgdmVy
dFNjcm9sbGJhckJnID0gWENyZWF0ZVdpbmRvdyhkcHksIHRvcExldmVsLCAwLCAwLCAxLCAxLCAw
LAotLS0gMjA5LDIzNCAtLS0tCiAgCiAgICAgIC8qIENyZWF0ZSB0aGUgc2Nyb2xsYmFycyAqLwog
IAohICAgICAvKiAtIExpa2UgYmxhY2ssIHNwZWNpYWwgY2FyZSBpcyBuZWVkZWQgZm9yIHdoaXRl
LgohICAgICAgKiAgIFVuZm9ydHVuYXRlbHksIHRoaXMgd2lsbCBmYWlsIGlmIHRoZSBzZXJ2ZXIg
aXMgc2VuZGluZyBhIEJHUjIzMwohICAgICAgKiAgIG1hcC4KISAgICAgICogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW0dSTV0gKi8K
ISAgICAgY29sb3Vy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ZXkiLCAmZ3JleSkpIHsKISAgICAgICAgICAgICAvKiB0cmFuc2xhdGUgdGhlIHBhcnNlZCAi
Z3JleSIgdG8gQkdSMjMzLCBhbmQgdGhlbmNlIHRvIGEgcGl4ZWwgKi8KISAgICAgICAgICAgICBp
bnQgciA9IChncmV5LnJlZCAqIDcpIC8gNjU1MzU7CiEgICAgICAgICAgICAgaW50IGcgPSAoZ3Jl
eS5ncmVlbiAqIDcpIC8gNjU1MzU7CiEgICAgICAgICAgICAgaW50IGIgPSAoZ3JleS5ibHVlICog
MykgLyA2NTUzNTsKISAgICAgICAgICAgICBpbnQgaW5kZXggPSAoYjw8NikgfCAoZzw8MykgfCBy
OwohICAgICAgICAgICAgIGdyZXkucGl4ZWwgPSBCR1IyMzNUb1BpeGVsW2luZGV4ICUgMjU2XTsK
ISAgICAgICAgIH0gZWxzZSB7CiEgICAgICAgICAgICAgLyogbm8gY29sb3VyIC0gdXNlIGJsYWNr
OyBvciB3aGF0ZXZlciB3ZSBfZ3Vlc3NlZF8gaXMgYmxhY2sgKHNpZ2gpLiAqLwohICAgICAgICAg
ICAgIGdyZXkucGl4ZWwgPSBibGFja1BpeGVsOwohICAgICAgICAgfQohICAgICB9CiEgICAgIC8q
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5k
IFtHUk1dICovCiAgCiAgICAgIGF0dHIuYmFja2dyb3VuZF9waXhlbCA9IGdyZXkucGl4ZWw7CiAg
ICAgIGF0dHIuZXZlbnRfbWFzayA9IEJ1dHRvblByZXNzTWFza3xCdXR0b25SZWxlYXNlTWFza3xC
dXR0b25Nb3Rpb25NYXNrOwoqKioqKioqKioqKioqKioKKioqIDY4OSw2OTQgKioqKgotLS0gNzU5
LDc2NSAtLS0tCiAgc3RhdGljIHZvaWQKICBGaW5kQmVzdFZpc3VhbCgpCiAgeworICNpZmRlZiBP
UkxfQ09MT1VSTUFQUyAgICAgICAgICAgICAgICAgICAgICAgICAgICA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YWx3YXlzIGRpc3BsYXllZCBpbiBh
IHBzZXVkby1jb2xvdXIgdmlzdWFsLgorICAgICAgKgorICAgICAgKiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbR1JNXSAqLworICAgICBY
VmlzdWFsSW5mbyAgICAgcXVlcnlWaXN1YWw7CisgCisgICAgIFhQaXhtYXBGb3JtYXRWYWx1ZXMg
KmZvcm1hdDsKKyAgICAgaW50ICAgICAgICAgICAgICAgICBuZm9ybWF0czsKKyAgICAgICAgIGlu
dCByLCBnLCBiOworICAgICAgICAgWENvbG9yICBjOworICAgICAgICAgaW50IGk7CisgICAgICAg
ICBjaGFyIGFsbG9jYXRlZFtDT0xPUk1BUF9TSVpFXTsKKyAgICAgICAgIFhDb2xvciBjb2xvcmNl
bGxzW0NPTE9STUFQX1NJWkVdOworIAorICAgICAvKiBMb29rIGF0IHRoZSBkZWZhdWx0IHZpc3Vh
bCAtIGlzIGl0IFRydWVDb2xvdXI/ICovCisgICAgIHZpcyA9IERlZmF1bHRWaXN1YWwoZHB5LCBE
ZWZhdWx0U2NyZWVuKGRweSkpOworICAgICBpZiAodmlzLT5jbGFzcyAhPSBUcnVlQ29sb3IgJiYg
Zm9yY2VPd25DbWFwID09IEZhbHNlKSB7CisgICAgICAgICAvKiBOb24tVHJ1ZUNvbG91ciAtIHBy
ZXN1bWUgUHNldWRvQ29sb3VyICovCisgICAgICAgICAvKiBhbGxvY2F0ZSBhbmQgaW5pdGlhbGl6
ZSBhIHNtYWxsZXIgQkdSMjMzIG1hcCAqLworIAorICAgICAgICAgY21hcCA9IERlZmF1bHRDb2xv
cm1hcChkcHksIERlZmF1bHRTY3JlZW4oZHB5KSk7CisgICAgICAgICAKKyAgICAgICAgIGlmIChm
b3JjZU1hcFNpemUgPCAyKSB7CisgICAgICAgICAgICAgZm9yY2VNYXBTaXplID0gMjsKKyAgICAg
ICAgIH0KKyAgICAgICAgIAorICAgICAgICAgZm9yIChpID0gMDsgaSA8IENPTE9STUFQX1NJWkU7
IGkrKykgeworICAgICAgICAgICAgIGFsbG9jYXRlZFtpXSA9IDA7CisgICAgICAgICAgICAgQkdS
MjMzVG9QaXhlbFtpXSA9IElOVkFMSURfUElYRUw7CisgICAgICAgICB9CisgCisgICAgICAgICAv
KiBmaXJzdCwgYWxsb2NhdGUgYmxhY2sgYW5kIHdoaXRlICovCisgICAgICAgICBjLnJlZCA9IGMu
Z3JlZW4gPSBjLmJsdWUgPSAwOworICAgICAgICAgaWYgKCFYQWxsb2NDb2xvcihkcHksIGNtYXAs
ICZjKSkgeworICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiQ291bGQgbm90IGFsbG9jYXRl
IGJsYWNrIHBpeGVsIGZvciBzaGFyZWQgQkdSMjMzXG4iKTsKKyAgICAgICAgICAgICBleGl0KDEp
OworICAgICAgICAgfQorICAgICAgICAgQkdSMjMzVG9QaXhlbFswXSA9IGMucGl4ZWw7CisgICAg
ICAgICBhbGxvY2F0ZWRbYy5waXhlbF0gPSAxOworICAgICAgICAgYy5yZWQgPSBjLmdyZWVuID0g
Yy5ibHVlID0gMHhGRkZGOworICAgICAgICAgaWYgKCFYQWxsb2NDb2xvcihkcHksIGNtYXAsICZj
KSkgeworICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiQ291bGQgbm90IGFsbG9jYXRlIHdo
aXRlIHBpeGVsIGZvciBzaGFyZWQgQkdSMjMzXG4iKTsKKyAgICAgICAgICAgICBleGl0KDEpOwor
ICAgICAgICAgfQorICAgICAgICAgQkdSMjMzVG9QaXhlbFsyNTVdID0gYy5waXhlbDsKKyAgICAg
ICAgIGFsbG9jYXRlZFtjLnBpeGVsXSA9IDE7CisgCisgICAgICAgICAvKgorICAgICAgICAgICog
bm93LCB0aGUgcmVzdCBvZiB0aGUgbWFwOyBleGNsdWRlIDAgYW5kIHRoZSBsYXN0IHZhbHVlCisg
ICAgICAgICAgKiAod2hpY2ggYXJlIGJsYWNrIGFuZCB3aGl0ZSwgcmVzcGVjdGl2ZWx5KQorICAg
ICAgICAgICovCisgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgZm9yY2VNYXBTaXplIC0gMTsgaSsr
KSB7CisgICAgICAgICAgICAgLyogY29udmVydCBmcm9tIGFjdHVhbCBtYXAgc2l6ZSB0byB2aXJ0
dWFsIDI1NiBtYXAgKi8KKyAgICAgICAgICAgICBpbnQgaW5kZXggPSAoKGkgKyAxKSAqIDI1Nikg
LyBmb3JjZU1hcFNpemUgLSAxOworICAgICAgICAgICAgIC8qIGFuZCBmcm9tIHRoZW5jZSB0byBy
L2cvYiB2YWx1ZXMgKi8KKyAgICAgICAgICAgICBjLnJlZCA9IChpbmRleCAmIDB4NykgKiA2NTUz
NSAvIDc7CisgICAgICAgICAgICAgYy5ncmVlbiA9ICgoaW5kZXggPj4gMykgJiAweDcpICogNjU1
MzUgLyA3OworICAgICAgICAgICAgIGMuYmx1ZSA9ICgoaW5kZXggPj4gNikgJiAweDMpICogNjU1
MzUgLyAzOworICAgICAgICAgICAgIGlmIChYQWxsb2NDb2xvcihkcHksIGNtYXAsICZjKSkgewor
ICAgICAgICAgICAgICAgICBhbGxvY2F0ZWRbYy5waXhlbF0gPSAxOworICAgICAgICAgICAgICAg
ICBCR1IyMzNUb1BpeGVsW2luZGV4XSA9IGMucGl4ZWw7CisgICAgICAgICAgICAgfQorICAgICAg
ICAgfQorIAorICAgICAgICAgLyoKKyAgICAgICAgICAqIEZpbmFsbHksIGlmIHJlcXVlc3RlZCwg
dHJ5IHRvIHNuYXJmIG90aGVyIHNoYXJlZCBjb2xvdXJzIGluIHRoZSBtYXAKKyAgICAgICAgICAq
LworICAgICAgICAgaWYgKGZvcmNlRXhpc3RpbmdDb2xvdXJzKSB7CisgICAgICAgICAgICAgZm9y
IChpID0gMDsgaSA8IENPTE9STUFQX1NJWkU7IGkrKykgeworICAgICAgICAgICAgICAgICBjb2xv
cmNlbGxzW2ldLnBpeGVsID0gaTsKKyAgICAgICAgICAgICB9CisgCisgICAgICAgICAgICAgWFF1
ZXJ5Q29sb3JzKGRweSwgY21hcCwgY29sb3JjZWxscywgQ09MT1JNQVBfU0laRSk7CisgCisgICAg
ICAgICAgICAgZm9yIChpID0gMDsgaSA8IENPTE9STUFQX1NJWkU7IGkrKykgeworICAgICAgICAg
ICAgICAgICBjLnJlZCA9IGNvbG9yY2VsbHNbaV0ucmVkOworICAgICAgICAgICAgICAgICBjLmdy
ZWVuID0gY29sb3JjZWxsc1tpXS5ncmVlbjsKKyAgICAgICAgICAgICAgICAgYy5ibHVlID0gY29s
b3JjZWxsc1tpXS5ibHVlOworICAgICAgICAgICAgICAgICBpZiAoWEFsbG9jQ29sb3IoZHB5LCBj
bWFwLCAmYykpIHsKKyAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlZFtjLnBpeGVsXSA9IC0x
OyAgICAgLyogZmxhZyBhcyBhbGxvY2F0ZWQvdW51c2VkICovCisgICAgICAgICAgICAgICAgIH0K
KyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgICAgICAgICAKKyAgICAgICAgIC8qCisgICAg
ICAgICAgKiBOb3csIGZpbGwgaW4gdGhlIHJlc3Qgb2YgdGhlIEJHUiBtYXAgd2l0aCB0aGUgY2xv
c2VzdCBhbGxvY2F0ZWQKKyAgICAgICAgICAqIGNvbG91cnMKKyAgICAgICAgICAqLworIAlmb3Ig
KHIgPSAwOyByIDwgODsgcisrKSB7CisgCSAgICBmb3IgKGcgPSAwOyBnIDwgODsgZysrKSB7Cisg
CQlmb3IgKGIgPSAwOyBiIDwgNDsgYisrKSB7CisgCQkgICAgaWYgKEJHUjIzM1RvUGl4ZWxbKGI8
PDYpIHwgKGc8PDMpIHwgcl0gPT0gSU5WQUxJRF9QSVhFTCkgeworICAgICAgICAgICAgICAgICAg
ICAgICAgIHVuc2lnbmVkIGxvbmcgbmVhcmVzdFBpeGVsID0gMDsKKyAgICAgICAgICAgICAgICAg
ICAgICAgICB1bnNpZ25lZCBsb25nIG1pbkRpc3RhbmNlID0gNjU1MzYgKiAzOworIAorICAgICAg
ICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBDT0xPUk1BUF9TSVpFOyBpKyspIHsK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFsbG9jYXRlZFtpXSkgeworICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkaXN0YW5jZQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IChhYnMoY29sb3JjZWxsc1tpXS5yZWQgLSBy
ICogNjU1MzUgLyA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGFi
cyhjb2xvcmNlbGxzW2ldLmdyZWVuIC0gZyAqIDY1NTM1IC8gNykKKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgKyBhYnMoY29sb3JjZWxsc1tpXS5ibHVlIC0gYiAqIDY1NTM1
IC8gMykpOworIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc3RhbmNl
IDwgbWluRGlzdGFuY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt
aW5EaXN0YW5jZSA9IGRpc3RhbmNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIG5lYXJlc3RQaXhlbCA9IGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9
CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAg
ICB9CisgCisgICAgICAgICAgICAgICAgICAgICAgICAgQkdSMjMzVG9QaXhlbFsoYjw8NikgfCAo
Zzw8MykgfCByXSA9IG5lYXJlc3RQaXhlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICBhbGxv
Y2F0ZWRbbmVhcmVzdFBpeGVsXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg
ICAgICAgICAgIH0KKyAgICAgICAgICAgICB9CisgICAgICAgICB9CisgCisgICAgICAgICAvKgor
ICAgICAgICAgICogRnJlZSB1cCBhbGxvY2F0ZWQgYnV0IG5vdCB1c2VkIGNlbGxzLgorICAgICAg
ICAgICovCisgCisgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgQ09MT1JNQVBfU0laRTsgaSsrKSB7
CisgICAgICAgICAgICAgaWYgKGFsbG9jYXRlZFtpXSA9PSAtMSkgeworICAgICAgICAgICAgICAg
ICB1bnNpZ25lZCBsb25nIHBpeGVsc1sxXTsKKyAgICAgICAgICAgICAgICAgcGl4ZWxzWzBdID0g
aTsKKyAgICAgICAgICAgICAgICAgWEZyZWVDb2xvcnMoZHB5LCBjbWFwLCBwaXhlbHMsIDEsIDAp
OworICAgICAgICAgICAgIH0KKyAgICAgICAgIH0KKyAKKyAgICAgICAgIHVzZUJHUjIzMyA9IDE7
CisgICAgICAgICB2aXNkZXB0aCA9IERlZmF1bHREZXB0aChkcHksIERlZmF1bHRTY3JlZW4oZHB5
KSk7CisgICAgICAgICBmb3JjZU93bkNtYXAgPSBGYWxzZTsKKyAgICAgfSBlbHNlIGlmICh2aXMt
PmNsYXNzID09IFRydWVDb2xvciAmJiBmb3JjZU93bkNtYXAgIT0gVHJ1ZSkgeworICAgICAgICAg
Y21hcCA9IERlZmF1bHRDb2xvcm1hcChkcHksIERlZmF1bHRTY3JlZW4oZHB5KSk7CisgICAgICAg
ICB2aXNkZXB0aCA9IERlZmF1bHREZXB0aChkcHksIERlZmF1bHRTY3JlZW4oZHB5KSk7CisgICAg
ICAgICB1c2VCR1IyMzMgPSAwOworICAgICAgICAgZm9yY2VPd25DbWFwID0gRmFsc2U7CisgICAg
IH0gZWxzZSB7CisgICAgICAgICAvKiBYIHNlcnZlciBkb2Vzbid0IGRlZmF1bHQgdG8gVHJ1ZUNv
bG9yLiBUcnkgdG8gZmluZCBhbiBleGFjdCBtYXRjaAorICAgICAgICAgICogZm9yIHRoZSBWTkMg
c2VydmVyLiAqLworICAgICAgICAgaW50IGRlc2lyZWRDbGFzczsKKyAgICAgICAgIGludCBkZXNp
cmVkRGVwdGg7CisgCisgICAgICAgICB2aXMgPSBOVUxMOyAgICAgICAgIC8qIGRpZG4ndCBmaW5k
IGFueXRoaW5nIHlldCAqLworICAgICAgICAgZm9yY2VPd25DbWFwID0gVHJ1ZTsgICAvKiB3ZSB3
aWxsIGhhdmUgYSBwcml2YXRlIGNvbG91cm1hcCAqLworIAorICAgICAgICAgLyogQ2hvb3NlIHRo
ZSBwcmVmZXJyZWQgdmlzdWFsLiAqLworICAgICAgICAgaWYgKHNpLmZvcm1hdC50cnVlQ29sb3Vy
IHx8IGZvcmNlVHJ1ZWNvbG91cikgeworICAgICAgICAgICAgIGRlc2lyZWRDbGFzcyA9IFRydWVD
b2xvcjsKKyAgICAgICAgICAgICBkZXNpcmVkRGVwdGggPSBzaS5mb3JtYXQudHJ1ZUNvbG91ciA/
IHNpLmZvcm1hdC5kZXB0aCA6IDI0OworICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICBk
ZXNpcmVkQ2xhc3MgPSBQc2V1ZG9Db2xvcjsKKyAgICAgICAgICAgICBkZXNpcmVkRGVwdGggPSBz
aS5mb3JtYXQuZGVwdGg7CisgICAgICAgICB9CisgICAgICAgICBpZiAocmVxdWVzdGVkRGVwdGgg
IT0gMCkgeworICAgICAgICAgICAgIGRlc2lyZWREZXB0aCA9IHJlcXVlc3RlZERlcHRoOworICAg
ICAgICAgfQorIAorICAgICAgICAgaWYgKFhNYXRjaFZpc3VhbEluZm8oZHB5LCBEZWZhdWx0U2Ny
ZWVuKGRweSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkRGVwdGgsCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkQ2xhc3MsCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAmcXVlcnlWaXN1YWwpKSB7CisgICAgICAgICAgICAgLyogLSBleGFj
dCBtYXRjaCAqLworICAgICAgICAgICAgIHZpcyA9IHF1ZXJ5VmlzdWFsLnZpc3VhbDsKKyAgICAg
ICAgICAgICB2aXNkZXB0aCA9IGRlc2lyZWREZXB0aDsKKyAgICAgICAgIH0gZWxzZSB7CisgICAg
ICAgICAgICAgLyogbm8gZXhhY3QgbWF0Y2ggLSB1c2UgY2xvc2VzdCBUcnVlQ29sb3VyIG9yIDgt
Yml0IFBzZXVkb0NvbG91ciAqLworICAgICAgICAgICAgIAorICAgICAgICAgICAgIC8qIGxvb2sg
Zm9yIGNsb3Nlc3QgdmlzdWFsIG9mIHNhbWUgdHlwZSAqLworICAgICAgICAgICAgIHZpc2RlcHRo
ID0gMzI7CisgICAgICAgICAgICAgaWYgKHJlcXVlc3RlZERlcHRoICE9IDApIHsKKyAgICAgICAg
ICAgICAgICAgdmlzZGVwdGggPSByZXF1ZXN0ZWREZXB0aDsKKyAgICAgICAgICAgICB9CisgICAg
ICAgICAgICAgd2hpbGUgKHZpc2RlcHRoID4gOCkgeworICAgICAgICAgICAgICAgICB2aXNkZXB0
aCAtPSA4OworICAgICAgICAgICAgICAgICBpZiAoWE1hdGNoVmlzdWFsSW5mbyhkcHksIERlZmF1
bHRTY3JlZW4oZHB5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlz
ZGVwdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRDbGFz
cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnF1ZXJ5VmlzdWFsKSkg
eworICAgICAgICAgICAgICAgICAgICAgLyogbmVhciBtYXRjaCAqLworICAgICAgICAgICAgICAg
ICAgICAgdmlzID0gcXVlcnlWaXN1YWwudmlzdWFsOworICAgICAgICAgICAgICAgICAgICAgdmlz
ZGVwdGggPSB2aXNkZXB0aDsKKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg
ICAgICAgICB9CisgICAgICAgICAgICAgfQorIAorICAgICAgICAgICAgIC8qIGZvciBUcnVlQ29s
b3VyIFZOQyBzZXJ2ZXJzOiBpZiB3ZSBkaWRuJ3QgZmluZCBhIFRydWVDb2xvdXIKKyAgICAgICAg
ICAgICAgKiB2aXN1YWwsIHRyeSBmb3IgYW4gOC1iaXQgcHNldWRvLWNvbG91ciBvbmUuCisgICAg
ICAgICAgICAgICogICAtIE5vdGUgdGhhdCBzb21lIFZOQyBzZXJ2ZXJzIChub3RhYmx5IFdpbjMy
KSBjbG9zZQorICAgICAgICAgICAgICAqICAgICB0aGUgY29ubmVjdGlvbiBpZiB0aGlzIGlzIHRo
ZSBjYXNlLiBTZXR0aW5nIHVwCisgICAgICAgICAgICAgICogICAgIEJHUjIzMyBtYXkgYmUgcHJl
ZmVyYWJsZSBoZXJlLgorICAgICAgICAgICAgICAqIFdlIGNhbiBhbHNvIGdldCBoZXJlLCBmb3Ig
UHNldWRvQ29sb3VyIFZOQyBzZXJ2ZXJzLAorICAgICAgICAgICAgICAqIGlmIHRoZSAtdHJ1ZWNv
bG91ciBvcHRpb24gd2FzIHNldAorICAgICAgICAgICAgICAqIGJ1dCBubyBUcnVlQ29sb3VyIHZp
c3VhbCB3YXMgYXZhaWxhYmxlLgorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGlmICh2
aXMgPT0gTlVMTCAmJiBzaS5mb3JtYXQudHJ1ZUNvbG91cikgeworICAgICAgICAgICAgICAgICBp
ZiAoWE1hdGNoVmlzdWFsSW5mbyhkcHksIERlZmF1bHRTY3JlZW4oZHB5KSwKKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgsIFBzZXVkb0NvbG9yLAorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgJnF1ZXJ5VmlzdWFsKSkgeworICAgICAgICAgICAg
ICAgICAgICAgdmlzID0gcXVlcnlWaXN1YWwudmlzdWFsOworICAgICAgICAgICAgICAgICAgICAg
dmlzZGVwdGggPSA4OworICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAg
ICAgICAgIAorICAgICAgICAgICAgIGlmICh2aXMgPT0gTlVMTCkgeworICAgICAgICAgICAgICAg
ICBmcHJpbnRmKHN0ZGVyciwgIkNvdWxkbid0IGZpbmQgYW4gYXBwcm9wcmlhdGUgdmlzdWFsIC0g
Z2l2aW5nIHVwLlxuIik7CisgICAgICAgICAgICAgICAgIGV4aXQoMSk7CisgICAgICAgICAgICAg
fQorICAgICAgICAgfQorIAorICAgICAgICAgLyogRm91bmQgc29tZXRoaW5nLiBMZXQncyBydW4g
d2l0aCBpdC4gKi8KKyAgICAgICAgIGNtYXAgPSBYQ3JlYXRlQ29sb3JtYXAoZHB5LCBEZWZhdWx0
Um9vdFdpbmRvdyhkcHkpLCB2aXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZp
cy0+Y2xhc3MgPT0gVHJ1ZUNvbG9yID8gQWxsb2NOb25lIDogQWxsb2NBbGwpOworIAorICAgICAg
ICAgaWYgKGNtYXAgPT0gTm9uZSkgeworICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiQ291
bGRuJ3QgY3JlYXRlIGNvbG91cm1hcCAtIGdpdmluZyB1cC5cbiIpOworICAgICAgICAgICAgIGV4
aXQoMSk7CisgICAgICAgICB9CisgCisgICAgICAgICAvKiBJZiBpdCBpcyBhIFBzZXVkb0NvbG91
ciB2aXN1YWwsIHNldCB1cCBCR1IyMzMgaWYgcmVxdWVzdGVkICovCisgICAgICAgICBpZiAodmlz
LT5jbGFzcyA9PSBQc2V1ZG9Db2xvciAmJiB1c2VCR1IyMzMpIHsKKyAgICAgICAgICAgICBpbnQg
ciwgZywgYjsKKyAgICAgICAgICAgICBYQ29sb3IgIGM7CisgICAgICAgICAgICAgaW50IGkgPSAw
OworIAorICAgICAgICAgICAgIGZvciAociA9IDA7IHIgPCA4OyByKyspIHsKKyAgICAgICAgICAg
ICAgICAgZm9yIChnID0gMDsgZyA8IDg7IGcrKykgeworICAgICAgICAgICAgICAgICAgICAgZm9y
IChiID0gMDsgYiA8IDQ7IGIrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgIGMucmVkID0g
ciAqIDY1NTM1IC8gNzsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjLmdyZWVuID0gZyAqIDY1
NTM1IC8gNzsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjLmJsdWUgPSBiICogNjU1MzUgLyAz
OworICAgICAgICAgICAgICAgICAgICAgICAgIGMucGl4ZWwgPSBpOworICAgICAgICAgICAgICAg
ICAgICAgICAgIGMuZmxhZ3MgPSBEb1JlZCB8IERvR3JlZW4gfCBEb0JsdWU7CisgICAgICAgICAg
ICAgICAgICAgICAgICAgWFN0b3JlQ29sb3IoZHB5LCBjbWFwLCAmYyk7CisgICAgICAgICAgICAg
ICAgICAgICAgICAgQkdSMjMzVG9QaXhlbFsoYjw8NikgfCAoZzw8MykgfCByXSA9IGk7CisgICAg
ICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg
ICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAg
ICAgICAvKiBub24gUHNldWRvQ29sb3VyIHZpc3VhbCBvciBub3QgdXNpbmcgQkdSMjMzLCBrZWVw
IGZsYWcgb2ZmICovCisgICAgICAgICAgICAgdXNlQkdSMjMzID0gMDsKKyAgICAgICAgIH0KKyAg
ICAgfSAvKiBlbmQgaWYgZGVmYXVsdCB2aXN1YWwgaXMgVHJ1ZUNvbG91ci9lbHNlICovCisgCisg
ICAgIGZvcm1hdCA9IFhMaXN0UGl4bWFwRm9ybWF0cyhkcHksICZuZm9ybWF0cyk7CisgCisgICAg
IHdoaWxlIChmb3JtYXQtPmRlcHRoICE9IHZpc2RlcHRoKSB7CisgCWZvcm1hdCsrOworIAlpZiAo
LS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U3luYyhkcHksRmFsc2UpOwogIAo=

--_=XFMail.1.3.p0.Solaris:981021095723:18016=_--
End of MIME message

--_=XFMail.1.3.p0.Solaris:981021095729:18016=_
Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE-----
Version: 2.6.2

iQBVAwUBNi3oSUDmya2cFZ8ZAQERFwH/VupKXtcE6mb7ghXHc7189/027cGGIPym
dVpssCTZDN3iPTRw4X8KMkr5hYYwU7E9FUfDMLu9z/LxNe+bBfixhw==
=722c
-----END PGP MESSAGE-----

--_=XFMail.1.3.p0.Solaris:981021095729:18016=_--
End of MIME message

---------------------------------------------------------------------
The VNC mailing list     -   see http://www.orl.co.uk/vnc/intouch.html
---------------------------------------------------------------------