diff --git a/build.xml b/build.xml index fde9b4eba..008579941 100644 --- a/build.xml +++ b/build.xml @@ -1789,7 +1789,6 @@ javax.swing.event, javax.swing.border"/> prefix="net/java/sip/communicator/service/desktop"/> - diff --git a/lib/native/mac/libDock.jnilib b/lib/native/mac/libDock.jnilib deleted file mode 100755 index 8acf050b2..000000000 Binary files a/lib/native/mac/libDock.jnilib and /dev/null differ diff --git a/lib/os-specific/mac/installer-exclude/dock.jar b/lib/os-specific/mac/installer-exclude/dock.jar deleted file mode 100644 index 733c2b2f6..000000000 Binary files a/lib/os-specific/mac/installer-exclude/dock.jar and /dev/null differ diff --git a/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java index 60c1e4acc..94a837d14 100644 --- a/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java +++ b/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java @@ -6,15 +6,18 @@ */ package net.java.sip.communicator.impl.osdependent.jdic; +import com.apple.eawt.*; + +import java.awt.*; import java.awt.event.*; import java.net.*; import java.util.*; +import java.util.List; import javax.swing.*; import javax.swing.event.*; import net.java.sip.communicator.impl.osdependent.*; -import net.java.sip.communicator.impl.systray.mac.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; @@ -106,6 +109,8 @@ public class SystrayServiceJdicImpl private URL dockIconFFC; + private Image originalDockImage = null; + private boolean initialized = false; /** @@ -507,12 +512,24 @@ else if (imageType == SystrayService.ENVELOPE_IMG_TYPE) try { - if(OSUtils.IS_MAC32) + if(OSUtils.IS_MAC) { + if(originalDockImage == null) + originalDockImage = + Application.getApplication().getDockIconImage(); + if (toChangeDockIcon != null) - Dock.setDockTileImage(toChangeDockIcon); + { + Application.getApplication().setDockIconImage( + Toolkit.getDefaultToolkit() + .getImage(toChangeDockIcon)); + } else - Dock.restoreDockTileImage(); + { + if(originalDockImage != null) + Application.getApplication().setDockIconImage( + originalDockImage); + } } } catch (Exception e) @@ -624,7 +641,10 @@ public void popupMessageClicked(SystrayPopupMessageEvent evt) private class ServiceListenerImpl implements ServiceListener { - /** implements ServiceListener.serviceChanged */ + /** + * implements ServiceListener.serviceChanged + * @param serviceEvent + */ public void serviceChanged(ServiceEvent serviceEvent) { try diff --git a/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf b/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf index 9f554f5e9..11c0aa509 100644 --- a/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf +++ b/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf @@ -5,13 +5,14 @@ Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.systray, - net.java.sip.communicator.service.systray.event, + net.java.sip.communicator.service.systray.event, net.java.sip.communicator.service.desktop Import-Package: org.osgi.framework, org.jdesktop.jdic.desktop, org.jdesktop.jdic.tray, com.apple.cocoa.application, com.apple.cocoa.foundation, + com.apple.eawt, net.java.sip.communicator.service.configuration, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.gui.event, diff --git a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java index 6ad2ff6c4..8b0356b08 100644 --- a/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java +++ b/src/net/java/sip/communicator/plugin/chatalerter/ChatAlerterActivator.java @@ -52,13 +52,16 @@ public class ChatAlerterActivator /** * Starts this bundle. + * @param bc bundle context. + * @throws Exception */ public void start(BundleContext bc) throws Exception { try { // try to load native libs, if it fails don't do anything - Alerter.newInstance(); + if(!OSUtils.IS_MAC) + Alerter.newInstance(); } catch (Exception exception) { @@ -111,6 +114,11 @@ public void start(BundleContext bc) throws Exception } + /** + * Stops bundle. + * @param bc context. + * @throws Exception + */ public void stop(BundleContext bc) throws Exception { // start listening for newly register or removed protocol providers @@ -297,11 +305,15 @@ private void alertChatWindow() JFrame fr = (JFrame) winSource; - Alerter.newInstance().alert(fr); + if(OSUtils.IS_MAC) + com.apple.eawt.Application.getApplication() + .requestUserAttention(true); + else + Alerter.newInstance().alert(fr); } catch (Throwable ex) { - logger.error("Cannot alert chat window!"); + logger.error("Cannot alert chat window!", ex); } } diff --git a/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf b/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf index 3e1afa9b9..099175504 100644 --- a/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf +++ b/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf @@ -9,5 +9,5 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.gui, net.java.sip.communicator.service.protocol, net.java.sip.communicator.service.protocol.event, - com.apple.cocoa.application, + com.apple.eawt, javax.swing