-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
11.0.22
-
x86_64
-
linux
A DESCRIPTION OF THE PROBLEM :
For double-clicks or other repeated clicks on TrayIcons, MouseEvent.getClickCount() incorrectly returns 1.
I found this problem only in some environments:
- Bugged: KDE Plasma; LXQT
- Working: LXDE; XFCE; Microsoft Windows
---------- BEGIN SOURCE ----------
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
class TrayClickCount {
public static void main(String[] args) throws Throwable {
BufferedImage black = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
TrayIcon ti = new TrayIcon(black);
ti.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("Button " + e.getButton() + "; Click count: " + e.getClickCount());
}
});
SystemTray.getSystemTray().add(ti);
}
}
---------- END SOURCE ----------
FREQUENCY : always
For double-clicks or other repeated clicks on TrayIcons, MouseEvent.getClickCount() incorrectly returns 1.
I found this problem only in some environments:
- Bugged: KDE Plasma; LXQT
- Working: LXDE; XFCE; Microsoft Windows
---------- BEGIN SOURCE ----------
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
class TrayClickCount {
public static void main(String[] args) throws Throwable {
BufferedImage black = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
TrayIcon ti = new TrayIcon(black);
ti.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("Button " + e.getButton() + "; Click count: " + e.getClickCount());
}
});
SystemTray.getSystemTray().add(ti);
}
}
---------- END SOURCE ----------
FREQUENCY : always