From 32a982afdcb7d5901806368ad5127c6a61122e63 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Wed, 4 Feb 2009 09:44:38 +0000 Subject: [PATCH] As requested by Emil in an e-mail on the dev mailing list, tries to exit the full-screen window when the call with a participant being displayed in a full-screen window ends. --- .../gui/main/call/CallParticipantPanel.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java index 02aebc35f..70a3b81cb 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallParticipantPanel.java @@ -65,9 +65,18 @@ public class CallParticipantPanel private Component localVideo; + /** + * The current Window being displayed in full-screen. Because + * the AWT API with respect to the full-screen support doesn't seem + * sophisticated enough, the field is used sparingly i.e. when there are no + * other means (such as a local variable) of acquiring the instance. + */ + private Window fullScreenWindow; + private SecureButton secureButton; private ParticipantStatusPanel statusPanel; private ZrtpPanel zrtpPanel = null; + /** * Creates a CallParticipantPanel for the given call participant. * @@ -506,6 +515,8 @@ private void removeVideoListener() if (telephony.equals(videoTelephony)) videoTelephony = null; } + + exitFullScreen(fullScreenWindow); } }; call.addCallChangeListener(callListener); @@ -848,20 +859,23 @@ public void windowStateChanged(WindowEvent event) frame.addWindowStateListener(listener); getGraphicsConfiguration().getDevice().setFullScreenWindow(frame); + this.fullScreenWindow = frame; } private void exitFullScreen(Window fullScreenWindow) { - GraphicsConfiguration gConfig = getGraphicsConfiguration(); - - if(gConfig != null) - gConfig.getDevice().setFullScreenWindow(null); + GraphicsConfiguration graphicsConfig = getGraphicsConfiguration(); + if (graphicsConfig != null) + graphicsConfig.getDevice().setFullScreenWindow(null); if (fullScreenWindow != null) { if (fullScreenWindow.isVisible()) fullScreenWindow.setVisible(false); fullScreenWindow.dispose(); + + if (this.fullScreenWindow == fullScreenWindow) + this.fullScreenWindow = null; } }