diff options
Diffstat (limited to 'platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java')
-rw-r--r-- | platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java b/platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java index aac2e77982ba..e8c6f49f8088 100644 --- a/platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java +++ b/platform/platform-impl/src/com/intellij/ui/LibNotifyWrapper.java @@ -49,6 +49,7 @@ class LibNotifyWrapper implements SystemNotificationsImpl.Notifier { } private final LibNotify myLibNotify; + private final String myIcon; private LibNotifyWrapper() { myLibNotify = (LibNotify)Native.loadLibrary("libnotify.so.4", LibNotify.class); @@ -58,6 +59,9 @@ class LibNotifyWrapper implements SystemNotificationsImpl.Notifier { throw new IllegalStateException("notify_init failed"); } + String icon = AppUIUtil.findIcon(PathManager.getBinPath()); + myIcon = icon != null ? icon : "dialog-information"; + MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect(); connection.subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() { @Override @@ -69,9 +73,7 @@ class LibNotifyWrapper implements SystemNotificationsImpl.Notifier { @Override public void notify(@NotNull Set<String> allNames, @NotNull String name, @NotNull String title, @NotNull String description) { - String icon = AppUIUtil.findIcon(PathManager.getBinPath()); - if (icon == null) icon = "dialog-information"; - Pointer notification = myLibNotify.notify_notification_new(title, description, icon); + Pointer notification = myLibNotify.notify_notification_new(title, description, myIcon); myLibNotify.notify_notification_show(notification, null); } } |