Skip to content

Commit 3df104e

Browse files
committed
fix(dock): ghost windows appearing on dock
1 parent 76569b1 commit 3df104e

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- toolbar overlapped and hidden state.
88
- addition of pdb files on nightly builds.
9+
- interactable windows matching system.
910

1011
### fix
1112

src/background/modules/apps/application/windows.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/static/apps_templates/system.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,3 @@
8181
options:
8282
- no-interactive
8383
- unmanage
84-
85-
- name: Idle Windows Settings
86-
identifier:
87-
id: Windows\ImmersiveControlPanel
88-
kind: Path
89-
matchingStrategy: Contains
90-
options:
91-
- no-interactive
92-
- unmanage

0 commit comments

Comments
 (0)