"Fixed" mouseup event

BlitzMax Forums/MaxGUI Module/"Fixed" mouseup event

overmeeren(Posted 2010) [#1]
I had not updated my MaxGUI in a while, so I just updated from 1.39 to 1.41, I'm on Mac OS and just found out the behavior of the EVENT_MOUSUP has changed, apparently after a bug report by a user.


How it used to work (old behavior):

* 'mousdown' on gadget 'A'
* hold down the mouse and move it somewhere, for example to gadget 'B'
* let go of the mouse (mousup) over gadget 'B' and the source of the EVENT_MOUSEUP is gadget 'B'


How it currently works ("fixed" behavior):

* 'mousdown' on gadget 'A'
* hold down the mouse and move it somewhere, for example to gadget 'B'
* let go of the mouse (mousup) over gadget 'B' and the source of the EVENT_MOUSEUP is gadget 'A'


What makes more sense?


The old behavior seems to make more sense to me as the mouseup is done over gadget 'B', the "fixed" behavior is just a delayed 'mousedown'. Really, what use is it?, you can never detect a seperate 'mouseup' on a different object unless you've 'mousedown' on it previously.


skn3[ac]'s description:

1) click and hold left mouse button on the canvas
2) move the mouse (while still holding left mouse) outside of the canvas
3) release the mouse

The EVENT_MOUSEUP doesn't get fired. I always remember this working on windows...


EVENT_MOUSEUP doesn't get fired and rightfully so, since the 'mousup' isn't over the canvas. There are many easy ways to store the 'mousedown' gadget and retrieve it at 'mouseup', but there are no easy ways (to my knowledge) to detect the 'true' 'mouseup' gadget now without writing some quacky hacky event code.


In my opinion the "fixed" behavior is awkward and needs to be reversed, and if it was that way on MaxGUI Windows then you haven't fixed it on the Mac, you've now also broken it on the Mac, and it was MaxGUI Windows behavior that needed fixing.


Thoughts?


overmeeren(Posted 2010) [#2]
Hmm, perhaps a compromise could be made like this:

if the event is a 'mouseup' but there is no MaxGUI object under the mouse pointer, then the source is the mousedown object (as it is now).

if the event is a 'mouseup' and there is a MaxGUI object under the mouse pointer, then the source is the MaxGUI object under the mouse pointer (as it was, and in my opinion should be).


overmeeren(Posted 2010) [#3]
I tried to workaround the problem, but there is no easy workaround with events and/or hooks as far as I've tried. After a mousedown (without releasing it) no Gadgets fire any events, so it is practically impossible to determine the correct 'mouseup' Gadget. (Unless you get truly ugly, which you shouldn't since it worked fine before)

I've therefor created a bug report: http://www.blitzbasic.com/Community/posts.php?topic=91995

Perhaps I'm missing a simple workaround, if so, do enlighten me.