[sip-comm-dev] behaviors of cliks and double clicks on the tray icon


#1

Hi Sympho, Lubomir, Sébastien and all,

Sorry to re-open this thread, but I am quite annoyed by the new behavior of the systray since it can not be used anymore to hide SC main frame. In fact, I was thinking this was a bug introduced in last week commits until Emil told me that a thread was open on this subject.

Indeed, for any software the systray is mainly used to display a menu and show/hide the main frame of an application. As Sébastien said for Pidgin, Gajim, Psi and from other kind of softwares (Amarok, Tuxguitar, etc.), the show/hide main frame is triggered by a single click.

Since JDIC does not manage single click for the systray, we will have to wait for java-1.6 in order to perform it correctly. But until we are using JDIC, the question remaining is, if it is more user friendly:

1) To provide a way to show/hide the main frame (via systray double click)?

2) To disable one of the main functionality of the systray (double click only show the main frame)?

My preference will go to 1), but last week modifications (rev 5020) show that it may not be the case for everyone. There is no "best" solution and we will surely have to do a little poll on this issue or/and add an option to configure it via the "Option" frame.

What do you think about it?

Cheers,
Vincent

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Vincent,

The first intent of the modification was really not to remove the ability to hide the main window from the tray icon.
The doubleclick was a bit tricky since the window was sometimes shown then immediatly hidden or vice versa.

May be it was due to the use of a timeout on clicks which wasn't always accurate. The attached patch permits to hide and show the main window, wihtout using a timeout.

Here is the observed behavior when user doubleclick (action are performed on doubleclick due to jdic)

if the window is hidden or iconified
    the window comes to front
else
    the window is hidden

It is nearly the primary behavior, I think, without the fast hide/show on multiple clicks (on windows at least)

Regards
Sympho

--- En date de : Mar 24.2.09, Vincent Lucas <lucas@clarinet.u-strasbg.fr> a écrit :

tray_clicks.patch (1.33 KB)

···

De: Vincent Lucas <lucas@clarinet.u-strasbg.fr>
Objet: [sip-comm-dev] behaviors of cliks and double clicks on the tray icon
À: "Dev Sip-Communicator" <dev@sip-communicator.dev.java.net>
Date: Mardi 24 Février 2009, 16h11
Hi Sympho, Lubomir, Sébastien and all,

Sorry to re-open this thread, but I am quite annoyed by the
new behavior of the systray since it can not be used anymore
to hide SC main frame. In fact, I was thinking this was a
bug introduced in last week commits until Emil told me that
a thread was open on this subject.

Indeed, for any software the systray is mainly used to
display a menu and show/hide the main frame of an
application. As Sébastien said for Pidgin, Gajim, Psi and
from other kind of softwares (Amarok, Tuxguitar, etc.), the
show/hide main frame is triggered by a single click.

Since JDIC does not manage single click for the systray, we
will have to wait for java-1.6 in order to perform it
correctly. But until we are using JDIC, the question
remaining is, if it is more user friendly:

1) To provide a way to show/hide the main frame (via
systray double click)?

2) To disable one of the main functionality of the systray
(double click only show the main frame)?

My preference will go to 1), but last week modifications
(rev 5020) show that it may not be the case for everyone.
There is no "best" solution and we will surely
have to do a little poll on this issue or/and add an option
to configure it via the "Option" frame.

What do you think about it?

Cheers,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net


#3

Hi Vincent, Sympho,

Since JDIC does not manage single click for the systray, we will have to
wait for java-1.6 in order to perform it correctly. But until we are using
JDIC, the question remaining is, if it is more user friendly:

1) To provide a way to show/hide the main frame (via systray double click)?

2) To disable one of the main functionality of the systray (double click
only show the main frame)?

My preference will go to 1)

I would also go for 1 because users expect thewindow focus/position
to change when clicking the systray icon, even when the contact list
is already shown to front and focused.

···

On Tue, Feb 24, 2009 at 4:11 PM, Vincent Lucas <lucas@clarinet.u-strasbg.fr> wrote:

On Tue, Feb 24, 2009 at 5:08 PM, sympho <sympho@ebcservice.com> wrote:

Here is the observed behavior when user doubleclick (action are performed on doubleclick due to jdic)

if the window is hidden or iconified
   the window comes to front
else
   the window is hidden

It is nearly the primary behavior, I think, without the fast hide/show on multiple clicks (on windows at least)

Minus the JDIC-related limitation, this is IMHO the best behaviour. I

I just tested with build 1729 last SVN and a visible but non focused
SC window will be hidden when double-clicking the systray icon. Is
this intended?

Cheers,

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Sympho,

Thank you for this quick reply. I totally approve and have committed your patch (commit r5067).

I hope that the tricky behavior of the doubleclick you have previously experienced will no more appear.

Vincent

sympho wrote:

···

Hi Vincent,

The first intent of the modification was really not to remove the ability to hide the main window from the tray icon.
The doubleclick was a bit tricky since the window was sometimes shown then immediatly hidden or vice versa.

May be it was due to the use of a timeout on clicks which wasn't always accurate. The attached patch permits to hide and show the main window, wihtout using a timeout.

Here is the observed behavior when user doubleclick (action are performed on doubleclick due to jdic)

if the window is hidden or iconified
    the window comes to front
else
    the window is hidden

It is nearly the primary behavior, I think, without the fast hide/show on multiple clicks (on windows at least)

Regards
Sympho

--- En date de : Mar 24.2.09, Vincent Lucas <lucas@clarinet.u-strasbg.fr> a �crit :

De: Vincent Lucas <lucas@clarinet.u-strasbg.fr>
Objet: [sip-comm-dev] behaviors of cliks and double clicks on the tray icon
�: "Dev Sip-Communicator" <dev@sip-communicator.dev.java.net>
Date: Mardi 24 F�vrier 2009, 16h11
Hi Sympho, Lubomir, S�bastien and all,

Sorry to re-open this thread, but I am quite annoyed by the
new behavior of the systray since it can not be used anymore
to hide SC main frame. In fact, I was thinking this was a
bug introduced in last week commits until Emil told me that
a thread was open on this subject.

Indeed, for any software the systray is mainly used to
display a menu and show/hide the main frame of an
application. As S�bastien said for Pidgin, Gajim, Psi and
from other kind of softwares (Amarok, Tuxguitar, etc.), the
show/hide main frame is triggered by a single click.

Since JDIC does not manage single click for the systray, we
will have to wait for java-1.6 in order to perform it
correctly. But until we are using JDIC, the question
remaining is, if it is more user friendly:

1) To provide a way to show/hide the main frame (via
systray double click)?

2) To disable one of the main functionality of the systray
(double click only show the main frame)?

My preference will go to 1), but last week modifications
(rev 5020) show that it may not be the case for everyone.
There is no "best" solution and we will surely
have to do a little poll on this issue or/and add an option
to configure it via the "Option" frame.

What do you think about it?

Cheers,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Hi,

I just tested with build 1729 last SVN and a visible but
non focused
SC window will be hidden when double-clicking the systray
icon. Is
this intended?

It is not intended, but didn't found a convenient way to distinguish when the window is visible but focused ot not.
Checking if the window is focused won't work. In actioPerformed, isFocused() always returns false even if the window is (was) on top, because as soon as we click on the trayicon, the focus goes to the tray due to that click.

···

++
Sympho

Cheers,

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

I didn't notice that with Metacity (the systray doesn't steal the
focus). Can you please test with the attached patch and confirm?

However, ExportedWindow.brintToFront() or simply Window.toFront()
doesn't work. It gives the focus but SC window position in the visible
windows stack doesn't change. I'm definitely getting weird results while
playing with swing and window managing (non focused window at the top or
focused window at the back...).

Another small annoyance is that a non visible window will always be
restored at the center of the screen, instead of its previous position.

systray_icon_focused_state.diff (1.32 KB)

···

On Wed, Feb 25, 2009 at 09:17:56AM +0000, sympho wrote:

> I just tested with build 1729 last SVN and a visible but non focused
> SC window will be hidden when double-clicking the systray icon. Is
> this intended?

It is not intended, but didn't found a convenient way to distinguish
when the window is visible but focused ot not. Checking if the window
is focused won't work. In actioPerformed, isFocused() always returns
false even if the window is (was) on top, because as soon as we click
on the trayicon, the focus goes to the tray due to that click.

--
Sébastien Mazy


#7

Actually it's a know bug reported more than 2 years ago:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6472274

There is a workaround we could use posted in the comments.

···

On Wed, Feb 25, 2009 at 04:52:20PM +0100, Sébastien Mazy wrote:

However, ExportedWindow.brintToFront() or simply Window.toFront()
doesn't work. It gives the focus but SC window position in the visible
windows stack doesn't change.

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#8

Hi Sébastien

I tested your patch, and the behavior on windows is the one of the first
modification : on double click, the windows will come to front if it was hidden,
iconified or not on top. but when on top, a double click will not hide it.

                if (win.isVisible() && win.isFocused())
                    win.setVisible(false);

On windows, a double click on the tray icon will move the focus from the
window to the tray and since the window is not more focused,
it wont be hidden.

However, if it works fine on linux (to show and hide), I guess it could be
fine for windows since this behavior is what windows users are used to
with other IM softs on that platform.

···

++
Sympho.

--- En date de : Mer 25.2.09, Sébastien Mazy <smazy@dev.java.net> a écrit :

De: Sébastien Mazy <smazy@dev.java.net>
Objet: Re: [sip-comm-dev] behaviors of cliks and double clicks on the tray icon
À: dev@sip-communicator.dev.java.net
Date: Mercredi 25 Février 2009, 16h52
On Wed, Feb 25, 2009 at 09:17:56AM +0000, sympho wrote:
> > I just tested with build 1729 last SVN and a
visible but non focused
> > SC window will be hidden when double-clicking the
systray icon. Is
> > this intended?
>
> It is not intended, but didn't found a convenient
way to distinguish
> when the window is visible but focused ot not.
Checking if the window
> is focused won't work. In actioPerformed,
isFocused() always returns
> false even if the window is (was) on top, because as
soon as we click
> on the trayicon, the focus goes to the tray due to
that click.

I didn't notice that with Metacity (the systray
doesn't steal the
focus). Can you please test with the attached patch and
confirm?

However, ExportedWindow.brintToFront() or simply
Window.toFront()
doesn't work. It gives the focus but SC window position
in the visible
windows stack doesn't change. I'm definitely
getting weird results while
playing with swing and window managing (non focused window
at the top or
focused window at the back...).

Another small annoyance is that a non visible window will
always be
restored at the center of the screen, instead of its
previous position.

--
Sébastien Mazy
---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#9

On windows, a double click on the tray icon will move the focus from the
window to the tray and since the window is not more focused,
it wont be hidden.

I'm curious to know whether this is due to Windows or Java. I've
attached a class to test with JSE 6 systray code. Could you please try
it with a focused and an unfocused frame and single- and double-click,
and report the console output?

However, if it works fine on linux (to show and hide), I guess it could be
fine for windows since this behavior is what windows users are used to
with other IM softs on that platform.

I guess that would work, but I don't really like the idea of relying on
a bug (but do we have a choice?).

TestSystrayIcon.java (1.57 KB)

···

On Thu, Feb 26, 2009 at 09:48:49AM +0000, sympho wrote:

--
Sébastien Mazy


#10

Hi Sébastien

Attached is the console output. The window is never the focus owner.

I dont think there is bug. On windows, no matter which app own the focus,
when you click on any trayicon, the focus goes to the tray icon on which
you clicked.
May be it dont arrange us, but I think it is somewhatconsitent.

···

++
Sympho.

--- En date de : Jeu 26.2.09, Sébastien Mazy <smazy@dev.java.net> a écrit :

De: Sébastien Mazy <smazy@dev.java.net>
Objet: Re: [sip-comm-dev] behaviors of cliks and double clicks on the tray icon
À: dev@sip-communicator.dev.java.net
Date: Jeudi 26 Février 2009, 12h08
On Thu, Feb 26, 2009 at 09:48:49AM +0000, sympho wrote:
> On windows, a double click on the tray icon will move
the focus from the
> window to the tray and since the window is not more
focused,
> it wont be hidden.

I'm curious to know whether this is due to Windows or
Java. I've
attached a class to test with JSE 6 systray code. Could you
please try
it with a focused and an unfocused frame and single- and
double-click,
and report the console output?

> However, if it works fine on linux (to show and hide),
I guess it could be
> fine for windows since this behavior is what windows
users are used to
> with other IM softs on that platform.

I guess that would work, but I don't really like the
idea of relying on
a bug (but do we have a choice?).

--
Sébastien Mazy
---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
dev-help@sip-communicator.dev.java.net