From: root Date: Wed, 15 Oct 2008 14:48:21 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=9c3e765c2f233985cc0b5d1070607e372ddd18da;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 5966e925..cf81c5ce 100644 --- a/Changes +++ b/Changes @@ -23,9 +23,10 @@ TODO: /*TODO: the xlceararea/xfillrectangle below don't take scroll offste int TODO: artificially enlargen wide characters at end to correctly cut&paste. TODO: cursor over overlays, when focus change? -TODO: focus leave == reset urgent hint? - remove bogus "setuid/setgid security issues" from rxvt.1.pod, they no longer apply. + - the urgency hint is now cleared on both focus in and focus out. + - cache urgency hint locally to avoid server rtt on every focus change. - perl 5.10 needs PERL_SYS_INIT3 on hppa. - ignore byte-order marks and do not treat them like combining characters. - fix build issue when CURSOR_BLINK is not defined (Emanuele Giaquinta). diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 2f6b18d7..6abc73f4 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -854,6 +854,8 @@ de-iconify (map) on receipt of a bell character [default]. B: set the urgency hint for the wm on receipt of a bell character. B: do not set the urgency hint [default]. +@@RXVT_NAME@@ resets the urgency hint on every focus change. + =item B I B: use visual bell on receipt of a bell character; option B<-vb>. diff --git a/src/command.C b/src/command.C index 8679ad79..737271d4 100644 --- a/src/command.C +++ b/src/command.C @@ -1684,6 +1684,20 @@ rxvt_term::x_cb (XEvent &ev) refresh_check (); } +void +rxvt_term::set_urgency (bool enable) +{ + if (enable == urgency_hint) + return; + + if (XWMHints *h = XGetWMHints (dpy, parent[0])) + { + h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0); + XSetWMHints (dpy, parent[0], h); + urgency_hint = enable; + } +} + void rxvt_term::focus_in () { @@ -1692,8 +1706,6 @@ rxvt_term::focus_in () focus = 1; want_refresh = 1; - HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); - #if USE_XIM if (Input_Context != NULL) { @@ -1714,14 +1726,10 @@ rxvt_term::focus_in () #endif #if ENABLE_FRILLS if (option (Opt_urgentOnBell)) - { - if (XWMHints *h = XGetWMHints(dpy, parent[0])) - { - h->flags &= ~XUrgencyHint; - XSetWMHints (dpy, parent[0], h); - } - } + set_urgency (0); #endif + + HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END)); } } @@ -1733,8 +1741,10 @@ rxvt_term::focus_out () focus = 0; want_refresh = 1; - HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); - +#if ENABLE_FRILLS + if (option (Opt_urgentOnBell)) + set_urgency (0); +#endif #if ENABLE_FRILLS || ISO_14755 if (iso14755buf) { @@ -1761,6 +1771,8 @@ rxvt_term::focus_out () scr_recolour (); } #endif + + HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); } } diff --git a/src/rxvt.h b/src/rxvt.h index 3978d25c..7a7cf35f 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -945,6 +945,9 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { current_screen:1, /* primary or secondary */ num_scr_allow:1, bypass_keystate:1, +#ifdef ENABLE_FRILLS + urgency_hint:1, +#endif #ifdef CURSOR_BLINK hidden_cursor:1, #endif @@ -1197,6 +1200,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { void button_release (XButtonEvent &ev); void focus_in (); void focus_out (); + void set_urgency (bool enable); void update_fade_color (unsigned int idx); #ifdef PRINTPIPE FILE *popen_printer (); diff --git a/src/screen.C b/src/screen.C index 02b2e7c9..a9a0415c 100644 --- a/src/screen.C +++ b/src/screen.C @@ -1901,13 +1901,7 @@ rxvt_term::scr_bell () NOTHROW # if ENABLE_FRILLS if (option (Opt_urgentOnBell)) - { - if (XWMHints *h = XGetWMHints(dpy, parent[0])) - { - h->flags |= XUrgencyHint; - XSetWMHints (dpy, parent[0], h); - } - } + set_urgency (1); # endif if (option (Opt_visualBell))