crux-musl

Unnamed repository; edit this file 'description' to name the repository.
git clone https://codeberg.org/emmett1/crux-musl
Log | Files | Refs | README | LICENSE

tint2-glib.patch (1531B)


      1 diff --git a/src/main.c b/src/main.c
      2 index a0b90ae..d9c6742 100644
      3 --- a/src/main.c
      4 +++ b/src/main.c
      5 @@ -534,11 +534,14 @@ void handle_x_event(XEvent *e)
      6          }
      7          if (e->xany.window == g_tooltip.window || !systray_enabled)
      8              break;
      9 -        for (GSList *it = systray.list_icons; it; it = it->next)
     10 +        /* we might remove elements in the callback so a copy is needed */
     11 +        GSList *list = g_list_copy(systray.list_icons);
     12 +        for (GSList *it = list; it; it = it->next)
     13          {
     14 -            if (((TrayWindow *)it->data)->win == e->xany.window)
     15 +            if (it->data != NULL && ((TrayWindow *)it->data)->win == e->xany.window)
     16                  systray_destroy_event(it->data);
     17          }
     18 +        g_list_free(list);
     19          break;
     20  
     21      case ClientMessage: {
     22 diff --git a/src/util/uevent.c b/src/util/uevent.c
     23 index b0acefa..5c48b52 100644
     24 --- a/src/util/uevent.c
     25 +++ b/src/util/uevent.c
     26 @@ -146,7 +146,9 @@ void uevent_handler( fd_set *fds, int *fdn)
     27      struct uevent ev;
     28  
     29      if (uevent_new(&ev, buf, len)) {
     30 -        for (GSList *l = notifiers; l; l = l->next)
     31 +        /* we might remove elements in the callback so a copy is needed */
     32 +        GSList *list = g_list_copy(notifiers);
     33 +        for (GSList *l = list; l; l = l->next)
     34          {
     35              struct uevent_notify *nb = l->data;
     36  
     37 @@ -157,6 +159,7 @@ void uevent_handler( fd_set *fds, int *fdn)
     38  
     39              nb->cb(&ev, nb->userdata);
     40          }
     41 +        g_list_free(list);
     42          uevent_destroy (&ev);
     43      }
     44  }