FLTK logo

[master] 93fae41 - Fix "Focus event lost if opening window on macOS" (#1300)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 93fae41 - Fix "Focus event lost if opening window on macOS" (#1300) "ManoloFLTK" 00:02 Sep 03  
 
commit 93fae41fc286d74b38cdce3b7c107e86f2bd730d
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed Sep 3 09:00:34 2025 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed Sep 3 09:00:34 2025 +0200

    Fix "Focus event lost if opening window on macOS" (#1300)

 src/Fl_cocoa.mm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index cde6087..ccafa20 100644
--- src/Fl_cocoa.mm
+++ src/Fl_cocoa.mm
@@ -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;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.