Enable unfocused windows to update their status based on whether they are clickable or not - #10229
Conversation
Kalmaegi
commented
Apr 6, 2024
- Fixed Non-focused windows don't show hover state for clickable areas. #9784 By removing the interception of the MouseMove event, zed can update the corresponding Hover even when it is inactive
…dow was inactive or the state was PopUp, but this restriction was removed and we would receive the Move event at all times to update the Hover Status UI
0a7e45e to
9bb4b18
Compare
|
Thanks for the pull request, @weartist! I genuinely don't remember why we were ignoring move events if the window was not the active one. I think we were trying to replicate the behavior on macOS? e.g. Export-1713255079552.mp4However, after #9553, I guess we'll be able to receive clicks even when the window is not focused. Interestingly, it seems like something that not all elements opt into doing though... So my only concern with these changes is the sheer amount of move events all windows will receive even when not focused. Like, is each window going to observe a mouse event at all times when the mouse moves now? Can we double check what impact that has on the CPU? Thanks! 🙏 |
Your concern is right, and the good news is that we only have one window at most that can receive the event, and need that window to be the topmost window of the current mouse position. So I guess it shouldn't have much of an impact on CPU usage, because if the event is received by our window, then the window is currently in a state where it should be received, later I can test it with instrument |
|
I just confirmed that the move event will only be dispatched on one window, so I think we're good. Thanks @weartist! |
… are clickable or not (zed-industries#10229) - Fixed zed-industries#9784 By removing the interception of the MouseMove event, zed can update the corresponding Hover even when it is inactive
