*** empty log message ***
authorroot <root>
Mon, 24 Dec 2007 08:21:38 +0000 (08:21 +0000)
committerroot <root>
Mon, 24 Dec 2007 08:21:38 +0000 (08:21 +0000)
Changes
src/perl/urxvt-popup
src/rxvttoolkit.C
src/urxvt.pm

diff --git a/Changes b/Changes
index 233f309..bb07eb1 100644 (file)
--- a/Changes
+++ b/Changes
@@ -28,6 +28,7 @@ DUMB: support tex fonts
        - fix redraw bug in xterm scrollbar with -sr (reported by Mikachu).
         - correctly provide dependencies for libev (µikachu).
         - minor code reorganisations and cleanups.
+        - be more robust in case the urxvt-popup extension cannot be loaded.
 
 8.8  Sat Dec 15 19:40:39 CET 2007
         - option -C was aliased to all unsupported options, activating
index a1f0c62..4b01c18 100644 (file)
@@ -108,6 +108,8 @@ sub on_init {
 
    $self->resource (geometry => "${width}x${height}$pos");
 
+   $self->{term}{urxvt_popup_init_done} = 1;
+
    ()
 }
 
index bc85594..a1f8bd3 100644 (file)
@@ -602,8 +602,10 @@ void rxvt_display::set_selection_owner (rxvt_term *owner)
 {
   if (selection_owner && selection_owner != owner)
     {
-      selection_owner->selection_clear ();
-      flush ();
+      rxvt_term *owner = selection_owner;
+
+      owner->selection_clear ();
+      owner->flush ();
     }
 
   selection_owner = owner;
index fe1570a..610328c 100644 (file)
@@ -1956,14 +1956,21 @@ sub show {
    delete $env->{LC_ALL};
    $env->{LC_CTYPE} = $self->{term}->locale;
 
-   urxvt::term->new ($env, "popup",
-                     "--perl-lib" => "", "--perl-ext-common" => "",
-                     "-pty-fd" => -1, "-sl" => 0,
-                     "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect",
-                     "--transient-for" => $self->{term}->parent,
-                     "-display" => $self->{term}->display_id,
-                     "-pe" => "urxvt-popup")
-      or die "unable to create popup window\n";
+   my $term = urxvt::term->new (
+      $env, "popup",
+      "--perl-lib" => "", "--perl-ext-common" => "",
+      "-pty-fd" => -1, "-sl" => 0,
+      "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect",
+      "--transient-for" => $self->{term}->parent,
+      "-display" => $self->{term}->display_id,
+      "-pe" => "urxvt-popup",
+   ) or die "unable to create popup window\n";
+
+   unless (delete $term->{urxvt_popup_init_done}) {
+      $term->ungrab;
+      $term->destroy;
+      die "unable to initialise popup window\n";
+   }
 }
 
 sub DESTROY {