Re: Detect the END of a stack move not that it’s moving
Posted: Mon Mar 20, 2017 11:23 am
@Jacque:
With respect to the LiveResizing property, it did not seem to make a difference but I appreciate your suggestion.
@FourthWorld
“[Have you considered the possibility that other apps may have needs different from the one you're working on? One man's "wasteful" is another man's "thorough"]”
My Resp:
Yes. I did consider this since I qualified my statements by stating:
[1]Do you really want be pinging your logic every single frame, even if it’s not needed?
[2]This is woefully inefficient if the user just wants to run their logic at the end of the move.
[3] I also mentioned that there already existed other functions that could be used to monitor real time points. With the change in message meaning, it just makes it simpler to do so. Remember before this change folks were still able to execute the real time point functionality as you specified.
“[when we only get post-move events would be supremely "wasteful", since we'd have to monitor all mouseMove events and users move windows far less frequently than they move the mouse for any other reason.]”
My Resp:
Yes agreed but if you knew when the move started or separately told when to monitor interim move steps without messing with the original intent of the movestack as I had previously suggested, your monitoring would have been greatly minimized with no repercussions on any logic dependent on the old meaning of the message. Remember there is plenty of code is out there still using ver 6-7 with the old meaning which is about the timeframe the message was changed.
That is what I meant when I had stated before that:
Had this been well or completely thought out before this decision was made at the point the change was proposed for purposes of consistency or whatever other reason?
I would tend to say no because:
Even if one did not know what exact functionality could happen after a move, the fact that the changed meaning essentially renders any functionality depending on the old meaning completely useless because think about the can of worms this opens. The code now would never get the message when it needs it and would always get it when it does not need it…wow! Talk about a DRASTIC change ripple effect.
Therefore this should have immediately raised red flags and set sirens going at the time of this decision REGARDLESS of not knowing exactly what functionality could be useful after a move.
In every technical change meeting involving the three distinct software groups I lead in various consulting endeavors, before anybody propose a change he or she needs to meet a minimum set of criteria before their change proposal is EVEN remotely considered. These are:
[1] Written and approved documentation needs to verify that the proposed change has full or “near” full backward compatibility unless the contract allows for written and documented deviations from this.
[2] Proposed change considered ONLY if there are no cheaper and timelier alternatives. This cannot be based on opinion or the direction of the wind that day but on written and approved facts with experienced subject matter experts INTIMATELY involved in those alternative plan proposals.
[3]More than one attempts (at least two needs to be documented) has been made to key personnel responsible for prior supported versions to capture typical examples of prior “in the field” usage so as to give the change proposal team the confidence and knowledge necessary to make such a change proposal or to retract from such proposals in a timely manner.
[4]Compare the proposed changes to at least one historical “prior change metrics” to see if it falls within the acceptable percentage of prior similarly executed changes to ensure the bank was not broken when the change was introduced.
With policies like this in place instead of here-say, very few things like this would fall through the cracks and continue to bite one in the future.
“[I can't tell you why the behavior on your Win7 behavior is different, but I just tested again here in LC v8.1.3 on a Win7 laptop and see the same behavior I see elsewhere, in which the moveStack message is sent while the stack is moving. Which version of LC are you using?]”
My Resp:
Perhaps laptops are not the most desirable test beds particularly when dealing with graphic related properties because they don’t have a real full-fledged graphics card. They mostly only have an integrated chip with nowhere near the capacity of a full-fledged graphics card. I have already seen other bugs that don’t surface on laptops but do so on a desktop which is the reason why I mostly test on complete desktops.
I have tested this on FOUR full-fledged DISTINCT desktops. Distinct in terms of different CPUs, different motherboards, different graphic cards, different monitors, different hard drives and different variations of Win 7 and every possible combination in between (yes, I am that thorough).
It does not matter what version of LC was used (tested with LC 8.0 – 9dp4), as long as it was used with Win 7 (orig, SP1, “SP2 equivalence”- meaning additional updates added on to SP1), the functionality of the moveStack message is that it is ONLY gets sent to the stack AFTER the movement has stopped and the user releases the mouse button from the title bar.
Any other time except for the movement end, it does not receive the message. For the checks, I used the LC file/script I had created and sent you (“checkMouseValueOnMove.livecode”) in my last post which clearly shows when you are receiving messages all the time versus only at the end. It can’t be missed or misunderstood because it is so visually demonstrated on the field as an on-going narrative remember?
“[it may be helpful if you could succinctly describe what your app needs to do when stack moving has completed.]”
My Resp:
What my app needs to do is the most requested thing after the ability to bring colored highlighted results outside of LC.
When using multiple monitors that may have different screen resolutions, every time the user moves the stack and places it on a different monitor or changes the screen resolution on the fly within the same monitor, the resolution change cause the ideal physical display size to change making the window and related controls look smaller, less appealing and out of scale or it can look bigger, wider less appealing and out of scale the other way.
The users wanted to have the ideal base resolution PHYSICAL size retained at all times regardless of any resolution change that occurred when the user moved the stack to a different monitor with a different resolution or within the same monitor if the screen resolution was changed on the fly. When changed on the fly, the user did not want to go to another screen then come back to finally see the res change - not when the change was instant.
So any non-trivial scaling like this needs to know when the move has completed to another monitor and since any instant screen resolution changes the position of the stacks left and top edges (which in essence is what defines a move), the app needs to know when this “instant real time” move has completed so the non-trivial scaling can commence.
There isn’t anything special or side cased about this as some would want others to believe since any non-trivial scaling on any “graphic burdened” system is not going to attempt to continuously scale unnecessarily (ie. Small movements with the same monitor or ending on a monitor with the same resolution – why scale again?). So this is actually quite common.
So based on this it only makes sense to check for an opportunity to scale a stack and its controls ONLY at the right time – right after a move has completed.
“[One thing to keep in mind is that checking whether "the mouse" is up or down within a moveStack handler should not work, since of course the mouse will always be down during a stack move.]”
My Resp:
Agreed but keep in mind that occasionally a mouse release is detected when the message should only be sent due to the mouse being pressed against the title bar while in movement. This actually happens if the user rapidly drags the stack and releases the mouse from the title bar at the SAME time the move comes to a complete stop, all done in a swift single contiguous move.
Like you said I don’t think it was the intention of LC to pick up mouse releases when it continuously sends messages as the stack is moving. In this case the intent would be to pick up mouse presses against the title bar during the move including the last movement where the stack is stopped since the user typically would stop moving the stack BEFORE releasing the mouse from the title bar so it is intentionally difficult to pick up a mouse release in these circumstances.
Based on the fact that this actually DOES happen and is reproducible I would say this has to be registered as a bug because LC should do whatever it takes to preclude this from happening and it isn’t.
LC can’t make an excuse and say it can’t preclude this from happening due to user interaction because it should be able to do exactly what my code manually did to preclude this from happening. If I could manually fix this in my code then LC should then also be able to do the same thing or similar internally and automatically.
[“in lieu of knowing what the problem is, this generalized solution below may help]”
My Resp:
This is in essence what the “checkMouseValueOnMove.livecode” script I sent you in my last post does except it actually has code included to actually execute the necessary fine details stated in your code comments and also makes it work regardless if the message was sent as it moved or if it were sent only at the end. This last thing ensures the code would work even if in is used in a win 7 system that still uses the old meaning of the message.
“[I do agree with Ed that it would be desirable to see a new message added so we can have a simple means of getting notification of when a moveStack ends. Each has a role, and while it's easier to get the post-move message from a timer than it is to monitor all mouse movement to track real-time stack movement, simpler still would be to have a message for stackMoved right in the box.]”
My Resp:
Agreed. The best solution similar to one of the ones I had previously suggested is to simply have two distinct messages
[1] endMoveStack – Behaving like the original one which only sends the message when the move completes but coinciding with the release of the mouse from the title bar
[2] onGoingMoveStack – Message sent anytime the stack is being moved coinciding with the mouse being pressed against the title bar.
The only lingering problem is the original users of the original intent (msg sent when move ends) are using the same message name as the newer users that are using the same message name for the newer intent (msg sent during the move) so which of the two users have to change their message name and who gets to keep the original message name?
See how a decision not completely thought out continues to affect functionality years later? It’s like a negative domino effect that seems to never want to end.
Thanks Fourthworld, even when we don't agree on everything, your comments and thoughts are always very much appreciated.
With respect to the LiveResizing property, it did not seem to make a difference but I appreciate your suggestion.
@FourthWorld
“[Have you considered the possibility that other apps may have needs different from the one you're working on? One man's "wasteful" is another man's "thorough"]”
My Resp:
Yes. I did consider this since I qualified my statements by stating:
[1]Do you really want be pinging your logic every single frame, even if it’s not needed?
[2]This is woefully inefficient if the user just wants to run their logic at the end of the move.
[3] I also mentioned that there already existed other functions that could be used to monitor real time points. With the change in message meaning, it just makes it simpler to do so. Remember before this change folks were still able to execute the real time point functionality as you specified.
“[when we only get post-move events would be supremely "wasteful", since we'd have to monitor all mouseMove events and users move windows far less frequently than they move the mouse for any other reason.]”
My Resp:
Yes agreed but if you knew when the move started or separately told when to monitor interim move steps without messing with the original intent of the movestack as I had previously suggested, your monitoring would have been greatly minimized with no repercussions on any logic dependent on the old meaning of the message. Remember there is plenty of code is out there still using ver 6-7 with the old meaning which is about the timeframe the message was changed.
That is what I meant when I had stated before that:
Had this been well or completely thought out before this decision was made at the point the change was proposed for purposes of consistency or whatever other reason?
I would tend to say no because:
Even if one did not know what exact functionality could happen after a move, the fact that the changed meaning essentially renders any functionality depending on the old meaning completely useless because think about the can of worms this opens. The code now would never get the message when it needs it and would always get it when it does not need it…wow! Talk about a DRASTIC change ripple effect.
Therefore this should have immediately raised red flags and set sirens going at the time of this decision REGARDLESS of not knowing exactly what functionality could be useful after a move.
In every technical change meeting involving the three distinct software groups I lead in various consulting endeavors, before anybody propose a change he or she needs to meet a minimum set of criteria before their change proposal is EVEN remotely considered. These are:
[1] Written and approved documentation needs to verify that the proposed change has full or “near” full backward compatibility unless the contract allows for written and documented deviations from this.
[2] Proposed change considered ONLY if there are no cheaper and timelier alternatives. This cannot be based on opinion or the direction of the wind that day but on written and approved facts with experienced subject matter experts INTIMATELY involved in those alternative plan proposals.
[3]More than one attempts (at least two needs to be documented) has been made to key personnel responsible for prior supported versions to capture typical examples of prior “in the field” usage so as to give the change proposal team the confidence and knowledge necessary to make such a change proposal or to retract from such proposals in a timely manner.
[4]Compare the proposed changes to at least one historical “prior change metrics” to see if it falls within the acceptable percentage of prior similarly executed changes to ensure the bank was not broken when the change was introduced.
With policies like this in place instead of here-say, very few things like this would fall through the cracks and continue to bite one in the future.
“[I can't tell you why the behavior on your Win7 behavior is different, but I just tested again here in LC v8.1.3 on a Win7 laptop and see the same behavior I see elsewhere, in which the moveStack message is sent while the stack is moving. Which version of LC are you using?]”
My Resp:
Perhaps laptops are not the most desirable test beds particularly when dealing with graphic related properties because they don’t have a real full-fledged graphics card. They mostly only have an integrated chip with nowhere near the capacity of a full-fledged graphics card. I have already seen other bugs that don’t surface on laptops but do so on a desktop which is the reason why I mostly test on complete desktops.
I have tested this on FOUR full-fledged DISTINCT desktops. Distinct in terms of different CPUs, different motherboards, different graphic cards, different monitors, different hard drives and different variations of Win 7 and every possible combination in between (yes, I am that thorough).
It does not matter what version of LC was used (tested with LC 8.0 – 9dp4), as long as it was used with Win 7 (orig, SP1, “SP2 equivalence”- meaning additional updates added on to SP1), the functionality of the moveStack message is that it is ONLY gets sent to the stack AFTER the movement has stopped and the user releases the mouse button from the title bar.
Any other time except for the movement end, it does not receive the message. For the checks, I used the LC file/script I had created and sent you (“checkMouseValueOnMove.livecode”) in my last post which clearly shows when you are receiving messages all the time versus only at the end. It can’t be missed or misunderstood because it is so visually demonstrated on the field as an on-going narrative remember?
“[it may be helpful if you could succinctly describe what your app needs to do when stack moving has completed.]”
My Resp:
What my app needs to do is the most requested thing after the ability to bring colored highlighted results outside of LC.
When using multiple monitors that may have different screen resolutions, every time the user moves the stack and places it on a different monitor or changes the screen resolution on the fly within the same monitor, the resolution change cause the ideal physical display size to change making the window and related controls look smaller, less appealing and out of scale or it can look bigger, wider less appealing and out of scale the other way.
The users wanted to have the ideal base resolution PHYSICAL size retained at all times regardless of any resolution change that occurred when the user moved the stack to a different monitor with a different resolution or within the same monitor if the screen resolution was changed on the fly. When changed on the fly, the user did not want to go to another screen then come back to finally see the res change - not when the change was instant.
So any non-trivial scaling like this needs to know when the move has completed to another monitor and since any instant screen resolution changes the position of the stacks left and top edges (which in essence is what defines a move), the app needs to know when this “instant real time” move has completed so the non-trivial scaling can commence.
There isn’t anything special or side cased about this as some would want others to believe since any non-trivial scaling on any “graphic burdened” system is not going to attempt to continuously scale unnecessarily (ie. Small movements with the same monitor or ending on a monitor with the same resolution – why scale again?). So this is actually quite common.
So based on this it only makes sense to check for an opportunity to scale a stack and its controls ONLY at the right time – right after a move has completed.
“[One thing to keep in mind is that checking whether "the mouse" is up or down within a moveStack handler should not work, since of course the mouse will always be down during a stack move.]”
My Resp:
Agreed but keep in mind that occasionally a mouse release is detected when the message should only be sent due to the mouse being pressed against the title bar while in movement. This actually happens if the user rapidly drags the stack and releases the mouse from the title bar at the SAME time the move comes to a complete stop, all done in a swift single contiguous move.
Like you said I don’t think it was the intention of LC to pick up mouse releases when it continuously sends messages as the stack is moving. In this case the intent would be to pick up mouse presses against the title bar during the move including the last movement where the stack is stopped since the user typically would stop moving the stack BEFORE releasing the mouse from the title bar so it is intentionally difficult to pick up a mouse release in these circumstances.
Based on the fact that this actually DOES happen and is reproducible I would say this has to be registered as a bug because LC should do whatever it takes to preclude this from happening and it isn’t.
LC can’t make an excuse and say it can’t preclude this from happening due to user interaction because it should be able to do exactly what my code manually did to preclude this from happening. If I could manually fix this in my code then LC should then also be able to do the same thing or similar internally and automatically.
[“in lieu of knowing what the problem is, this generalized solution below may help]”
My Resp:
This is in essence what the “checkMouseValueOnMove.livecode” script I sent you in my last post does except it actually has code included to actually execute the necessary fine details stated in your code comments and also makes it work regardless if the message was sent as it moved or if it were sent only at the end. This last thing ensures the code would work even if in is used in a win 7 system that still uses the old meaning of the message.
“[I do agree with Ed that it would be desirable to see a new message added so we can have a simple means of getting notification of when a moveStack ends. Each has a role, and while it's easier to get the post-move message from a timer than it is to monitor all mouse movement to track real-time stack movement, simpler still would be to have a message for stackMoved right in the box.]”
My Resp:
Agreed. The best solution similar to one of the ones I had previously suggested is to simply have two distinct messages
[1] endMoveStack – Behaving like the original one which only sends the message when the move completes but coinciding with the release of the mouse from the title bar
[2] onGoingMoveStack – Message sent anytime the stack is being moved coinciding with the mouse being pressed against the title bar.
The only lingering problem is the original users of the original intent (msg sent when move ends) are using the same message name as the newer users that are using the same message name for the newer intent (msg sent during the move) so which of the two users have to change their message name and who gets to keep the original message name?
See how a decision not completely thought out continues to affect functionality years later? It’s like a negative domino effect that seems to never want to end.
Thanks Fourthworld, even when we don't agree on everything, your comments and thoughts are always very much appreciated.