@@ -45,7 +45,7 @@ impl UserAppsManager {
4545 Self :: send ( UserAppsEvent :: WinAdded ( window. address ( ) ) ) ;
4646 }
4747 }
48- WinEvent :: ObjectNameChange => {
48+ WinEvent :: ObjectNameChange | WinEvent :: ObjectParentChange => {
4949 let was_interactable = is_interactable;
5050 is_interactable = is_interactable_and_not_hidden ( & window) ;
5151 match ( was_interactable, is_interactable) {
@@ -59,15 +59,16 @@ impl UserAppsManager {
5959 }
6060 _ => { }
6161 }
62- }
63- WinEvent :: ObjectParentChange => {
62+
6463 // re-check for UWP apps that on creation starts without a parent
65- if let Some ( parent) = window. parent ( ) {
66- if !USER_APPS_MANAGER . contains_win ( & parent)
67- && parent. is_interactable_and_not_hidden ( )
68- {
69- USER_APPS_MANAGER . add_win ( & parent) ;
70- Self :: send ( UserAppsEvent :: WinAdded ( parent. address ( ) ) ) ;
64+ if event == WinEvent :: ObjectParentChange {
65+ if let Some ( parent) = window. parent ( ) {
66+ if !USER_APPS_MANAGER . contains_win ( & parent)
67+ && parent. is_interactable_and_not_hidden ( )
68+ {
69+ USER_APPS_MANAGER . add_win ( & parent) ;
70+ Self :: send ( UserAppsEvent :: WinAdded ( parent. address ( ) ) ) ;
71+ }
7172 }
7273 }
7374 }
@@ -167,8 +168,14 @@ pub fn is_interactable_and_not_hidden(window: &Window) -> bool {
167168 return false ;
168169 }
169170
171+ let to_validate = match window. get_frame_creator ( ) {
172+ Ok ( None ) => return false , // not found
173+ Ok ( Some ( creator) ) => creator,
174+ Err ( _) => * window, // window is not a frame
175+ } ;
176+
170177 let guard = FULL_STATE . load ( ) ;
171- if let Some ( config) = guard. get_app_config_by_window ( window . hwnd ( ) ) {
178+ if let Some ( config) = guard. get_app_config_by_window ( to_validate . hwnd ( ) ) {
172179 if config. options . contains ( & AppExtraFlag :: NoInteractive ) {
173180 return false ;
174181 }
0 commit comments