Use the OperationSetDesktopSharingServer from the beginning of the call instead of first using the streaming operation set and once remote control is enabled moving to the sharing operation set, thus fixing NullPointerException in mouse coordinates parsing during a sharing.

cusax-fix
Yana Stamcheva 16 years ago
parent 032d17ea10
commit 00adffb4ea

@ -533,7 +533,7 @@ public void enableButtons()
}
if (protocolProvider.getOperationSet(
OperationSetDesktopStreaming.class) != null)
OperationSetDesktopSharingServer.class) != null)
{
desktopSharingButton.setEnabled(true);
}

@ -12,8 +12,6 @@
import javax.swing.Timer;
import org.osgi.framework.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.utils.*;
@ -23,6 +21,8 @@
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
/**
* The <tt>CallManager</tt> is the one that handles calls. It contains also
* the "Call" and "Hang up" buttons panel. Here are handles incoming and
@ -953,9 +953,9 @@ public CreateDesktopSharingThread(
public void run()
{
OperationSetDesktopStreaming desktopSharingOpSet
OperationSetDesktopSharingServer desktopSharingOpSet
= protocolProvider
.getOperationSet(OperationSetDesktopStreaming.class);
.getOperationSet(OperationSetDesktopSharingServer.class);
/*
* XXX If we are here and we just discover that

@ -62,9 +62,9 @@ public void buttonPressed()
{
if (call != null)
{
OperationSetDesktopStreaming desktopOpSet
OperationSetDesktopSharingServer desktopOpSet
= call.getProtocolProvider().getOperationSet(
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
// This shouldn't happen at this stage, because we disable the button
// if the operation set isn't available.

@ -1159,8 +1159,9 @@ public void printDTMFTone(char dtmfChar)
* <tt>MouseWheelListener</tt> and <tt>MouseMotionListener</tt> to remote
* video component.
*/
private void addMouseAndKeyListeners()
public void addMouseAndKeyListeners()
{
System.out.println("ADD MOUSE AND KEY LISTENERSSSSSSSSSSS===" + remoteVideo);
if(remoteVideo != null)
{
remoteVideo.addKeyListener(mouseAndKeyListener);
@ -1175,8 +1176,9 @@ private void addMouseAndKeyListeners()
* <tt>MouseWheelListener</tt> and <tt>MouseMotionListener</tt> to remote
* video component.
*/
private void removeMouseAndKeyListeners()
public void removeMouseAndKeyListeners()
{
System.out.println("REMOVE MOUSE AND KEY LISTENERSSSSSSSSSSS=======" + remoteVideo);
if(remoteVideo != null)
{
remoteVideo.removeKeyListener(mouseAndKeyListener);
@ -1268,6 +1270,7 @@ public MouseAndKeyListener(OperationSetDesktopSharingClient opSet)
*/
public void mouseMoved(MouseEvent event)
{
System.out.println("MOUSE MOVED!!!!!!!!!!!!!!!!!!!!");
if(System.currentTimeMillis() > lastMouseMovedTime + 50)
{
desktopSharingClient.sendMouseEvent(callPeer, event,

@ -647,7 +647,7 @@ private void initButtonsPanel(UIContact uiContact)
UIContactDetail desktopContact
= uiContact.getDefaultContactDetail(
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
if (desktopContact != null)
{
@ -954,7 +954,7 @@ private void shareDesktop(TreeNode treeNode)
List<UIContactDetail> desktopContacts
= ((ContactNode) treeNode).getContactDescriptor()
.getContactDetailsForOperationSet(
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
ChooseCallAccountPopupMenu chooseAccountDialog = null;
@ -964,7 +964,7 @@ private void shareDesktop(TreeNode treeNode)
ProtocolProviderService preferredProvider
= detail.getPreferredProtocolProvider(
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
List<ProtocolProviderService> providers = null;
String protocolName = null;
@ -981,7 +981,7 @@ private void shareDesktop(TreeNode treeNode)
{
protocolName = preferredProvider.getProtocolName();
providers = CallManager.getRegisteredProviders(protocolName,
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
}
}
// If we don't have a preferred provider we try to obtain a
@ -989,10 +989,10 @@ private void shareDesktop(TreeNode treeNode)
else
{
protocolName = detail.getPreferredProtocol(
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
providers
= CallManager.getRegisteredProviders(protocolName,
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
}
// If our call didn't succeed, try to call through one of the other
@ -1018,14 +1018,14 @@ else if (providersCount == 1)
else if (providersCount > 1)
chooseAccountDialog = new ChooseCallAccountPopupMenu(
tree, detail.getAddress(), providers,
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
}
}
else if (desktopContacts.size() > 1)
{
chooseAccountDialog
= new ChooseCallAccountPopupMenu(tree, desktopContacts,
OperationSetDesktopStreaming.class);
OperationSetDesktopSharingServer.class);
}
// If the choose dialog is created we're going to show it.

@ -359,7 +359,7 @@ private void init()
}
if (protocolProvider.getOperationSet(
OperationSetDesktopStreaming.class) != null)
OperationSetDesktopSharingServer.class) != null)
{
desktopSharingMenu.add(
createMenuItem( contactDisplayName,
@ -459,7 +459,7 @@ private void init()
this.videoCallItem.setEnabled(false);
if (metaContact.getDefaultContact(
OperationSetDesktopStreaming.class) == null)
OperationSetDesktopSharingServer.class) == null)
this.desktopSharingItem.setEnabled(false);
if (metaContact.getDefaultContact(

Loading…
Cancel
Save