File tree Expand file tree Collapse file tree
cosmic-panel-bin/src/space Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1393,16 +1393,28 @@ impl WrapperSpace for PanelSpace {
13931393 }
13941394
13951395 fn keyboard_leave ( & mut self , seat_name : & str , f : Option < c_wl_surface:: WlSurface > ) {
1396- // if not a leaf, return early
13971396 if let Some ( surface) = f. as_ref ( ) {
1397+ // if not a leaf, return early
13981398 if self . popups . iter ( ) . any ( |p| p. popup . parent == * surface) {
13991399 return ;
14001400 }
1401- }
1402- if self . layer . as_ref ( ) . zip ( f) . is_some_and ( |l| l. 0 . wl_surface ( ) == & l. 1 )
1403- && ( self . popups . iter ( ) . any ( |p| p. popup . grab ) || self . overflow_popup . is_some ( ) )
1404- {
1405- return ;
1401+
1402+ if self . layer . as_ref ( ) . is_some_and ( |l| l. wl_surface ( ) == surface)
1403+ && ( self . popups . iter ( ) . any ( |p| p. popup . grab ) || self . overflow_popup . is_some ( ) )
1404+ {
1405+ return ;
1406+ }
1407+
1408+ // Ignore event for wl_surface that isn't our layer or popup (i.e. a different panel)
1409+ if !self . layer . as_ref ( ) . is_some_and ( |l| l. wl_surface ( ) == surface)
1410+ && !self
1411+ . overflow_popup
1412+ . as_ref ( )
1413+ . is_some_and ( |( p, _) | p. c_popup . wl_surface ( ) == surface)
1414+ && !self . popups . iter ( ) . any ( |p| p. popup . c_popup . wl_surface ( ) == surface)
1415+ {
1416+ return ;
1417+ }
14061418 }
14071419
14081420 self . s_focused_surface . retain ( |( _, name) | name != seat_name) ;
You can’t perform that action at this time.
0 commit comments