Fix "Focus event lost if opening window on macOS" (#1300)
Some checks failed
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

This commit is contained in:
ManoloFLTK
2025-09-03 09:00:34 +02:00
parent 5830c72b58
commit 93fae41fc2

View File

@@ -1143,6 +1143,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
}
break;
case NSEventTypeMouseEntered :
if ([theEvent window]) update_e_xy_and_e_xy_root([theEvent window]);
Fl::handle(FL_ENTER, window);
break;
case NSEventTypeMouseExited :
@@ -1465,7 +1466,6 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
Fl_Window *window = [nsw getFl_Window];
Fl::first_window(window);
if (!window->parent()) [nsw orderFront:nil];
update_e_xy_and_e_xy_root(nsw);
if (fl_sys_menu_bar && Fl_MacOS_Sys_Menu_Bar_Driver::window_menu_style()) {
// select the corresponding Window menu item
int index = Fl_MacOS_Sys_Menu_Bar_Driver::driver()->first_window_menu_item;