remove shouldFinish to allow outer loop to handle cleanup#399
remove shouldFinish to allow outer loop to handle cleanup#399johnathan-becker wants to merge 1 commit intognustep:masterfrom
Conversation
|
I have no issue with removing this specific line, but wouldn't it be better, if we removed the whole |
|
I am not opposed to that. It will break us but we can come back and find a different solution when we have more time and/or just patch libs-gui when we build GNUstep. |
|
Thank you very much for looking into this. On a semi-related note, it would be nice if regular menus and context menus (right-click) would behave consistently in this regard. Thanks! |
|
@probonopd You are right I missed checking context menus during my testing. However reverting 82717ee entirely does not fix this issue for context menus. That would be some other separate fix I think we would need to make and I am not sure if it would even relate to this code at this point. |
|
@pkgdemon context menus were not working in a consistent way before, so I agree they can be handled in a separate PR. |
|
@fredkiefer What is your final decision on this MR? I know it is affecting others so I am fine with whatever decision you make. I do need to get something scheduled on our backlog though if we are going to just revert my change (which again I am fine with). |
|
I still prefer the full revert over just removing this one line. Why? When we remove this line there is only a |
After our discussion @fredkiefer , I performed some tests. Status Quo: current code has horizontal menu broken (mac-style): click on the menu does not leave the menu open, an annoying bug. Removing Fixes horizontal menus for me too, so the whole if should be removed. The whole if-statement is not placebo, because the outer loop continues while it is a MouseEvent or it should finish, while shouldFinish is set YES if a MouseEvent is found - this is cause of the menu-click breakage. |
|
I proposed an equivalent fix which is more comprehensive in #336 |
Remove shouldFinish assignment on mouse-up in inner event loop
In the inner do/while loop that drains NSAppKitDefined events after a mouse-up is received, there was a redundant shouldFinish = YES assignment immediately before a break. We didn't need this because shouldFinish is already set to yes in the outer loop whenever a mouse-up event is seen and setting it in the inner loop actually caused the outer loop exit prematurely before it does its cleanup.