Skip to content

A lightweight, macOS-style dock for Windows 11, with glass visuals, smooth magnification, and Genie effect.

fix(dock): ignore maximized windows for fullscreen detection

CristianOlivera16472565dd414
diff --git a/crates/muelle-shell/src/tracker.rs b/crates/muelle-shell/src/tracker.rs
index 911a0c1..66023ce 100644
--- a/crates/muelle-shell/src/tracker.rs
+++ b/crates/muelle-shell/src/tracker.rs
@@ -20,10 +20,11 @@ use windows::{
UI::{
Shell::PropertiesSystem::{IPropertyStore, SHGetPropertyStoreForWindow},
WindowsAndMessaging::{
- EnumWindows, GW_OWNER, GWL_EXSTYLE, GetClassNameW, GetForegroundWindow, GetWindow,
- GetWindowLongW, GetWindowPlacement, GetWindowRect, GetWindowTextLengthW,
+ EnumWindows, GW_OWNER, GWL_EXSTYLE, GWL_STYLE, GetClassNameW, GetForegroundWindow,
+ GetWindow, GetWindowLongW, GetWindowPlacement, GetWindowRect, GetWindowTextLengthW,
GetWindowTextW, GetWindowThreadProcessId, IsIconic, IsWindowVisible,
- WINDOWPLACEMENT, WS_EX_APPWINDOW, WS_EX_NOACTIVATE, WS_EX_TOOLWINDOW,
+ WINDOWPLACEMENT, WS_EX_APPWINDOW, WS_EX_NOACTIVATE, WS_EX_TOOLWINDOW, WS_MAXIMIZE,
+ WS_THICKFRAME,
},
},
},
@@ -147,7 +148,10 @@ pub fn foreground_window() -> isize {
}
/// Returns `true` if the foreground window covers the entire `screen`
-/// (for example, video, presentation, or game). The desktop does not count.
+/// (for example, video, presentation, or game). The desktop does not count,
+/// and neither does a maximized window: when nothing reserves screen space
+/// (auto-hide), it covers the screen too, but it still has its sizing frame,
+/// which apps drop when they go full screen.
#[must_use]
pub fn foreground_is_fullscreen(screen: RECT) -> bool {
// SAFETY: Read-only queries on the foreground window.
@@ -161,6 +165,11 @@ pub fn foreground_is_fullscreen(screen: RECT) -> bool {
if pid == GetCurrentProcessId() {
return false;
}
+ let style = GetWindowLongW(hwnd, GWL_STYLE) as u32;
+ let maximized = WS_MAXIMIZE.0 | WS_THICKFRAME.0;
+ if style & maximized == maximized {
+ return false;
+ }
let mut rect = RECT::default();
GetWindowRect(hwnd, &mut rect).is_ok() && covers(rect, screen)
}