-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Drag ends if mouse moves outside window while resizing a panel #2117
Comments
This is happening because of the |
@jbalsas, fyi -- just noticed this while testing your pull request. If you want to roll this into the existing pull feel free, but we could also wait until later to tackle this... |
Yes... we added that I'll check your suggestion while I work on the review changes for #2092 and push it there if it's simple enough |
@peterflynn That was added by @jbalsas after trying to fix some weird bugs in initial code review, so that line of code cannot simply be removed. I think problem was that when moving mouse outside Brackets window, the mouse cursor changes to indicate that drag is no longer in effect while Brackets still has mouse capture, which is worse than it is now. So, we need to investigate a solution for both problems. |
Reviewed - assigning to Randy to continue to work with Chema. |
I've just done a quick check, and document.mouseup/mousemove does indeed allow us to resize even when the mouse is outside of Brackets. The problem is, as @redmunds points out, that the cursor outside of Brackets is either a regular pointer or the native window resizer (horizontal or vertical) which is even weirder. I've also noticed that sometimes, the native window resizer cursor manages to stay even when we move back to Brackets again. How would you prefer to handle this? |
The visual glitch seems preferable to the behavior bug to me, but I'll ask around the core team and see if others disagree... |
I think it's more than a "visual glitch". This is what happened to me: I was dragging to size panel with a "vertical drag" cursor and the mouse went outside of Brackets. The mouse cursor changed back a normal cursor so I released the mouse thinking that the drag was done. After moving mouse back over Brackets, the panel started going wacky -- that's when I realized that mouse still had the capture. I've seen bugs like this before, so I thought to click the mouse to get out of this state, but it could be a mess for someone that doesn't think of that. |
@redmunds: that's the bug that would occur if you merely removed the $resizeCont.mouseleave() without any other changes. I agree we shouldn't do that. I'm suggesting we also move the mouseup/mousemove handlers up to |
Back in the day we were actually using mouseup/mousemove on $mainView which had the same issue as $resizeCont... As @peterflynn points out, listening for the events on I can put it together #2092 so you can check for yourselves. I guess we should be able to set the cursor system-wide in the shell to fix the visual glitch. Most of the apps I've checked on Mac seem to be doing so... |
I'm not seeing the cursor glitch on my Win XP matchine: CEF is maintaining the cursor we set even as you drag outside the window bounds. (Which I think you might get for free via OS mouse capture anyway...). Is the cursor glitch a Mac-only bug? |
Yes, it looks like this is mac-only. I've tested on Win7 and the cursor works just fine. With that in mind, we could solve this issue within #2092 and create a new mac-only issue for the mouse glitch alone. |
How about fix it for Windows-only (in #2092 if you like), keep it like it is on Mac for now, and use this bug for the Mac-only issue? |
WAIT! There's still a problem on Windows. If you release mouse outside of Brackets Window, then mouse cursor changes to normal, but when you move mouse back over Brackets, it still has the capture. This seems like a slight variation of the same problem. |
@redmunds: I'm not seeing anything bad on Win with my mockup of the changes (basically replacing |
@peterflynn Maybe I misunderstood the proposed changes, but it sounds like the plan was to simply remove the call to $resizeCont.mouseleave() on Windows becasue this is a Mac-only bug. So, that's what I did and was referring to.
Yes, that what I meant. |
Ok yeah, I think we got our wires crossed then :-) See my comment yesterday -- the proposal isn't just to remove that one line, because that'll cause the bug you've been mentioning. But if we move the mouse listeners onto I'd like to see this fix get rolled into @jbalsas's patch for both Mac and Win -- the mouse cursor glitch repros in current builds as well, so it's not a regression caused by this fix, and IMHO not having a fix for that yet shouldn't hold us back from fixing the actual behavioral bug sooner. |
Glad to see we got this sorted out :) I did the tests in the win machine with the overall I'll finish putting everything together for the pull request in a moment so we can test the whole thing. |
Closing now that Chema's fix has been merged. Randy, did you want to file a follow-up bug about the mouse cursor being wrong if you drag past the window border too slowly? |
Result:
Panel stops resizing. You have to mouseup, move the mouse back up, and start dragging again.
The text was updated successfully, but these errors were encountered: