URI:
       Fix center + second placement problem - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
  HTML git clone https://git.drkhsh.at/tty-clock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 9f8a9cc1322b25468ddedb821df53d94e1022c73
   DIR parent 6b0b537738e6d2717a30d3bdd0b9f5feb83f0076
  HTML Author: Martin Duquesnoy <xorg62@gmail.com>
       Date:   Fri, 12 Dec 2008 20:25:52 +0100
       
       Fix center + second placement problem
       
       Diffstat:
         M clock.c                             |      13 ++++++++++++-
       
       1 file changed, 12 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/clock.c b/clock.c
       @@ -183,6 +183,7 @@ arrange_clock(int h1, int h2,
                      int m1, int m2,
                      int s1, int s2)
        {
       +
             print_number(h1, geo.x, geo.y);
             print_number(h2, geo.x, geo.y + 7);
        
       @@ -233,6 +234,7 @@ arrange_clock(int h1, int h2,
                    sdate.year,
                    meridiem);
             attroff(COLOR_PAIR(2));
       +
        }
        
        /* KEY CHECKING FUNCTION */
       @@ -356,6 +358,8 @@ set_center(void)
        {
             if(!option.center)
             {
       +          if(option.second && geo.width != 52)
       +               geo.width += DIFFSEC;
                  geo.y = MAXW / 2 - (geo.width / 2);
                  geo.x = MAXH / 2 - (geo.height / 2);
                  option.center = True;
       @@ -425,7 +429,14 @@ main(int argc, char **argv)
                       if(atoi(optarg) > 0)
                            geo.y = atoi(optarg) + 1;
                       break;
       -          case 's': option.second = True; break;
       +          case 's':
       +               option.second = True;
       +               if(option.center)
       +               {
       +                    option.center = !option.center;
       +                    set_center();
       +               }
       +               break;
                  case 't': option.twelve = True; break;
                  case 'b': option.keylock = False; break;
                  case 'c': start(); set_center(); break;