*** empty log message ***
authorroot <root>
Wed, 15 Oct 2008 14:48:21 +0000 (14:48 +0000)
committerroot <root>
Wed, 15 Oct 2008 14:48:21 +0000 (14:48 +0000)
Changes
doc/rxvt.1.pod
src/command.C
src/rxvt.h
src/screen.C

diff --git a/Changes b/Changes
index 5966e92562719e237cdfa5485d1f302ae89a633a..cf81c5cec86017a8b34fa40beaad2a3d3c01023b 100644 (file)
--- 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).
index 2f6b18d7c3c051bff1350976ddfa45d63b465740..6abc73f422e5420c7ad6cfd5ab0e3030208e54d4 100644 (file)
@@ -854,6 +854,8 @@ de-iconify (map) on receipt of a bell character [default].
 B<True>: set the urgency hint for the wm on receipt of a bell character.
 B<False>: do not set the urgency hint [default].
 
+@@RXVT_NAME@@ resets the urgency hint on every focus change.
+
 =item B<visualBell:> I<boolean>
 
 B<True>: use visual bell on receipt of a bell character; option B<-vb>.
index 8679ad790c14fdd0db19b06eb8b6ed7ffc9e82d6..737271d4190730a95b5312dca7594c0153a88497 100644 (file)
@@ -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));
     }
 }
 
index 3978d25c2810b8e4d88673101e8f7083f4ee1030..7a7cf35f80b7ce165b9188e2376e27476ae47181 100644 (file)
@@ -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 ();
index 02b2e7c90710116b884b9bf21efeae50267fce10..a9a0415c42f1c96212bb167568fb37044ede735c 100644 (file)
@@ -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))