Revision: 2825
          http://tmux.svn.sourceforge.net/tmux/?rev=2825&view=rev
Author:   tcunha
Date:     2012-06-18 15:17:55 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
Sync OpenBSD patchset 1137:

Tidy up bell code, from Thomas Adam.

Modified Paths:
--------------
    trunk/server-window.c

Modified: trunk/server-window.c
===================================================================
--- trunk/server-window.c       2012-06-18 15:15:32 UTC (rev 2824)
+++ trunk/server-window.c       2012-06-18 15:17:55 UTC (rev 2825)
@@ -76,46 +76,25 @@
                return (0);
        if (s->curw != wl || s->flags & SESSION_UNATTACHED)
                wl->flags |= WINLINK_BELL;
+       if (s->flags & SESSION_UNATTACHED)
+               return (1);
 
+       visual = options_get_number(&s->options, "visual-bell");
        action = options_get_number(&s->options, "bell-action");
-       switch (action) {
-       case BELL_ANY:
-               if (s->flags & SESSION_UNATTACHED)
-                       break;
-               visual = options_get_number(&s->options, "visual-bell");
-               for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
-                       c = ARRAY_ITEM(&clients, i);
-                       if (c == NULL || c->session != s)
-                               continue;
-                       if (!visual) {
-                               tty_bell(&c->tty);
-                               continue;
-                       }
-                       if (c->session->curw->window == w) {
-                               status_message_set(c, "Bell in current window");
-                               continue;
-                       }
-                       status_message_set(c, "Bell in window %u",
-                           winlink_find_by_window(&s->windows, w)->idx);
+       for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+               c = ARRAY_ITEM(&clients, i);
+               if (c == NULL || c->session != s)
+                       continue;
+               if (!visual) {
+                       tty_bell(&c->tty);
+                       continue;
                }
-               break;
-       case BELL_CURRENT:
-               if (s->flags & SESSION_UNATTACHED)
-                       break;
-               visual = options_get_number(&s->options, "visual-bell");
-               for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
-                       c = ARRAY_ITEM(&clients, i);
-                       if (c == NULL || c->session != s)
-                               continue;
-                       if (c->session->curw->window != w)
-                               continue;
-                       if (!visual) {
-                               tty_bell(&c->tty);
-                               continue;
-                       }
+               if (c->session->curw->window == w)
                        status_message_set(c, "Bell in current window");
+               else if (action == BELL_ANY) {
+                       status_message_set(c, "Bell in window %u",
+                               winlink_find_by_window(&s->windows, w)->idx);
                }
-               break;
        }
 
        return (1);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to