Notify of pokes and private messages on the desktop
While none of the client's windows has the focus, a poke or a private message shows a desktop notification, which the desktop's notification centre keeps. A private conversation keeps one notification, updated as messages come; clicking it brings the window forward with that chat open, and they all go once a window of the client is in front again. On Linux they go to the freedesktop.org notification service, spoken to over the session bus by a small D-Bus client of our own on Java's Unix sockets, so no library or native code is involved; Plasma also takes a reply typed into the notification. Elsewhere they are AWT tray messages, which Windows and macOS put in their notification centres. The options can turn them off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,11 @@ final class TrayController {
|
||||
if (tray != null) tray.dispose();
|
||||
}
|
||||
|
||||
/** The backend that took the icon, or {@code null} when none could. */
|
||||
TrayBackend backend() {
|
||||
return tray;
|
||||
}
|
||||
|
||||
/** The icon a state is drawn with, from the active icon pack. */
|
||||
private static ImageIcon icon(SelfState state, int size) {
|
||||
return switch (state) {
|
||||
@@ -230,7 +235,7 @@ final class TrayController {
|
||||
* not focused, which is every time the tray icon is used, so the backend is asked
|
||||
* first — it can make the request the window manager does honour.
|
||||
*/
|
||||
private void show() {
|
||||
void show() {
|
||||
hideMenu();
|
||||
frame.setVisible(true);
|
||||
frame.setExtendedState(frame.getExtendedState() & ~Frame.ICONIFIED);
|
||||
|
||||
Reference in New Issue
Block a user