[jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps and changes size if it is already visible


#1

Hey Tom,

Could you please tell us a few words about this?

Emil

···

On 14.02.13, 12:44, tomdenham@java.net wrote:

Project: jitsi
Repository: svn
Revision: 10449
Author: tomdenham
Date: 2013-02-14 11:44:30 UTC
Link:

Log Message:
------------
Fix bug where main window jumps and changes size if it is already visible when a call is missed.

Revisions:
----------
10449

Modified Paths:
---------------
trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

Diffs:
------
Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

--- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10448)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10449)
@@ -1687,38 +1687,42 @@
      */
     public void setFrameVisible(final boolean isVisible)
     {
- ConfigurationUtils.setApplicationVisible(isVisible);
+ if (this.isVisible() != isVisible)
+ {
+ ConfigurationUtils.setApplicationVisible(isVisible);

- SwingUtilities.invokeLater(new Runnable(){
- public void run()
- {
- if(isVisible)
+ SwingUtilities.invokeLater(new Runnable(){
+ public void run()
                 {
- MainFrame.this.addNativePlugins();
+ if(isVisible)
+ {
+ MainFrame.this.addNativePlugins();

- Window focusedWindow = keyManager.getFocusedWindow();
+ Window focusedWindow = keyManager.getFocusedWindow();

- // If there's another currently focused window we prevent
- // this frame from steeling the focus. This happens for
- // example in the case of a Master Password window which is
- // opened before the contact list window.
- if (focusedWindow != null)
- setFocusableWindowState(false);
+ // If there's another currently focused window we
+ // prevent this frame from steeling the focus. This
+ // happens for example in the case of a Master Password
+ // window which is opened before the contact list
+ // window.
+ if (focusedWindow != null)
+ setFocusableWindowState(false);

- MainFrame.super.setVisible(isVisible);
+ MainFrame.super.setVisible(isVisible);

- if (focusedWindow != null)
- setFocusableWindowState(true);
+ if (focusedWindow != null)
+ setFocusableWindowState(true);

- MainFrame.super.setExtendedState(MainFrame.NORMAL);
- MainFrame.super.toFront();
+ MainFrame.super.setExtendedState(MainFrame.NORMAL);
+ MainFrame.super.toFront();
+ }
+ else
+ {
+ MainFrame.super.setVisible(isVisible);
+ }
                 }
- else
- {
- MainFrame.super.setVisible(isVisible);
- }
- }
- });
+ });
+ }
     }

     /**

--
https://jitsi.org


#2

Tom?

···

On 14.02.13, 13:17, Emil Ivov wrote:

Hey Tom,

Could you please tell us a few words about this?

Emil

On 14.02.13, 12:44, tomdenham@java.net wrote:

Project: jitsi
Repository: svn
Revision: 10449
Author: tomdenham
Date: 2013-02-14 11:44:30 UTC
Link:

Log Message:
------------
Fix bug where main window jumps and changes size if it is already visible when a call is missed.

Revisions:
----------
10449

Modified Paths:
---------------
trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

Diffs:
------
Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

--- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10448)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10449)
@@ -1687,38 +1687,42 @@
      */
     public void setFrameVisible(final boolean isVisible)
     {
- ConfigurationUtils.setApplicationVisible(isVisible);
+ if (this.isVisible() != isVisible)
+ {
+ ConfigurationUtils.setApplicationVisible(isVisible);

- SwingUtilities.invokeLater(new Runnable(){
- public void run()
- {
- if(isVisible)
+ SwingUtilities.invokeLater(new Runnable(){
+ public void run()
                 {
- MainFrame.this.addNativePlugins();
+ if(isVisible)
+ {
+ MainFrame.this.addNativePlugins();

- Window focusedWindow = keyManager.getFocusedWindow();
+ Window focusedWindow = keyManager.getFocusedWindow();

- // If there's another currently focused window we prevent
- // this frame from steeling the focus. This happens for
- // example in the case of a Master Password window which is
- // opened before the contact list window.
- if (focusedWindow != null)
- setFocusableWindowState(false);
+ // If there's another currently focused window we
+ // prevent this frame from steeling the focus. This
+ // happens for example in the case of a Master Password
+ // window which is opened before the contact list
+ // window.
+ if (focusedWindow != null)
+ setFocusableWindowState(false);

- MainFrame.super.setVisible(isVisible);
+ MainFrame.super.setVisible(isVisible);

- if (focusedWindow != null)
- setFocusableWindowState(true);
+ if (focusedWindow != null)
+ setFocusableWindowState(true);

- MainFrame.super.setExtendedState(MainFrame.NORMAL);
- MainFrame.super.toFront();
+ MainFrame.super.setExtendedState(MainFrame.NORMAL);
+ MainFrame.super.toFront();
+ }
+ else
+ {
+ MainFrame.super.setVisible(isVisible);
+ }
                 }
- else
- {
- MainFrame.super.setVisible(isVisible);
- }
- }
- });
+ });
+ }
     }

     /**

--
https://jitsi.org


#3

Yes, sorry for the delay in getting back to you.

This change was a bug fix for a previous fix which I'd not yet submitted as a patch, d'oh.

The patch is now attached.

It fixes a problem where users might accidently answer the wrong call when they have two calls coming in at the same time.
It fixes this by ensuring that the incoming call windows don't appear on top of each other. If there's a window already displayed then it shows the next window underneath it.

Thanks
Tom

PreCallDialog.java.patch (2.79 KB)

···

-----Original Message-----
From: Emil Ivov [mailto:emcho@jitsi.org]
Sent: 20 February 2013 11:36
To: dev@jitsi.java.net
Subject: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps and changes size if it is already visible

Tom?

On 14.02.13, 13:17, Emil Ivov wrote:

Hey Tom,

Could you please tell us a few words about this?

Emil

On 14.02.13, 12:44, tomdenham@java.net wrote:

Project: jitsi
Repository: svn
Revision: 10449
Author: tomdenham
Date: 2013-02-14 11:44:30 UTC
Link:

Log Message:
------------
Fix bug where main window jumps and changes size if it is already visible when a call is missed.

Revisions:
----------
10449

Modified Paths:
---------------
trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

Diffs:
------
Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

--- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10448)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10449)
@@ -1687,38 +1687,42 @@
      */
     public void setFrameVisible(final boolean isVisible)
     {
- ConfigurationUtils.setApplicationVisible(isVisible);
+ if (this.isVisible() != isVisible)
+ {
+ ConfigurationUtils.setApplicationVisible(isVisible);

- SwingUtilities.invokeLater(new Runnable(){
- public void run()
- {
- if(isVisible)
+ SwingUtilities.invokeLater(new Runnable(){
+ public void run()
                 {
- MainFrame.this.addNativePlugins();
+ if(isVisible)
+ {
+ MainFrame.this.addNativePlugins();

- Window focusedWindow = keyManager.getFocusedWindow();
+ Window focusedWindow = keyManager.getFocusedWindow();

- // If there's another currently focused window we prevent
- // this frame from steeling the focus. This happens for
- // example in the case of a Master Password window which is
- // opened before the contact list window.
- if (focusedWindow != null)
- setFocusableWindowState(false);
+ // If there's another currently focused window we
+ // prevent this frame from steeling the focus. This
+ // happens for example in the case of a Master Password
+ // window which is opened before the contact list
+ // window.
+ if (focusedWindow != null)
+ setFocusableWindowState(false);

- MainFrame.super.setVisible(isVisible);
+ MainFrame.super.setVisible(isVisible);

- if (focusedWindow != null)
- setFocusableWindowState(true);
+ if (focusedWindow != null)
+ setFocusableWindowState(true);

- MainFrame.super.setExtendedState(MainFrame.NORMAL);
- MainFrame.super.toFront();
+ MainFrame.super.setExtendedState(MainFrame.NORMAL);
+ MainFrame.super.toFront();
+ }
+ else
+ {
+ MainFrame.super.setVisible(isVisible);
+ }
                 }
- else
- {
- MainFrame.super.setVisible(isVisible);
- }
- }
- });
+ });
+ }
     }

     /**

--
https://jitsi.org


#4

My turn to apologise for the delay.

So I am afraid I don't follow. I don't see how this commit is related to
the pre-call dialog. It just seems to modify how the contact list is
displayed (it also seems to be part of the reason why launching a second
Jitsi instance does not currently bring the first one to front).

Emil

--sent from my mobile

···

On Feb 20, 2013 2:08 PM, "Tom Denham" <Tom.Denham@metaswitch.com> wrote:

Yes, sorry for the delay in getting back to you.

This change was a bug fix for a previous fix which I'd not yet submitted
as a patch, d'oh.

The patch is now attached.

It fixes a problem where users might accidently answer the wrong call when
they have two calls coming in at the same time.
It fixes this by ensuring that the incoming call windows don't appear on
top of each other. If there's a window already displayed then it shows the
next window underneath it.

Thanks
Tom

-----Original Message-----
From: Emil Ivov [mailto:emcho@jitsi.org]
Sent: 20 February 2013 11:36
To: dev@jitsi.java.net
Subject: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps
and changes size if it is already visible

Tom?

On 14.02.13, 13:17, Emil Ivov wrote:
> Hey Tom,
>
> Could you please tell us a few words about this?
>
> Emil
>
> On 14.02.13, 12:44, tomdenham@java.net wrote:
>> Project: jitsi
>> Repository: svn
>> Revision: 10449
>> Author: tomdenham
>> Date: 2013-02-14 11:44:30 UTC
>> Link:
>>
>> Log Message:
>> ------------
>> Fix bug where main window jumps and changes size if it is already
visible when a call is missed.
>>
>>
>> Revisions:
>> ----------
>> 10449
>>
>>
>> Modified Paths:
>> ---------------
>> trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
>>
>>
>> Diffs:
>> ------
>> Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
>> ===================================================================
>> --- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
(revision 10448)
>> +++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
(revision 10449)
>> @@ -1687,38 +1687,42 @@
>> */
>> public void setFrameVisible(final boolean isVisible)
>> {
>> - ConfigurationUtils.setApplicationVisible(isVisible);
>> + if (this.isVisible() != isVisible)
>> + {
>> + ConfigurationUtils.setApplicationVisible(isVisible);
>>
>> - SwingUtilities.invokeLater(new Runnable(){
>> - public void run()
>> - {
>> - if(isVisible)
>> + SwingUtilities.invokeLater(new Runnable(){
>> + public void run()
>> {
>> - MainFrame.this.addNativePlugins();
>> + if(isVisible)
>> + {
>> + MainFrame.this.addNativePlugins();
>>
>> - Window focusedWindow =
keyManager.getFocusedWindow();
>> + Window focusedWindow =
keyManager.getFocusedWindow();
>>
>> - // If there's another currently focused window we
prevent
>> - // this frame from steeling the focus. This
happens for
>> - // example in the case of a Master Password window
which is
>> - // opened before the contact list window.
>> - if (focusedWindow != null)
>> - setFocusableWindowState(false);
>> + // If there's another currently focused window
we
>> + // prevent this frame from steeling the focus.
This
>> + // happens for example in the case of a Master
Password
>> + // window which is opened before the contact
list
>> + // window.
>> + if (focusedWindow != null)
>> + setFocusableWindowState(false);
>>
>> - MainFrame.super.setVisible(isVisible);
>> + MainFrame.super.setVisible(isVisible);
>>
>> - if (focusedWindow != null)
>> - setFocusableWindowState(true);
>> + if (focusedWindow != null)
>> + setFocusableWindowState(true);
>>
>> - MainFrame.super.setExtendedState(MainFrame.NORMAL);
>> - MainFrame.super.toFront();
>> +
MainFrame.super.setExtendedState(MainFrame.NORMAL);
>> + MainFrame.super.toFront();
>> + }
>> + else
>> + {
>> + MainFrame.super.setVisible(isVisible);
>> + }
>> }
>> - else
>> - {
>> - MainFrame.super.setVisible(isVisible);
>> - }
>> - }
>> - });
>> + });
>> + }
>> }
>>
>> /**
>>
>>
>>
>>
>

--
https://jitsi.org


#5

My bad, I completely misremembered what the original fix was for. Yes, you're right, it's unrelated to the other patch I've submitted.

If you think it's causing problems, I'll back it out straight away and we can revisit it once 2.0 has shipped.

Tom

···

From: Emil Ivov [mailto:emcho@jitsi.org]

Sent: 26 February 2013 11:43
To: dev@jitsi.java.net; t@sip-communicator.org
Subject: Re: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps and changes size if it is already visible

My turn to apologise for the delay.

So I am afraid I don't follow. I don't see how this commit is related to the pre-call dialog. It just seems to modify how the contact list is displayed (it also seems to be part of the reason why launching a second Jitsi instance does not currently bring the first one to front).

Emil

--sent from my mobile
On Feb 20, 2013 2:08 PM, "Tom Denham" <Tom.Denham@metaswitch.com<mailto:Tom.Denham@metaswitch.com>> wrote:
Yes, sorry for the delay in getting back to you.

This change was a bug fix for a previous fix which I'd not yet submitted as a patch, d'oh.

The patch is now attached.

It fixes a problem where users might accidently answer the wrong call when they have two calls coming in at the same time.
It fixes this by ensuring that the incoming call windows don't appear on top of each other. If there's a window already displayed then it shows the next window underneath it.

Thanks
Tom

-----Original Message-----

From: Emil Ivov [mailto:emcho@jitsi.org<mailto:emcho@jitsi.org>]

Sent: 20 February 2013 11:36
To: dev@jitsi.java.net<mailto:dev@jitsi.java.net>
Subject: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps and changes size if it is already visible

Tom?

On 14.02.13, 13:17, Emil Ivov wrote:

Hey Tom,

Could you please tell us a few words about this?

Emil

On 14.02.13, 12:44, tomdenham@java.net<mailto:tomdenham@java.net> wrote:

Project: jitsi
Repository: svn
Revision: 10449
Author: tomdenham
Date: 2013-02-14 11:44:30 UTC
Link:

Log Message:
------------
Fix bug where main window jumps and changes size if it is already visible when a call is missed.

Revisions:
----------
10449

Modified Paths:
---------------
trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

Diffs:
------
Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java

--- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10448)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java (revision 10449)
@@ -1687,38 +1687,42 @@
      */
     public void setFrameVisible(final boolean isVisible)
     {
- ConfigurationUtils.setApplicationVisible(isVisible);
+ if (this.isVisible() != isVisible)
+ {
+ ConfigurationUtils.setApplicationVisible(isVisible);

- SwingUtilities.invokeLater(new Runnable(){
- public void run()
- {
- if(isVisible)
+ SwingUtilities.invokeLater(new Runnable(){
+ public void run()
                 {
- MainFrame.this.addNativePlugins();
+ if(isVisible)
+ {
+ MainFrame.this.addNativePlugins();

- Window focusedWindow = keyManager.getFocusedWindow();
+ Window focusedWindow = keyManager.getFocusedWindow();

- // If there's another currently focused window we prevent
- // this frame from steeling the focus. This happens for
- // example in the case of a Master Password window which is
- // opened before the contact list window.
- if (focusedWindow != null)
- setFocusableWindowState(false);
+ // If there's another currently focused window we
+ // prevent this frame from steeling the focus. This
+ // happens for example in the case of a Master Password
+ // window which is opened before the contact list
+ // window.
+ if (focusedWindow != null)
+ setFocusableWindowState(false);

- MainFrame.super.setVisible(isVisible);
+ MainFrame.super.setVisible(isVisible);

- if (focusedWindow != null)
- setFocusableWindowState(true);
+ if (focusedWindow != null)
+ setFocusableWindowState(true);

- MainFrame.super.setExtendedState(MainFrame.NORMAL);
- MainFrame.super.toFront();
+ MainFrame.super.setExtendedState(MainFrame.NORMAL);
+ MainFrame.super.toFront();
+ }
+ else
+ {
+ MainFrame.super.setVisible(isVisible);
+ }
                 }
- else
- {
- MainFrame.super.setVisible(isVisible);
- }
- }
- });
+ });
+ }
     }

     /**

--
https://jitsi.org


#6

OK, let's do that.

Thanks,
Emil

--sent from my mobile

···

On Feb 26, 2013 1:54 PM, "Tom Denham" <Tom.Denham@metaswitch.com> wrote:

My bad, I completely misremembered what the original fix was for. Yes,
you’re right, it’s unrelated to the other patch I’ve submitted.****

** **

If you think it’s causing problems, I’ll back it out straight away and we
can revisit it once 2.0 has shipped.****

** **

Tom****

** **

*From:* Emil Ivov [mailto:emcho@jitsi.org]
*Sent:* 26 February 2013 11:43
*To:* dev@jitsi.java.net; t@sip-communicator.org
*Subject:* Re: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main
window jumps and changes size if it is already visible****

** **

My turn to apologise for the delay.****

So I am afraid I don't follow. I don't see how this commit is related to
the pre-call dialog. It just seems to modify how the contact list is
displayed (it also seems to be part of the reason why launching a second
Jitsi instance does not currently bring the first one to front).****

Emil****

--sent from my mobile****

On Feb 20, 2013 2:08 PM, "Tom Denham" <Tom.Denham@metaswitch.com> wrote:**
**

Yes, sorry for the delay in getting back to you.

This change was a bug fix for a previous fix which I'd not yet submitted
as a patch, d'oh.

The patch is now attached.

It fixes a problem where users might accidently answer the wrong call when
they have two calls coming in at the same time.
It fixes this by ensuring that the incoming call windows don't appear on
top of each other. If there's a window already displayed then it shows the
next window underneath it.

Thanks
Tom

-----Original Message-----
From: Emil Ivov [mailto:emcho@jitsi.org]
Sent: 20 February 2013 11:36
To: dev@jitsi.java.net
Subject: [jitsi-dev] Re: [jitsi~svn:10449] Fix bug where main window jumps
and changes size if it is already visible

Tom?

On 14.02.13, 13:17, Emil Ivov wrote:
> Hey Tom,
>
> Could you please tell us a few words about this?
>
> Emil
>
> On 14.02.13, 12:44, tomdenham@java.net wrote:
>> Project: jitsi
>> Repository: svn
>> Revision: 10449
>> Author: tomdenham
>> Date: 2013-02-14 11:44:30 UTC
>> Link:
>>
>> Log Message:
>> ------------
>> Fix bug where main window jumps and changes size if it is already
visible when a call is missed.
>>
>>
>> Revisions:
>> ----------
>> 10449
>>
>>
>> Modified Paths:
>> ---------------
>> trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
>>
>>
>> Diffs:
>> ------
>> Index: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
>> ===================================================================
>> --- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
(revision 10448)
>> +++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
(revision 10449)
>> @@ -1687,38 +1687,42 @@
>> */
>> public void setFrameVisible(final boolean isVisible)
>> {
>> - ConfigurationUtils.setApplicationVisible(isVisible);
>> + if (this.isVisible() != isVisible)
>> + {
>> + ConfigurationUtils.setApplicationVisible(isVisible);
>>
>> - SwingUtilities.invokeLater(new Runnable(){
>> - public void run()
>> - {
>> - if(isVisible)
>> + SwingUtilities.invokeLater(new Runnable(){
>> + public void run()
>> {
>> - MainFrame.this.addNativePlugins();
>> + if(isVisible)
>> + {
>> + MainFrame.this.addNativePlugins();
>>
>> - Window focusedWindow =
keyManager.getFocusedWindow();
>> + Window focusedWindow =
keyManager.getFocusedWindow();
>>
>> - // If there's another currently focused window we
prevent
>> - // this frame from steeling the focus. This
happens for
>> - // example in the case of a Master Password window
which is
>> - // opened before the contact list window.
>> - if (focusedWindow != null)
>> - setFocusableWindowState(false);
>> + // If there's another currently focused window
we
>> + // prevent this frame from steeling the focus.
This
>> + // happens for example in the case of a Master
Password
>> + // window which is opened before the contact
list
>> + // window.
>> + if (focusedWindow != null)
>> + setFocusableWindowState(false);
>>
>> - MainFrame.super.setVisible(isVisible);
>> + MainFrame.super.setVisible(isVisible);
>>
>> - if (focusedWindow != null)
>> - setFocusableWindowState(true);
>> + if (focusedWindow != null)
>> + setFocusableWindowState(true);
>>
>> - MainFrame.super.setExtendedState(MainFrame.NORMAL);
>> - MainFrame.super.toFront();
>> +
MainFrame.super.setExtendedState(MainFrame.NORMAL);
>> + MainFrame.super.toFront();
>> + }
>> + else
>> + {
>> + MainFrame.super.setVisible(isVisible);
>> + }
>> }
>> - else
>> - {
>> - MainFrame.super.setVisible(isVisible);
>> - }
>> - }
>> - });
>> + });
>> + }
>> }
>>
>> /**
>>
>>
>>
>>
>

--
https://jitsi.org****