Re: GNOME and VNC



Assalamu'alaikum wr. wb.

If you use install VNC from RPM like I do. Just edit your /etc/vnc.conf.
And set the $depth and $pixelformat. If you don't know the value
just run the following perl script in your XWindow session. 
Taken from vncserver and slightly modified to print the value.

You might want to uncomment the above wmDecorationWidth and 
wmDecorationHeight and comment the below one, so your vncviewer fit 
perfectly in Windows with autohide taskbar.

------------------------------------------------------------------------
#!/usr/bin/perl -w
#
# GetXDisplayDefaults uses xdpyinfo to find out the geometry, depth and pixel
# format of the current X display being used.  If successful, it sets the
# options as appropriate so that the X VNC server will use the same settings
# (minus an allowance for window manager decorations on the geometry).  Using
# the same depth and pixel format means that the VNC server won't have to
# translate pixels when the desktop is being viewed on this X display (for
# TrueColor displays anyway).
#

&GetXDisplayDefaults;
print qq(\$geometry = "$geometry";\n);
print qq(\$depth = $depth;\n);
print qq(\$pixelformat = "$pixelformat";\n);

sub GetXDisplayDefaults
{
    local (@lines, @matchlines, $width, $height, $defaultVisualId, $i,
	   $red, $green, $blue);

    #$wmDecorationWidth = 4;	# a guess at typical size for window manager
    #$wmDecorationHeight = 24;	# decoration size
    $wmDecorationWidth = 0;	# a guess at typical size for window manager
    $wmDecorationHeight = 0;	# decoration size

    return if (!defined($ENV{DISPLAY}));

    @lines = `xdpyinfo 2>/dev/null`;

    return if ($? != 0);

    @matchlines = grep(/dimensions/, @lines);
    if (@matchlines) {
	($width, $height) = ($matchlines[0] =~ /(\d+)x(\d+) pixels/);

	$width -= $wmDecorationWidth;
	$height -= $wmDecorationHeight;

	$geometry = "${width}x$height";
    }

    @matchlines = grep(/default visual id/, @lines);
    if (@matchlines) {
	($defaultVisualId) = ($matchlines[0] =~ /id:\s+(\S+)/);

	for ($i = 0; $i < @lines; $i++) {
	    if ($lines[$i] =~ /^\s*visual id:\s+$defaultVisualId$/) {
		if (($lines[$i+1] !~ /TrueColor/) ||
		    ($lines[$i+2] !~ /depth/) ||
		    ($lines[$i+4] !~ /red, green, blue masks/))
		{
		    return;
		}
		last;
	    }
	}

	return if ($i >= @lines);

	($depth) = ($lines[$i+2] =~ /depth:\s+(\d+)/);
	($red,$green,$blue)
	    = ($lines[$i+4]
	       =~ /masks:\s+0x([0-9a-f]+), 0x([0-9a-f]+), 0x([0-9a-f]+)/);

	$red = hex($red);
	$green = hex($green);
	$blue = hex($blue);

	if ($red > $blue) {
	    $red = int(log($red) / log(2)) - int(log($green) / log(2));
	    $green = int(log($green) / log(2)) - int(log($blue) / log(2));
	    $blue = int(log($blue) / log(2)) + 1;
	    $pixelformat = "rgb$red$green$blue";
	} else {
	    $blue = int(log($blue) / log(2)) - int(log($green) / log(2));
	    $green = int(log($green) / log(2)) - int(log($red) / log(2));
	    $red = int(log($red) / log(2)) + 1;
	    $pixelformat = "bgr$blue$green$red";
	}
    }
}
------------------------------------------------------------------------



Bruno Lustosa wrote:
> 
> Hi!
> 
> I'm trying GNOME from VNC (VNC Server running on RH Linux, GNOME 1.2) and
> viewer in a NT workstation.
> There are some odd color problems though. Some things appear fine (for
> example, the panel looks correctly, and main window of Licq looks ok too).
> However, Licq title bar has all sorts of colors (red, orange, yellow and
> green mainly), background color is same kind of colors (it should be a
> bluish gradient), and icons on root window weird colors as well.
> If I run it locally, it displays fine. I tried the same VNC server with
> Window Maker, which leads me to believe this is not an issue with VNC.
> Is anyone having trouble trying to put GNOME to work with VNC ?
> 
> --
>   .~.   Bruno Lustosa Pereira <bruno@lustosa.net>    | UIN 1406477
>   /V\   Linux: The choice of a GNU generation!       | Linux Reg'd User #162375
>  // \\  For PGP key, send message with subject "PGP" |
> /(   )\
>  ^^-^^  ... A esperanca eh a ultima que morre... MAS MORRE!

Wassallam,




-- Zakaria
    
PT. Asia Karsa Indah               z4k4ri4@bigfoot.com
Advanced Technologies              z4k4ri4@yahoo.com
Jl. Raya Kalimalang 4B, Jakarta    zakaria@asia-karsa.com
Telp : (62-21) 8649318             http://www.asia-karsa.com
Fax  : (62-21) 8649316             http://linux.or.id/pemula




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]