mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Spark 1755 roar redundant popups (#205)
* SPARK-1755: Remove listener when closing chat. When a one-on-one tab is closed, the corresponding listener (that waits for data to be displayed in that tab) should be deregistered. This fixes an issue with ROAR plugin popups increasing in volume. * SPARK-1783: Don't relay on opaque being possible.
This commit is contained in:
@ -224,6 +224,7 @@ public class ChatRoomImpl extends ChatRoom {
|
||||
// Remove info listener
|
||||
infoButton.removeActionListener(this);
|
||||
addToRosterButton.removeActionListener(this);
|
||||
SparkManager.getConnection().removeSyncStanzaListener(this);
|
||||
}
|
||||
|
||||
public void sendMessage() {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<name>Roar!!!</name>
|
||||
<class>org.jivesoftware.spark.roar.Roar</class>
|
||||
<author>Wolf Posdorfer</author>
|
||||
<version>0.4.1</version>
|
||||
<version>0.4.2</version>
|
||||
<homePage>http://www.jivesoftware.com</homePage>
|
||||
<description>Shows awesome Popups</description>
|
||||
<email>9posdorf@informatik.uni-hamburg.de</email>
|
||||
|
||||
@ -19,11 +19,7 @@
|
||||
*/
|
||||
package org.jivesoftware.spark.roar.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
@ -39,6 +35,7 @@ import javax.swing.JWindow;
|
||||
import org.jivesoftware.spark.roar.displaytype.RoarDisplayType;
|
||||
|
||||
import com.sun.awt.AWTUtilities;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
|
||||
public class RoarPanel {
|
||||
public static int WIDTH = 300;
|
||||
@ -65,8 +62,13 @@ public class RoarPanel {
|
||||
windowpanel.setBackground(backgroundcolor);
|
||||
|
||||
AWTUtilities.setWindowShape(window, new RoundRectangle2D.Float(0, 0, WIDTH, HEIGHT, 20, 20));
|
||||
AWTUtilities.setWindowOpaque(window, true);
|
||||
|
||||
try
|
||||
{
|
||||
AWTUtilities.setWindowOpaque( window, true );
|
||||
} catch ( UnsupportedOperationException ex ) {
|
||||
Log.debug( "Unable to make window opaque: " + ex );
|
||||
}
|
||||
JLabel text = new JLabel("<HTML>" + body + "</HTML>");
|
||||
text.setForeground(messageColor);
|
||||
|
||||
@ -96,9 +98,10 @@ public class RoarPanel {
|
||||
* @param window
|
||||
*/
|
||||
private static void fadein(JWindow window) {
|
||||
AWTUtilities.setWindowOpacity(window, 0.3f);
|
||||
AWTUtilities.setWindowOpacity(window, 0.5f);
|
||||
AWTUtilities.setWindowOpacity(window, 0.9f);
|
||||
final boolean supportsTranslucency = window.getGraphicsConfiguration().getDevice().isWindowTranslucencySupported( GraphicsDevice.WindowTranslucency.TRANSLUCENT );
|
||||
AWTUtilities.setWindowOpacity(window, supportsTranslucency ? 0.3f : 1.0f);
|
||||
AWTUtilities.setWindowOpacity(window, supportsTranslucency ? 0.5f : 1.0f);
|
||||
AWTUtilities.setWindowOpacity(window, supportsTranslucency ? 0.9f : 1.0f);
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user