зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1872997 - [cocoa] Don't trigger mouseenter/leave events for windows that ignore mouse events. r=mac-reviewers,mstange
In the patches above, we make some tooltips (which ignore mouse events) actually overlap the mouse. That should be fine (and is fine on other platforms) but Cocoa still sends mouseenter/leave events which confuse the front-end. This fixes that. Differential Revision: https://phabricator.services.mozilla.com/D197905
This commit is contained in:
Родитель
267ec889a9
Коммит
3a54b24c9b
|
@ -5001,12 +5001,15 @@ void ChildViewMouseTracker::OnDestroyWindow(NSWindow* aWindow) {
|
|||
}
|
||||
|
||||
void ChildViewMouseTracker::MouseEnteredWindow(NSEvent* aEvent) {
|
||||
sWindowUnderMouse = [aEvent window];
|
||||
ReEvaluateMouseEnterState(aEvent);
|
||||
NSWindow* window = aEvent.window;
|
||||
if (!window.ignoresMouseEvents) {
|
||||
sWindowUnderMouse = window;
|
||||
ReEvaluateMouseEnterState(aEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void ChildViewMouseTracker::MouseExitedWindow(NSEvent* aEvent) {
|
||||
if (sWindowUnderMouse == [aEvent window]) {
|
||||
if (sWindowUnderMouse == aEvent.window) {
|
||||
sWindowUnderMouse = nil;
|
||||
[sLastMouseMoveEvent release];
|
||||
sLastMouseMoveEvent = nil;
|
||||
|
|
Загрузка…
Ссылка в новой задаче