[BACK]Return to popup.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/popup.c between version 1.35 and 1.36

version 1.35, 2021/10/11 10:55:30 version 1.36, 2021/10/11 13:27:50
Line 157 
Line 157 
         return (&pd->s);          return (&pd->s);
 }  }
   
 static int  /* Return parts of the input range which are not obstructed by the popup. */
 popup_check_cb(struct client *c, void *data, u_int px, u_int py)  static void
   popup_check_cb(struct client* c, void *data, u_int px, u_int py, u_int nx,
       struct overlay_ranges *r)
 {  {
         struct popup_data       *pd = data;          struct popup_data       *pd = data;
           struct overlay_ranges    or[2];
           u_int                    i, j, k = 0;
   
         if (pd->md != NULL && menu_check_cb(c, pd->md, px, py) == 0)          if (pd->md != NULL) {
                 return (0);                  /* Check each returned range for the menu against the popup. */
         if (px < pd->px || px > pd->px + pd->sx - 1)                  menu_check_cb(c, pd->md, px, py, nx, r);
                 return (1);                  for (i = 0; i < 2; i++) {
         if (py < pd->py || py > pd->py + pd->sy - 1)                          server_client_overlay_range(pd->px, pd->py, pd->sx,
                 return (1);                              pd->sy, r->px[i], py, r->nx[i], &or[i]);
         return (0);                  }
   
                   /*
                    * or has up to OVERLAY_MAX_RANGES non-overlapping ranges,
                    * ordered from left to right. Collect them in the output.
                    */
                   for (i = 0; i < 2; i++) {
                           /* Each or[i] only has 2 ranges. */
                           for (j = 0; j < 2; j++) {
                                   if (or[i].nx[j] > 0) {
                                           r->px[k] = or[i].px[j];
                                           r->nx[k] = or[i].nx[j];
                                           k++;
                                   }
                           }
                   }
   
                   /* Zero remaining ranges if any. */
                   for (i = k; i < OVERLAY_MAX_RANGES; i++) {
                           r->px[i] = 0;
                           r->nx[i] = 0;
                   }
   
                   return;
           }
   
           server_client_overlay_range(pd->px, pd->py, pd->sx, pd->sy, px, py, nx,
               r);
 }  }
   
 static void  static void

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36