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 @@ ...@@ -9,8 +9,6 @@
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import org.jitsi.util.*;
/** /**
* Implements a <tt>Container</tt> for video/visual <tt>Component</tt>s. * Implements a <tt>Container</tt> for video/visual <tt>Component</tt>s.
* <tt>VideoContainer</tt> uses {@link VideoLayout} to layout the video/visual * <tt>VideoContainer</tt> uses {@link VideoLayout} to layout the video/visual
...@@ -29,10 +27,10 @@ public class VideoContainer ...@@ -29,10 +27,10 @@ public class VideoContainer
private static final long serialVersionUID = 0L; 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 public static final Color DEFAULT_BACKGROUND_COLOR = Color.BLACK;
= OSUtils.IS_MAC ? Color.BLACK : null;
private int inAddOrRemove; private int inAddOrRemove;
...@@ -64,6 +62,9 @@ public VideoContainer(Component noVideoComponent, boolean conference) ...@@ -64,6 +62,9 @@ public VideoContainer(Component noVideoComponent, boolean conference)
this.noVideoComponent = noVideoComponent; this.noVideoComponent = noVideoComponent;
if (DEFAULT_BACKGROUND_COLOR != null)
setBackground(DEFAULT_BACKGROUND_COLOR);
addContainerListener( addContainerListener(
new ContainerListener() new ContainerListener()
{ {
...@@ -176,10 +177,29 @@ private void exitAddOrRemove() ...@@ -176,10 +177,29 @@ private void exitAddOrRemove()
private void onContainerEvent(ContainerEvent ev) private void onContainerEvent(ContainerEvent ev)
{ {
synchronized (syncRoot) try
{ {
if (inAddOrRemove != 0) if (DEFAULT_BACKGROUND_COLOR != null)
validateAndRepaint = true; {
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.
Please register or to comment