From 6d5d8f5e8cc7fc98ebdce765d1cfa8f2fe6ead97 Mon Sep 17 00:00:00 2001
From: root
Date: Mon, 9 Jan 2006 07:17:24 +0000
Subject: [PATCH] *** empty log message ***
---
Changes | 4 +++-
doc/rxvtperl.3.html | 10 +++++++++-
doc/rxvtperl.3.man.in | 7 ++++++-
doc/rxvtperl.3.txt | 7 ++++++-
src/perl/selection-popup | 10 ++++------
src/rxvtfont.C | 6 ++----
6 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/Changes b/Changes
index f87b7b79..2ea48c39 100644
--- a/Changes
+++ b/Changes
@@ -10,7 +10,9 @@ WISH: just for fun, do shade and tint with XRender.
WISH: support tex fonts
- added sections for DISTRIBUTION MAINTAINERS and about
- SETUID/SETGID operation tot he FAQ.
+ SETUID/SETGID to the FAQ.
+ - increased xft drawing speed for problematic fonts, speed
+ seems to be entirely server-dependent now.
- selection, selection-popup and option-popup extensions
enabled by default.
- perl: much increased functionality, better overlays, popup support
diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html
index 8cd590b5..e9499e97 100644
--- a/doc/rxvtperl.3.html
+++ b/doc/rxvtperl.3.html
@@ -435,6 +435,14 @@ that calls this function.
correct place, e.g. on stderr of the connecting urxvtc client.
+$is_safe = urxvt::safe
+
+
+Returns true when it is safe to do potentially unsafe things, such as
+evaluating perl code specified by the user. This is true when urxvt was
+started setuid or setgid.
+
+
$time = urxvt::NOW
@@ -951,7 +959,7 @@ Converts rxvt-unicodes text reprsentation into a perl string. See
$success = $term->grab_button ($button, $modifiermask)
-Registers a synchronous button grab. See XGrabButton.
+Registers a synchronous button grab. See the XGrabButton manpage.
$success = $term->grab ($eventtime[, $sync])
diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in
index 4feb99a7..7fb87dd6 100644
--- a/doc/rxvtperl.3.man.in
+++ b/doc/rxvtperl.3.man.in
@@ -449,6 +449,11 @@ that calls this function.
.Sp
Using this function has the advantage that its output ends up in the
correct place, e.g. on stderr of the connecting urxvtc client.
+.IP "$is_safe = urxvt::safe" 4
+.IX Item "$is_safe = urxvt::safe"
+Returns true when it is safe to do potentially unsafe things, such as
+evaluating perl code specified by the user. This is true when urxvt was
+started setuid or setgid.
.IP "$time = urxvt::NOW" 4
.IX Item "$time = urxvt::NOW"
Returns the \*(L"current time\*(R" (as per the event loop).
@@ -876,7 +881,7 @@ Converts rxvt-unicodes text reprsentation into a perl string. See
.ie n .IP "$success = $term\fR\->grab_button ($button, \f(CW$modifiermask)" 4
.el .IP "$success = \f(CW$term\fR\->grab_button ($button, \f(CW$modifiermask\fR)" 4
.IX Item "$success = $term->grab_button ($button, $modifiermask)"
-Registers a synchronous button grab. See XGrabButton.
+Registers a synchronous button grab. See the XGrabButton manpage.
.ie n .IP "$success = $term\fR\->grab ($eventtime[, \f(CW$sync])" 4
.el .IP "$success = \f(CW$term\fR\->grab ($eventtime[, \f(CW$sync\fR])" 4
.IX Item "$success = $term->grab ($eventtime[, $sync])"
diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt
index 83ee95c2..1ecff564 100644
--- a/doc/rxvtperl.3.txt
+++ b/doc/rxvtperl.3.txt
@@ -274,6 +274,11 @@ DESCRIPTION
Using this function has the advantage that its output ends up in the
correct place, e.g. on stderr of the connecting urxvtc client.
+ $is_safe = urxvt::safe
+ Returns true when it is safe to do potentially unsafe things, such
+ as evaluating perl code specified by the user. This is true when
+ urxvt was started setuid or setgid.
+
$time = urxvt::NOW
Returns the "current time" (as per the event loop).
@@ -601,7 +606,7 @@ DESCRIPTION
"$term->ROW_t" for details.
$success = $term->grab_button ($button, $modifiermask)
- Registers a synchronous button grab. See XGrabButton.
+ Registers a synchronous button grab. See the XGrabButton manpage.
$success = $term->grab ($eventtime[, $sync])
Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
diff --git a/src/perl/selection-popup b/src/perl/selection-popup
index 6fc3883c..ce3fe526 100644
--- a/src/perl/selection-popup
+++ b/src/perl/selection-popup
@@ -1,12 +1,10 @@
#! perl
sub msg {
- my ($self, $msg1, $msg2) = @_;
+ my ($self, $msg) = @_;
- my $overlay = $self->overlay (0, 0,
- (List::Util::max map $self->strwidth ($_), $msg1, $msg2), 2);
- $overlay->set (0, 0, $msg1);
- $overlay->set (0, 1, $msg2);
+ my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
+ $overlay->set (0, 0, $msg);
my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 1)->cb (sub {
undef $overlay;
undef $iow;
@@ -47,7 +45,7 @@ sub on_button_press {
if ($orig ne $_) {
$self->selection ($_);
s/[\x00-\x1f\x80-\x9f]/·/g;
- $self->msg ("Selection replaced by", $_);
+ $self->msg ($self->special_encode ($_));
}
}
});
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
index da846c3e..77934082 100644
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -1273,13 +1273,11 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
{
clear_rect (d, x, y, r->fwidth * len, r->fheight, bg);
- int base = ascent; // should be fbase, but that is incorrect
-
XGlyphInfo extents;
XftGlyphSpec *enc = (XftGlyphSpec *) get_enc_buf (len * sizeof (XftGlyphSpec));
XftGlyphSpec *ep = enc;
- // skip trailing spaces
+ // cut trailing spaces
while (len && text [len - 1] == ' ')
len--;
@@ -1298,7 +1296,7 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
ep->glyph = gl;
ep->x = x + (cwidth - extents.xOff >> 1);
- ep->y = y + base;
+ ep->y = y + ascent;
ep++;
}
--
2.34.1