Fix private message windows stealing focus

As the title suggests, there needs to be a way to stop private message windows stealing focus. To clarify that is when ever an incoming private message is received cursor focus is automatically switched to the new window. This is incredibly infuriating when playing a game while talking to another person or worse still multiple other people.

Should be an easy fix and would go a long way to improving the experience.

Thanks

I’ve noted this in the bug tracker as Bug 3210:

vassalengine.org/tracker/sho … gi?id=3210

I’ve noticed just now that due to a bug in the list bridge, messages with complex In-Reply-To headers were not making it across to the forum. (The bug is now corrected.) Unfortunately, there were several such messages on this thread. I’m quoting them here.

Thus spake Wojciech:

I am attaching the patch, the modified behaviour is as follows:

  • if the chat window is visible but any other window has focus, then
    it
    switches focus to the chat window, e.g. it would happen if VASSAL
    was
    open but not maximised and the chat window was beside main VASSAL
    window

  • if the chat window is not visible or not present yet, the focused
    window will remain to have focus and the chat window will become
    iconified and blinking in a window manager task bar

  • if the chat window has already focus then don’t do anything special
    with it

Tested on Linux. Let me know how to proceed with the Bugzilla.

I tested the patch this evening; I think it doesn’t have the correct
behavior. In particular:

  • When a message is received and no chat window is open, a chat window
    should pop up, but not get focus. What it seems to do now is pop up and
    then minimize itself. (Also, I’ve noticed that the chat dialog has the
    wrong icon associated with it, but I guess that’s not new…)

  • When a message is received and a chat window from the same sender is
    open, it should send a ‘notification’ in what ever way that’s done on
    whatever window manager is being used. Now what happens is that the
    chat window steals focus, which is what the bug reporter was complaining
    about.

Thoughts?


J.

On Thu, Dec 16, 2010 at 7:18 PM, uckelman uckelman@nomic.net wrote:

I’ve noticed just now that due to a bug in the list bridge, messages
with complex In-Reply-To headers were not making it across to the forum.
(The bug is now corrected.) Unfortunately, there were several such
messages on this thread. I’m quoting them here.

I noticed that too, in the begining I thought it was something to do
with the forum-mail sync, and I need to wait. Then I started to think
that the format of the header was not correct, in particulal format of a
subject. I am glad it is fixed now. (I use Gnus as MUA most of the time,
sometimes gmail web interface when I can’t use Gnus. I should tell you
before about it, though. Unfortunately resending them would not be a
good idea, because the bridge does not thread (it appends message in the
chronological order, not based on content in anyway, which is actually
more reasonable).

Thanks for fixing this.

Wojciech

I tested the patch this evening; I think it doesn’t have the correct
behavior. In particular:

  • When a message is received and no chat window is open, a chat window
    should pop up, but not get focus. What it seems to do now is pop up and
    then minimize itself. (Also, I’ve noticed that the chat dialog has the
    wrong icon associated with it, but I guess that’s not new…)

  • When a message is received and a chat window from the same sender is
    open, it should send a ‘notification’ in what ever way that’s done on
    whatever window manager is being used. Now what happens is that the
    chat window steals focus, which is what the bug reporter was complaining
    about.

Thoughts?

Thanks for checking it and your comments. I will look at it in the
meantime once again, and try to come up with the correct behavior. I
might have more time during my holiday to work on Vassal (and I should
have a second computer as well), starting in the end of the next week. I
am planing to do some major work on Vassal this weekend as well (not
being distracted by my other projects). Apart from the `pointing device’
and the problem above I will look at some other stuff that needs fixing
(probably a random small thing from forum or Bugzilla).

Thanks,
Wojciech

Thus spake Wojciech Meyer:

I noticed that too, in the begining I thought it was something to do
with the forum-mail sync, and I need to wait.

It should be nearly immediate. If you ever notice missing posts again,
please let me know right away so I can fix the problem.

the bridge does not thread (it appends message in the
chronological order, not based on content in anyway, which is actually
more reasonable).

I can’t make the bridge thread properly because the forum is flat (which
is something I’ve always hated about most fora).


J.

Thus spake Wojciech Meyer:

I tested the patch this evening; I think it doesn’t have the correct
behavior. In particular:

  • When a message is received and no chat window is open, a chat window
    should pop up, but not get focus. What it seems to do now is pop up and
    then minimize itself. (Also, I’ve noticed that the chat dialog has the
    wrong icon associated with it, but I guess that’s not new…)

  • When a message is received and a chat window from the same sender is
    open, it should send a ‘notification’ in what ever way that’s done on
    whatever window manager is being used. Now what happens is that the
    chat window steals focus, which is what the bug reporter was complaining
    about.

Thoughts?

Thanks for checking it and your comments. I will look at it in the
meantime once again, and try to come up with the correct behavior.

Basically what I’m after is behavior like you’d expect from an IM
client.

being distracted by my other projects). Apart from the `pointing device’
and the problem above I will look at some other stuff that needs fixing
(probably a random small thing from forum or Bugzilla).

If you look here, you can see popular bugs:

vassalengine.org/tracker/dup … openonly=1

(I’ve restricted the search to open bugs over VASSAL only.)

All bug fixes are appreciated; fixes for frequently reported bugs, doubly
so (though many of these are going to be hard cases).


J.

I can’t make the bridge thread properly because the forum is flat (which
is something I’ve always hated about most fora).

Yes, I understand - it is a limitation, it sucks. and we can’t do
anything about it,
but in fact it is not a problem as long I use email only, the MUA will
thread for me.
(the problem I see is that obviously it is only for people subscribed,
which means
that the hit from google to our forum will not be threaded, BTW:
google search does not
hit forum as I wish it could…, is it because the forum is new?).

Thus spake Wojciech Meyer:

google search does not
hit forum as I wish it could…, is it because the forum is new?).

No, the forum has been around for years. Do you have any idea what’s
wrong?


J.

Joel Uckelman uckelman@nomic.net writes:

No, the forum has been around for years. Do you have any idea what’s
wrong?

I don’t have any clue, it seems that it indexes the forum but not as
good as we want (there are some traces so it knows about it, but
somewhat it’s lower priority). Does it happen in all the PhpBB forums?

OK. Quick look:

phpbb.com/community/viewtopi … &t=2099249

(I didn’t know about it, I’ve just logged in and be adding Vassal forums
and tweaking settings, AFAIU it improves a global search not only mine).

google.com/support/forum/p/W … 1160&hl=en

Also maybe checking robots.txt would be useful.

I will research that more, and see if we can improve it (I have a google
account).

Wojciech

Wojciech Meyer wojciech.meyer@gmail.com writes:

phpbb.com/community/viewtopi … &t=2099249

(I didn’t know about it, I’ve just logged in and be adding Vassal forums
and tweaking settings, AFAIU it improves a global search not only mine).

To use `webmaster central’ I’ve to be the owner of the website,
basically google is trying to ensure I have a write access to it by
providing an admin specific information. So it would be easier if you
could do it, it is very easy and quick job, however to do it you’d need
a google account (which is fairly easy to get). It is worth trying I
think. Google search-able forum would a Very Good Thing IMPO.

Wojciech

Joel Uckelman uckelman@nomic.net writes:

Thus spake Wojciech:

I am attaching the patch, the modified behaviour is as follows:

  • if the chat window is visible but any other window has focus, then
    it
    switches focus to the chat window, e.g. it would happen if VASSAL
    was
    open but not maximised and the chat window was beside main VASSAL
    window

  • if the chat window is not visible or not present yet, the focused
    window will remain to have focus and the chat window will become
    iconified and blinking in a window manager task bar

  • if the chat window has already focus then don’t do anything special
    with it

Tested on Linux. Let me know how to proceed with the Bugzilla.

I tested the patch this evening; I think it doesn’t have the correct
behavior. In particular:

  • When a message is received and no chat window is open, a chat window
    should pop up, but not get focus. What it seems to do now is pop up and
    then minimize itself. (Also, I’ve noticed that the chat dialog has the
    wrong icon associated with it, but I guess that’s not new…)

  • When a message is received and a chat window from the same sender is
    open, it should send a ‘notification’ in what ever way that’s done on
    whatever window manager is being used. Now what happens is that the
    chat window steals focus, which is what the bug reporter was complaining
    about.

Thoughts?

Hi Joel,

Thanks for reviewing this, I appreciate that, giving that it is really
troublesome to test it.

Sorry for this looong delay and no see on the mailing list (Christmas
break, and some other stuff too and I am quite irregular with my schedule),
I am still interested in submitting some work to Vassal and hope you are
interested to welcome my work.

About this particular patch, maybe I’ve taken a wrong one, because it is
actually more less a feature request (if we talk about implementing
cross-platform tray notification, oh I just saw it was indeed a feature
request not a bugfix…), maybe I improved a bit the behaviour, however
like you say, probably it is not what the user expects and it is far
from perfect. (I just needed more courage to actually do the right thing
and make the real notification) I agree with that. Sorry about taking your time on
it. It’s also hard to test as it needs two computers, and it needs
thorough testing on windows…

I will continue hacking around Vassal.

Few questions:

  • I see not much move on trunk, is it preferable branch?, I have not
    tried today to run vassal on it, but i remember it was not possible to
    run (AFAIR last time). Which branch would be a recommended one if I
    want to catch the development stream? I use this URL:
    vassalengine.svn.sourceforge.ne … -src/trunk.
    I am also seeing a lot of private branches.

  • You mentioned that we will switch to git, I already use git-svn, and
    wish to see moving towards this direction (however it is not that
    important for me). Let me know how it goes, once you got some time to
    do it. I think it will be appreciated, git has many good
    things. (but I think it is more work to do the migration than it looks
    like, people also need to get familiar with git, and it is so different
    than older generation SCMs).

So in the meantime let me see if I can fix anything else.

Thanks,
Wojciech