Skip to content

WinMin - macOS menu bar utility that makes the Dock behave like the Windows taskbar

License

Notifications You must be signed in to change notification settings

Bittabola/winmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinMin

Make your Mac Dock behave like the Windows taskbar.

WinMin is a lightweight macOS menu bar utility that adds Windows-style minimize/restore toggle behavior to dock icon clicks. When you click a dock icon for an app that's already in focus, WinMin minimizes all its windows. Click again to restore them.


AI-Generated Project

This application, including all source code, documentation, and visual assets (app icon), was entirely created by AI (Claude by Anthropic) through pair programming sessions. No human-written code exists in this project. This serves as a demonstration of AI-assisted software development capabilities.


Features

  • Windows-style toggle: Click a frontmost app's dock icon to minimize all its windows; click again to restore
  • Space-aware: Only affects windows on your current desktop space
  • Multi-monitor support: Correctly handles windows across multiple displays
  • Fullscreen-aware: Fullscreen windows are excluded from toggle operations
  • Lightweight: Runs silently in your menu bar with minimal resource usage
  • Privacy-focused: No data collection, no network access, fully local operation

Requirements

Requirement Details
macOS 14.0 (Sonoma) or later
Architecture Apple Silicon (arm64)
Permissions Accessibility access required

Why Accessibility Permission?

WinMin needs Accessibility permission to:

  • Detect when you click dock icons
  • Minimize and restore application windows
  • Determine which windows are on the current space

Your privacy is respected - WinMin only observes dock interactions and window states. It doesn't read window contents, log keystrokes, or transmit any data.


Installation

Download

  1. Download the latest release from GitHub Releases
  2. Move WinMin.app to your Applications folder
  3. Launch WinMin
  4. Grant Accessibility permission when prompted

Building from Source

git clone https://github.com/Bittabola/winmin.git
cd winmin/WinMin
xcodebuild -scheme WinMin -configuration Release build

The built app will be in ~/Library/Developer/Xcode/DerivedData/WinMin-*/Build/Products/Release/


How It Works

Basic Usage

  1. App is frontmost with visible windows: Click its dock icon → all windows minimize to dock
  2. App is frontmost with minimized windows (minimized by WinMin): Click its dock icon → all windows restore
  3. App is not frontmost: Click its dock icon → normal macOS behavior (app activates)

User-Minimized Windows

WinMin only restores windows that it minimized. If you manually minimize a window using the yellow traffic light button, WinMin will not restore it when you click the dock icon.

This is intentional behavior that respects user intent:

  • WinMin-minimized windows: Tracked and restored on dock click
  • Manually-minimized windows: Left alone, stay minimized

Example: You have two Safari windows (A and B). You minimize B manually using the yellow button, then click Safari's dock icon to minimize A with WinMin. Clicking the dock icon again restores only A. Window B stays minimized because you explicitly chose to minimize it yourself.

Spaces (Multiple Desktops)

WinMin is fully space-aware:

  • Minimize: Only minimizes windows on your current space
  • Restore: Only restores windows that belong to the current space
  • Other spaces: Windows on other spaces are completely unaffected

Example: You have Safari windows on Space 1 and Space 2. On Space 1, clicking Safari's dock icon only toggles the Space 1 windows. Space 2 windows remain untouched.

Fullscreen Windows

Fullscreen windows receive special handling:

  • Excluded from toggle: Clicking the dock icon won't minimize a fullscreen window
  • Coexistence: If an app has both fullscreen and regular windows, only the regular windows toggle
  • Reliable restore: When a fullscreen window is active, WinMin correctly restores minimized regular windows without getting confused by the fullscreen state

Example: You're watching a video in fullscreen Safari while having another Safari window open. Clicking Safari's dock icon toggles the regular window while leaving the fullscreen video untouched.

Multi-Monitor Configurations

WinMin properly supports multi-monitor setups:

  • Per-display spaces: Each monitor has its own active space, and WinMin tracks all of them
  • Cross-monitor windows: Windows are correctly associated with their respective monitor's space
  • Mixed scenarios: Works correctly even with fullscreen on one monitor and regular windows on another

Example: Monitor 1 shows Desktop 1, Monitor 2 shows Desktop 3. Clicking an app's dock icon affects windows visible on both monitors (Desktop 1 AND Desktop 3), but not windows on Desktop 2 or 4.


Known Limitations

Stage Manager Not Supported

WinMin automatically disables itself when Stage Manager is active.

When Stage Manager is enabled, window management behavior changes fundamentally in ways that conflict with WinMin's minimize/restore approach. Rather than providing a degraded experience, WinMin displays a warning and disables itself.

To use WinMin, disable Stage Manager:

  1. System Settings → Desktop & Dock
  2. Turn off "Stage Manager"

Stage Manager support may be explored in a future version.

Other Limitations

Limitation Details
User-minimized windows Windows minimized manually via the yellow button are intentionally not restored by WinMin. See User-Minimized Windows for details.
App-specific behaviors Some apps (Finder, System Settings) have unique window management that may not behave as expected.
Intel Macs Currently Apple Silicon only. Universal binary planned for v1.0.
Older macOS macOS 13 (Ventura) support planned for v1.0.

Troubleshooting

WinMin isn't responding to dock clicks

  1. Check Accessibility permission: System Settings → Privacy & Security → Accessibility → Ensure WinMin is enabled
  2. Check if WinMin is enabled: Click the menu bar icon and verify "Enabled" is checked
  3. Restart WinMin: Quit and relaunch the app

Windows aren't minimizing/restoring correctly

  1. Check for fullscreen: Fullscreen windows are intentionally excluded
  2. Check the space: Only windows on the current space are affected
  3. Check Stage Manager: WinMin is disabled when Stage Manager is active

Menu bar shows "Disabled: Stage Manager"

WinMin has detected that Stage Manager is enabled. To use WinMin:

  1. System Settings → Desktop & Dock
  2. Turn off "Stage Manager"
  3. WinMin will automatically re-enable

Viewing Debug Logs

For troubleshooting complex issues:

log stream --predicate 'subsystem == "com.winmin.WinMin"' --level debug

Bug Reports & Development Help

WinMin is in active development. Bug reports are incredibly valuable, especially for:

High-Value Bug Reports

  1. Multi-monitor edge cases

    • Unusual monitor arrangements (vertical stacking, mixed resolutions)
    • Three or more monitors
    • Monitors with different space configurations
  2. Fullscreen interactions

    • Apps with multiple fullscreen windows
    • Split View (two apps sharing fullscreen)
    • Fullscreen on external displays
  3. Space-related issues

    • Windows appearing on wrong spaces after restore
    • Windows not being detected on current space
    • Mission Control interactions
  4. App-specific problems

    • Apps where toggle doesn't work
    • Apps with unusual window types (panels, popovers)
    • Electron apps, Java apps, or other cross-platform frameworks
  5. Memory or performance issues

    • Memory growth over time
    • High CPU usage
    • Sluggish dock response

How to Report Bugs

  1. Open an issue on GitHub Issues
  2. Include:
    • macOS version
    • Steps to reproduce
    • Expected vs actual behavior
    • Debug logs (see above) if possible

Technical Details

How WinMin Detects Dock Clicks

WinMin uses a dual-signal approach:

  1. AXObserver on Dock.app: Monitors kAXSelectedChildrenChangedNotification to track which dock icon is hovered
  2. CGEventTap: Captures left mouse clicks to detect when the user clicks
  3. Correlation: When a click occurs on the frontmost app's dock icon, WinMin triggers the toggle

Space Detection

WinMin uses private macOS APIs to detect spaces:

  • CGSMainConnectionID() - Window Server connection
  • CGSCopyManagedDisplaySpaces() - Active space per display
  • CGSCopySpacesForWindows() - Which space(s) a window belongs to

These APIs are used by other popular utilities like DockDoor and AltTab.

Window Management

Window operations use the Accessibility API (AXUIElement):

  • kAXMinimizedAttribute - Check/set minimized state
  • AXFullScreen - Detect fullscreen windows
  • kAXRaiseAction - Bring window to front on restore

Privacy

WinMin:

  • Does not collect any user data
  • Does not make any network connections
  • Does not read window contents or user input
  • Only observes dock interactions and window minimize states
  • Is fully open source for transparency

License

MIT License - see LICENSE for details.


Acknowledgments

  • Inspired by DockDoor for dock detection techniques
  • Built entirely through AI pair programming with Claude

Version History

v0.7.0

  • Fix restored windows not receiving focus
  • Fix bug restoring user-minimized windows
  • Add Hide Menu Icon option with persistent state
  • Fix fullscreen + multi-monitor window toggle behavior
  • Add app icon
  • Remove prototype code from repository

v0.1.0 (Beta)

  • Initial release
  • Core minimize/restore toggle functionality
  • Space-aware window management
  • Multi-monitor support
  • Fullscreen window handling
  • Stage Manager detection (auto-disable)
  • Menu bar interface with enable/disable toggle
  • Launch at Login support

About

WinMin - macOS menu bar utility that makes the Dock behave like the Windows taskbar

Resources

License

Stars

Watchers

Forks

Languages