Program: 96405
Project: 96405
Buggy source:
@Override public void createTray(String iconName){
  this.trayIcon=libgtk.gtk_status_icon_new();
  libgtk.gtk_status_icon_set_from_file(this.trayIcon,iconPath(iconName));
  libgtk.gtk_status_icon_set_tooltip(this.trayIcon,this.appName);
  libgtk.gtk_status_icon_set_visible(this.trayIcon,true);
  Gobject.GEventCallback gtkCallback=new Gobject.GEventCallback(){
    @Override public void callback(    Pointer instance,    final GdkEventButton event){
      if (event.type == 4) {
        SwingUtilities.invokeLater(new Runnable(){
          @Override public void run(){
            if (GtkSystemTray.this.jmenu.isVisible()) {
              GtkSystemTray.this.jmenu.setVisible(false);
            }
 else {
              int iconX=(int)(event.x_root - event.x);
              int iconY=(int)(event.y_root - event.y);
              Dimension size=GtkSystemTray.this.jmenu.getPreferredSize();
              iconX-=size.width / 2;
              if (iconY > 240) {
                iconY-=size.height;
              }
 else {
                iconY+=ICON_SIZE;
              }
              GtkSystemTray.this.jmenu.setInvoker(GtkSystemTray.this.jmenu);
              GtkSystemTray.this.jmenu.setLocation(iconX,iconY);
              GtkSystemTray.this.jmenu.setVisible(true);
            }
          }
        }
);
      }
    }
  }
;
  libgobject.g_signal_connect_data(this.trayIcon,"String_Node_Str",gtkCallback,null,null,0);
  if (!GtkSupport.usesSwtMainLoop) {
    Thread gtkUpdateThread=new Thread(){
      @Override public void run(){
        GtkSystemTray.this.blockUntilStarted.countDown();
        try {
          libgtk.gtk_main();
        }
 catch (        Throwable t) {
          logger.warn("String_Node_Str",t);
        }
      }
    }
;
    gtkUpdateThread.setName("String_Node_Str");
    gtkUpdateThread.setDaemon(true);
    gtkUpdateThread.start();
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        GtkSystemTray.this.jmenu=new SystemTrayMenuPopup();
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    logger.error("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    logger.error("String_Node_Str",e);
  }
  try {
    this.blockUntilStarted.await();
    this.active=true;
  }
 catch (  InterruptedException ignored) {
  }
}

Fixed version (ground truth):
@Override public void createTray(String iconName){
  libgtk.gdk_threads_enter();
  this.trayIcon=libgtk.gtk_status_icon_new();
  libgtk.gtk_status_icon_set_from_file(this.trayIcon,iconPath(iconName));
  libgtk.gtk_status_icon_set_tooltip(this.trayIcon,this.appName);
  libgtk.gtk_status_icon_set_visible(this.trayIcon,true);
  Gobject.GEventCallback gtkCallback=new Gobject.GEventCallback(){
    @Override public void callback(    Pointer instance,    final GdkEventButton event){
      if (event.type == 4) {
        SwingUtil.invokeLater(new Runnable(){
          @Override public void run(){
            if (GtkSystemTray.this.jmenu.isVisible()) {
              GtkSystemTray.this.jmenu.setVisible(false);
            }
 else {
              int iconX=(int)(event.x_root - event.x);
              int iconY=(int)(event.y_root - event.y);
              Dimension size=GtkSystemTray.this.jmenu.getPreferredSize();
              iconX-=size.width / 2;
              if (iconY > 240) {
                iconY-=size.height;
              }
 else {
                iconY+=ICON_SIZE;
              }
              GtkSystemTray.this.jmenu.setInvoker(GtkSystemTray.this.jmenu);
              GtkSystemTray.this.jmenu.setLocation(iconX,iconY);
              GtkSystemTray.this.jmenu.setVisible(true);
            }
          }
        }
);
      }
    }
  }
;
  libgobject.g_signal_connect_data(this.trayIcon,"String_Node_Str",gtkCallback,null,null,0);
  libgtk.gdk_threads_leave();
  SwingUtil.invokeAndWait(new Runnable(){
    @Override public void run(){
      GtkSystemTray.this.jmenu=new SystemTrayMenuPopup();
    }
  }
);
  if (!useSWT) {
    Thread gtkUpdateThread=new Thread(){
      @Override public void run(){
        GtkSystemTray.this.blockUntilStarted.countDown();
        libgtk.gtk_main();
      }
    }
;
    gtkUpdateThread.setName("String_Node_Str");
    gtkUpdateThread.start();
  }
  try {
    this.blockUntilStarted.await();
    this.active=true;
  }
 catch (  InterruptedException ignored) {
  }
}