fullscreen tweaks, vwdw refresh frame scale, cleanup
[goodguy/history.git] / cinelerra-5.1 / guicast / bcwindowbase.C
index f5759dd853d31b196d46040781b359f57c766ad8..7de7c15d2d13573043729aa9d01dcf9c7d69ead9 100644 (file)
@@ -1339,20 +1339,25 @@ locking_message = event->xclient.message_type;
 
        case LeaveNotify:
                if( event->xcrossing.mode != NotifyNormal ) break;
-               if( cursor_entered && event->xcrossing.window == win ) {
-                       cursor_entered = 0;
-               }
+               cursor_entered = 0;
                event_win = event->xany.window;
                dispatch_cursor_leave();
                break;
 
        case EnterNotify:
                if( event->xcrossing.mode != NotifyNormal ) break;
-               if( !cursor_entered && event->xcrossing.window == win ) {
-                       if( !event->xcrossing.focus && get_resources()->grab_input_focus ) {
-                               XSetInputFocus(display, win, RevertToParent, CurrentTime);
+
+               if( !cursor_entered ) {
+                       for( int i=0; i<popups.size(); ++i ) {  // popups always take focus
+                               if( popups[i]->win == event->xcrossing.window )
+                               cursor_entered = 1;
                        }
-                       cursor_entered = 1;
+                       if( !cursor_entered && get_resources()->grab_input_focus &&
+                           !event->xcrossing.focus && event->xcrossing.window == win ) {
+                               cursor_entered = 1;
+                       }
+                       if( cursor_entered )
+                               XSetInputFocus(display, win, RevertToParent, CurrentTime);
                }
                event_win = event->xany.window;
                cursor_x = event->xcrossing.x;