From: root Date: Fri, 20 Jan 2006 18:50:49 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=2bf5c4743cad76a32f6cd843c1174ca5563c00a1;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/command.C b/src/command.C index 3e8a8c8c..fbbaecc1 100644 --- a/src/command.C +++ b/src/command.C @@ -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; diff --git a/src/hookinc.h b/src/hookinc.h index ea23d61e..203632f9 100644 --- a/src/hookinc.h +++ b/src/hookinc.h @@ -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? diff --git a/src/perl/tabbed b/src/perl/tabbed index 7af6ec21..7169d0db 100644 --- a/src/perl/tabbed +++ b/src/perl/tabbed @@ -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} diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index eb0ebe6d..bf63b466 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -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) diff --git a/src/urxvt.pm b/src/urxvt.pm index 773747bc..b4203134 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -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