[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Movewindow function transiently disappears during unrelated WindowAddHotspot

Movewindow function transiently disappears during unrelated WindowAddHotspot

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


Posted by Fiendish   USA  (2,518 posts)  [Biography] bio   Global Moderator
Date Sat 12 Mar 2022 06:50 AM (UTC)

Amended on Sun 13 Mar 2022 10:59 PM (UTC) by Fiendish

Message
I have a bit of a strange situation that I can reproduce 100% in situ, but so far I have not managed to make a minimal test case.

This is what happens...

The player makes a miniwindow in the world script space with a movewindow drag handler on it. The player then drags the window around for a while over top of their GMCP mapper miniwindow which of course lives in its own plugin. If new room GMCP data arrives (like if they set a timer to send the "look" command) causing the mapper to refresh its display, the miniwindow they're dragging suddenly AND TEMPORARILY forgets that its mouse handler functions exist and this error message pops up saying:

Quote:
Cannot find the function 'mw_testwindow_movewindow_info.dragmove' - item 'dragmove' is nil


https://i.imgur.com/Cz0503w.png

After clicking "Ok" to dismiss the error message, the miniwindow that was being dragged stays stuck to the mouse cursor, following it around until the mouse is clicked again. After that, the miniwindow's dragmove handler resumes working normally until the next time.

The problem goes away if I comment out this WindowAddHotspot call inside the mapper https://github.com/fiendish/aardwolfclientpackage/blob/c6441b3c36e58ca79ef2029292e8012d86a4e9f7/MUSHclient/lua/aardmapper.lua#L919-L924

I've ruled out my Lua DLL by making some necessary modifications to be able to load the Aardwolf mapper plugin without LuaJIT and dropping in the classic one, so that's not the problem.

I think the problem also doesn't occur if the dragged miniwindow is larger than the mapper miniwindow, so it may be some global optimization gone bad using the hotspot corner coordinates when adding hotspots to miniwindows?

Anyway, there appears to be _something_ about that WindowAddHotspot call that is transiently botching an entirely unrelated script's miniwindow's ability to remember its dragmove function.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (23,000 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 16 Mar 2022 02:05 AM (UTC)
Message
Quote:

causing the mapper to refresh its display


Does the mapper remove all hotspots while refreshing the display?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,518 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Wed 16 Mar 2022 02:16 AM (UTC)

Amended on Wed 16 Mar 2022 02:18 AM (UTC) by Fiendish

Message
It would remove all of its own, yes. 99% of all hotspots on the mapper are individual rooms which are getting drawn from scratch when new room info arrives.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (23,000 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 16 Mar 2022 05:19 AM (UTC)

Amended on Wed 16 Mar 2022 05:20 AM (UTC) by Nick Gammon

Message

So the miniwindow which is not being refreshed suddenly “forgets” about the mouse-down action?


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,518 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Wed 16 Mar 2022 06:21 AM (UTC)

Amended on Wed 16 Mar 2022 06:27 AM (UTC) by Fiendish

Message
Yeah. Mid-drag, the drag handler function that it was using just nanoseconds prior is suddenly set to nil, causing an error, and then is immediately restored after dismissing said error.

I did say it was a strange situation. :)

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (2,518 posts)  [Biography] bio   Global Moderator
Date Reply #5 on Sat 26 Mar 2022 03:31 PM (UTC)
Message
Commenting out this block makes the problem go away.
https://github.com/nickgammon/mushclient/blob/059aa23f76a099f9b826eae873a79a2a81859ffd/scripting/methods/methods_miniwindows.cpp#L580-L599

I suspect that inducing a move on a newly created hotspot should only happen if the mouse is not already bound to dragging another hotspot.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (2,518 posts)  [Biography] bio   Global Moderator
Date Reply #6 on Sat 26 Mar 2022 04:28 PM (UTC)
Message
So maybe https://github.com/nickgammon/mushclient/pull/69

https://github.com/fiendish/aardwolfclientpackage
[Go to top] 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.


10,296 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]