Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ unintended consequences from (I believe) 4.76 change #10

unintended consequences from (I believe) 4.76 change #10

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Mon 18 Jul 2011 08:32 PM (UTC)
Message
Change 10 in MUSHclient 4.76 says
Quote:
If the mouse is over a hotspot after it was created then a mouse-move event is generated. Previously a newly-created hotspot was only noticed when you moved the mouse.


This was done because of http://www.gammon.com.au/forum/?id=11197

Except now there are far worse problems because it's not just the mouseover callback firing, but rather an entire mouse-move event happening any time a hotspot gets created. It looks like every time a trigger fires in any plugin the mouse position gets reset, which manifests in the following way:

I have a simple resizable miniwindow, like in this picture https://aardwolfclientpackage.googlecode.com/svn/trunk/wiki_images/ascii_map1.png

/While/ I am dragging the resizing tab, if any window updates its contents it does terrible things.

First, if as a result of the mouse-move the current miniwindow recreates hotspots (which then calls mouse-move again) then this obviously causes an infinite loop in the window (this happens in my chat capture window plugin, for example). But it also appears that if any /other/ miniwindow creates hotspots then the stored mouse position can get messed up which makes the window that is currently being resized jump around each time.

I originally was looking for /only/ mouseover callbacks to fire, which I think would solve these problems.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 18 Jul 2011 08:42 PM (UTC)
Message
Yes, but...

The mouseover callbacks are supposed to be paired, that is you get a mouseover followed by a cancel_mouseover. The function that I called (which happens on a mouse move) should have kept the original integrity, that is it cancels any previous mouseover, and starts a new one, etc.

Let's say for example you created a hotspot in response to a mouse-down, then the mouseover should not be generated because we are currently mousing-down.

Quote:

First, if as a result of the mouse-move the current miniwindow recreates hotspots (which then calls mouse-move again) then this obviously causes an infinite loop in the window (this happens in my chat capture window plugin, for example).


Well you wanted a mouse-move generated when you created a hotspot so I supposed you might expect that.

Quote:

I originally was looking for /only/ mouseover callbacks to fire, which I think would solve these problems.


I don't see how that fixes the problem of the loop.

Would it help if there was an extra test? That the extra code is only executed if the mouse is (thought to be) over the newly created hotspot (rather than unconditionally)?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 18 Jul 2011 08:43 PM (UTC)
Message
I think it is a bit of a design flaw, to make it so that if the mouse moves, you create a hotspot, the hotspot being one that detects mouse moves and recreates itself.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 18 Jul 2011 09:14 PM (UTC)
Message
Would it help if I made it impossible to create hotspots in a mouse-move event?

One problem is the issue of "which mouse position?".

If the mouse is moving fast we have at least 3 positions:


  1. Where the mouse was when the mouse move event was generated by Windows.

  2. Where the mouse is when the mouse-move plugin callback is called.

  3. Where the mouse is when you call WindowAddHotspot.


They could all be different positions.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #4 on Tue 19 Jul 2011 12:24 AM (UTC)

Amended on Tue 19 Jul 2011 01:35 AM (UTC) by Fiendish

Message
Nick Gammon said:
Well you wanted a mouse-move generated when you created a hotspot so I supposed you might expect that.

I don't want a mouse-move generated when a hotspot is created. I don't actually think that generating a mouse-move is correct or appropriate, because the mouse may not in fact be moving. It is the hotspot that is moving rather than the mouse, which is why I think that /only/ onmouseover should be called (if appropriate).

Quote:
Would it help if there was an extra test? That the extra code is only executed if the mouse is (thought to be) over the newly created hotspot (rather than unconditionally)?
I don't know, maybe, but see above.

Quote:
I think it is a bit of a design flaw, to make it so that if the mouse moves, you create a hotspot, the hotspot being one that detects mouse moves and recreates itself.
My understanding of the current problem is that this is not actually what is happening. In fact, I don't think that that's even possible, since hotspot creation tends to delete callbacks. It looks like the mouse-move event is happening even if an entirely different miniwindow creates hotspots.

Quote:
One problem is the issue of "which mouse position?".
All I know is that with 4.75 all of my resizing works great. And in 4.76 if any miniwindow other than the one I'm trying to resize updates its hotspots because of a trigger firing the resizing gets screwed up.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 19 Jul 2011 06:37 AM (UTC)
Message
I seem to have done a couple of things wrong there.

The code for generating the mouse-move was using the wrong mouse coordinates which would tend to explain what was happening to you. That is fixed in version 4.77

Also code to detect infinite loops was added. Dropping that on top of your Aardwolf build it seems to work OK now (without any code changes on your part).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,342 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.