Skip to content
Snippets Groups Projects
Commit 185d276a authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Restores black background in video calls (which got recently broken/removed).

parent 52ade675
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,6 @@
import java.awt.*;
import java.awt.event.*;
import org.jitsi.util.*;
/**
* Implements a <tt>Container</tt> for video/visual <tt>Component</tt>s.
* <tt>VideoContainer</tt> uses {@link VideoLayout} to layout the video/visual
......@@ -29,10 +27,10 @@ public class VideoContainer
private static final long serialVersionUID = 0L;
/**
* The default background color.
* The default background color of <tt>VideoContainer</tt> when it contains
* <tt>Component</tt> instances other than {@link #noVideoComponent}.
*/
public static final Color DEFAULT_BACKGROUND_COLOR
= OSUtils.IS_MAC ? Color.BLACK : null;
public static final Color DEFAULT_BACKGROUND_COLOR = Color.BLACK;
private int inAddOrRemove;
......@@ -64,6 +62,9 @@ public VideoContainer(Component noVideoComponent, boolean conference)
this.noVideoComponent = noVideoComponent;
if (DEFAULT_BACKGROUND_COLOR != null)
setBackground(DEFAULT_BACKGROUND_COLOR);
addContainerListener(
new ContainerListener()
{
......@@ -176,10 +177,29 @@ private void exitAddOrRemove()
private void onContainerEvent(ContainerEvent ev)
{
synchronized (syncRoot)
try
{
if (inAddOrRemove != 0)
validateAndRepaint = true;
if (DEFAULT_BACKGROUND_COLOR != null)
{
int componentCount = getComponentCount();
if ((componentCount == 1)
&& (getComponent(0)
== VideoContainer.this.noVideoComponent))
{
componentCount = 0;
}
setOpaque(componentCount > 0);
}
}
finally
{
synchronized (syncRoot)
{
if (inAddOrRemove != 0)
validateAndRepaint = true;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment