Subject: | GetImage visual "None" |
Date: | Tue, 26 Apr 2011 07:45:31 +1000 |
To: | bug-X11-Protocol [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
I think GetImage returns visual 0 for no visual when getting from a
pixmap, per foo.pl below
perl foo.pl
=>
24, 0, somebytes...
Is that meant to be string "None" when in interp mode?
Similar to other returns, perhaps per diff below.
use strict;
use X11::Protocol;
my $X = X11::Protocol->new;
my $pixmap = $X->new_rsrc;
$X->CreatePixmap ($pixmap,
$X->root,
$X->root_depth,
2,2); # width,height
my @ret = $X->GetImage ($pixmap, 0,0, 1,1, ~0, 'ZPixmap');
$, = ', ';
print @ret;
print "\n";
--- Protocol.pm.orig 2006-10-09 06:16:30.000000000 +1000
+++ Protocol.pm 2011-04-26 07:24:33.000000000 +1000
@@ -1502,6 +1502,7 @@
my($data) = @_;
my($depth, $visual) = unpack("xCxxxxxxLxxxxxxxxxxxxxxxxxxxx",
substr($data, 0, 32));
+ $visual = "None" if $visual == 0 and $self->{'do_interp'};
return ($depth, $visual, substr($data, 32));
}],
@@ -3023,6 +3024,8 @@
$x->GetImage($drawable, ($x, $y), $width, $height, $plane_mask,
$format)
+ =>
+ ($depth, $visual, $data)
$x->PolyText8($drawable, $gc, ($x, $y),
($font OR [$delta, $string]), ...)