@@ -684,12 +684,14 @@ impl cosmic::Application for CosmicAppLibrary {
684
684
}
685
685
Message :: Layer ( e, id) => match e {
686
686
LayerEvent :: Focused => {
687
- if id == WINDOW_ID . clone ( ) {
688
- return text_input:: focus ( SEARCH_ID . clone ( ) ) ;
689
- } else if id == DELETE_GROUP_WINDOW_ID . clone ( ) {
690
- return button:: focus ( SUBMIT_DELETE_ID . clone ( ) ) ;
691
- } else if id == NEW_GROUP_WINDOW_ID . clone ( ) {
692
- return text_input:: focus ( NEW_GROUP_ID . clone ( ) ) ;
687
+ if self . menu . is_none ( ) {
688
+ if id == WINDOW_ID . clone ( ) {
689
+ return text_input:: focus ( SEARCH_ID . clone ( ) ) ;
690
+ } else if id == DELETE_GROUP_WINDOW_ID . clone ( ) {
691
+ return button:: focus ( SUBMIT_DELETE_ID . clone ( ) ) ;
692
+ } else if id == NEW_GROUP_WINDOW_ID . clone ( ) {
693
+ return text_input:: focus ( NEW_GROUP_ID . clone ( ) ) ;
694
+ }
693
695
}
694
696
}
695
697
LayerEvent :: Unfocused => {
@@ -859,7 +861,7 @@ impl cosmic::Application for CosmicAppLibrary {
859
861
reactive : true ,
860
862
..Default :: default ( )
861
863
} ,
862
- grab : true ,
864
+ grab : false ,
863
865
parent_size : None ,
864
866
close_with_children : true ,
865
867
input_zone : None ,
@@ -1680,6 +1682,11 @@ impl cosmic::Application for CosmicAppLibrary {
1680
1682
modifiers: _mods,
1681
1683
..
1682
1684
} ) => Some ( Message :: Hide ) ,
1685
+ cosmic:: iced:: Event :: Mouse ( iced:: mouse:: Event :: ButtonPressed ( _) )
1686
+ if id == WINDOW_ID . clone( ) =>
1687
+ {
1688
+ Some ( Message :: CloseContextMenu )
1689
+ }
1683
1690
cosmic:: iced:: Event :: Keyboard ( iced:: keyboard:: Event :: KeyPressed {
1684
1691
key,
1685
1692
text: _,
0 commit comments