*** empty log message ***
authorroot <root>
Fri, 20 Jan 2006 18:50:49 +0000 (18:50 +0000)
committerroot <root>
Fri, 20 Jan 2006 18:50:49 +0000 (18:50 +0000)
src/command.C
src/hookinc.h
src/perl/tabbed
src/rxvtperl.xs
src/urxvt.pm

index 3e8a8c8cce3e4f5311ce6f312f582823a6571019..fbbaecc15db8421f766d8714e84b06930b490bcb 100644 (file)
@@ -1494,9 +1494,10 @@ rxvt_term::x_cb (XEvent &ev)
         break;
 
       case PropertyNotify:
-        if (ev.xproperty.atom == xa[XA_VT_SELECTION]
-            && ev.xproperty.state == PropertyNewValue)
-          selection_property (ev.xproperty.window, ev.xproperty.atom);
+        if (!HOOK_INVOKE ((this, HOOK_PROPERTY_NOTIFY, DT_XEVENT, &ev, DT_END)))
+          if (ev.xproperty.atom == xa[XA_VT_SELECTION]
+              && ev.xproperty.state == PropertyNewValue)
+            selection_property (ev.xproperty.window, ev.xproperty.atom);
 
         break;
 
index ea23d61e5e390b3915baf50b4f5f7958e07d34be..203632f9ddff8aa9147b853f3a7b0dd05bdaeafe 100644 (file)
@@ -40,6 +40,7 @@
   def (CLIENT_MESSAGE)
   def (WM_DELETE_WINDOW)
   def (WM_PROTOCOLS)
+  def (PROPERTY_NOTIFY)
 
   def (CUSTOM_REND) // hovering over custom rendition, generate enter/leave maybe?
 
index 7af6ec212e3c3bf41386105a43eb18c8ac8a573d..7169d0dbd8c25a3b41d50bb9045315c6db2ea1a3 100644 (file)
@@ -78,11 +78,20 @@ sub configure {
       0, $self->{tabheight},
       $self->width, $self->height - $self->{tabheight}
    );
+}
+
+sub copy_properties {
+   my ($self) = @_;
+   my $tab = $self->{cur};
 
    my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS");
 
+   my %our_props = map +($_ => undef), $self->XListProperties ($self->parent);
+
    for my $atom ($tab->XListProperties ($tab->parent)) {
       my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
+      
+      delete $our_props{$atom};
 
       if ($atom == $wm_normal_hints) {
          my (@hints) = unpack "l!*", $items;
@@ -94,7 +103,7 @@ sub configure {
       $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items);
    }
 
-   $self->refresh;
+   $self->XDeleteProperty ($self->parent, $_) for keys %our_props;
 }
 
 sub make_current {
@@ -109,6 +118,7 @@ sub make_current {
    $self->{cur} = $tab;
 
    $self->configure;
+   $self->copy_properties;
    $tab->focus_in;
    $tab->XMapWindow ($tab->parent);
    delete $tab->{activity};
@@ -187,6 +197,8 @@ sub on_wm_delete_window {
 sub tab_start {
    my ($self, $tab) = @_;
 
+   $tab->XChangeInput ($tab->parent, urxvt::PropertyChangeMask);
+
    push @{ $self->{tabs} }, $tab;
 
 #   $tab->{name} ||= scalar @{ $self->{tabs} };
@@ -238,6 +250,15 @@ sub tab_key_press {
    ()
 }
 
+sub tab_property_notify {
+   my ($self, $tab, $event) = @_;
+
+   $self->copy_properties
+      if $event->{window} == $tab->parent;
+
+   ()
+}
+
 sub tab_activity {
    my ($self, $tab) = @_;
 
@@ -250,7 +271,7 @@ package urxvt::ext::tabbed::tab;
 # simply proxies all interesting calls back to the tabbed class.
 
 {
-   for my $hook qw(start destroy key_press) {
+   for my $hook qw(start destroy key_press property_notify) {
       eval qq{
          sub on_$hook {
             my \$parent = \$_[0]{term}{parent}
index eb0ebe6dd14fe4b8f041a10c310d10fedf6dbf8d..bf63b466fca7dfbe0808b51ea676c9f42c3240e1 100644 (file)
@@ -642,6 +642,13 @@ rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
 
                         break;
 
+                      case PropertyNotify:
+                        setuv (window,       xe->xproperty.window);
+                        setuv (atom,         xe->xproperty.atom);
+                        setuv (time,         xe->xproperty.time);
+                        setiv (state,        xe->xproperty.state);
+                        break;
+
                       case ClientMessage:
                         setuv (window,       xe->xclient.window);
                         setuv (message_type, xe->xclient.message_type);
@@ -651,6 +658,7 @@ rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
                         setuv (l2,           xe->xclient.data.l[2]);
                         setuv (l3,           xe->xclient.data.l[3]);
                         setuv (l4,           xe->xclient.data.l[4]);
+                        break;
                     }
 
                   XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
@@ -1740,7 +1748,16 @@ XUnmapWindow (rxvt_term *term, Window window)
 
 void
 XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height)
-       C_ARGS: term->display->display, (Window)window, x, y, width, height
+       C_ARGS: term->display->display, window, x, y, width, height
+
+void
+rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0)
+       CODE:
+{
+       XWindowAttributes attr;
+        XGetWindowAttributes (THIS->display->display, window, &attr);
+        XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events);
+}
 
 void
 rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
index 773747bcc4515715f164a9090140478ea6a0bc88..b42031346dd7aaf91b88cebb93af9de38bcf79d1 100644 (file)
@@ -478,6 +478,8 @@ focus out processing.
 
 =item on_configure_notify $term, $event
 
+=item on_property_notify $term, $event
+
 =item on_key_press $term, $event, $keysym, $octets
 
 =item on_key_release $term, $event, $keysym