Skip to content

Commit

Permalink
fix(taskbar): not hiding windows taskbar at start
Browse files Browse the repository at this point in the history
  • Loading branch information
eythaann committed Jul 25, 2024
1 parent d14f347 commit 8d4c7da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### fix
- Fix zorder on hovering on weg and toolbar respectively to wm borders.
- Applying bad themes on apps.
- Not hiding the taskbar at start.

## [1.8.5]
### fix
Expand Down
20 changes: 14 additions & 6 deletions src/background/seelen_weg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ lazy_static! {
"Seelen Fancy Toolbar Hitbox",
"Program Manager",
]);
static ref EXE_BLACK_LIST: Vec<&'static str> = Vec::from([
"msedgewebview2.exe",
"SearchHost.exe",
"StartMenuExperienceHost.exe",
]);
}

static OVERLAP_BLACK_LIST_BY_TITLE: [&str; 7] = [
Expand All @@ -56,6 +51,13 @@ static OVERLAP_BLACK_LIST_BY_TITLE: [&str; 7] = [
"Program Manager",
];

static OVERLAP_BLACK_LIST_BY_EXE: [&str; 4] = [
"msedgewebview2.exe",
"SearchHost.exe",
"StartMenuExperienceHost.exe",
"ShellExperienceHost.exe",
];

#[derive(Debug, Serialize, Clone)]
pub struct SeelenWegApp {
hwnd: isize,
Expand Down Expand Up @@ -237,7 +239,8 @@ impl SeelenWeg {
let should_handle_hidden = self.ready
&& WindowsApi::is_window_visible(hwnd)
&& !OVERLAP_BLACK_LIST_BY_TITLE.contains(&WindowsApi::get_window_text(hwnd).as_str())
&& !EXE_BLACK_LIST.contains(&WindowsApi::exe(hwnd).unwrap_or_default().as_str());
&& !OVERLAP_BLACK_LIST_BY_EXE
.contains(&WindowsApi::exe(hwnd).unwrap_or_default().as_str());

if !should_handle_hidden {
return Ok(());
Expand Down Expand Up @@ -387,6 +390,11 @@ impl SeelenWeg {
let pdata = AppBarData::from_handle(handle);
pdata.set_state(state);
WindowsApi::show_window(handle, cmdshow)?;

std::thread::spawn(move || -> Result<()> {
std::thread::sleep(std::time::Duration::from_millis(1000));
SeelenWeg::hide_taskbar(hide)
});
}
Ok(())
}
Expand Down

0 comments on commit 8d4c7da

Please sign in to comment.