nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
7.56k stars 124 forks source link

Re-instate "global" window-hiding-location (non-per-monitor) as a configuration option #666

Closed ELLIOTTCABLE closed 2 weeks ago

ELLIOTTCABLE commented 2 weeks ago

So, my monitor layout is … pretty incompatible with the new(-ish) layout constraints as of I-think-around-0.14-ish.

Current layout:

Screenshot 2024-11-05 at 12 37 48
(photo) ![IMG_8597](https://github.com/user-attachments/assets/ac0e6f41-90a7-4e62-88c5-3df82c2c2998)

I'd like the previous behaviour to return as an option - that is, when enabled, Aerospace would use a single corner of a single monitor for all minimized windows.

This would result in the re-appearance of bugs such as #149 that the per-monitor "stash" is intended to bypass, when the option is enabled - for me, that's an acceptable trade-off, as Aerospace is freaking awesome, but also makes a huge portion of my display-space unusable since the change. 😩

In my setup, for example, the ideal behaviour would be Aerospace noticing that there's no monitors to the bottom-left of the leftmost side, and utilizing that corner as the "stash."

Yes, I'm aware I'm an outlier; I present this more as a supporting argument that this is worth at least retaining as an option. (In particular, even if you're a little less insane than me, one of the classic multi-monitor favourites - the H shape, i.e. ▐⧯▌ - still includes a centered monitor with no "empty" bottom-corner. )=)

System details (Full AllRez output: [gist](https://gist.github.com/ELLIOTTCABLE/23900ebee36928162f121fe268d56fbb/raw/9f546718c13fc75d5cd6cba31353186253567da5/allrez.log)) ```console $ aerospace --version aerospace CLI client version: 0.15.2-Beta b6cf82771f245ab7349a93baf8709e171537ff58 AeroSpace.app server version: 0.15.2-Beta b6cf82771f245ab7349a93baf8709e171537ff58 $ system_profiler SPSoftwareDataType SPHardwareDataType Software: System Software Overview: System Version: macOS 14.6.1 (23G93) Kernel Version: Darwin 23.6.0 Boot Volume: Ime's HD Boot Mode: Normal Computer Name: Ime-the-MacPro7,1 User Name: ELLIOTTCABLE (ec) Secure Virtual Memory: Enabled System Integrity Protection: Disabled Time since boot: 39 days, 1 hour, 17 minutes Hardware: Hardware Overview: Model Name: Mac Pro Model Identifier: MacPro7,1 Enclosure: Rack Processor Name: 12-Core Intel Xeon W Processor Speed: 3.3 GHz Number of Processors: 1 Total Number of Cores: 12 L2 Cache (per Core): 1 MB L3 Cache: 19.3 MB Hyper-Threading Technology: Enabled Memory: 48 GB System Firmware Version: 2022.140.5.0.0 (iBridge: 21.16.6074.0.0,0) OS Loader Version: 580.140.1~8 Activation Lock Status: Enabled $ system_profiler SPDisplaysDataType 2024-11-05 12:56:16.752 system_profiler[83706:91652599] Device PreExisted [0000000100000f3b] AMD Radeon PRO W6800X Duo 2024-11-05 12:56:16.753 system_profiler[83706:91652599] Device PreExisted [0000000100000f39] AMD Radeon PRO W6800X Duo Graphics/Displays: AMD Radeon PRO W6800X Duo (Slot 1, GPU 1): Chipset Model: AMD Radeon PRO W6800X Duo Type: GPU Bus: PCIe Slot: Slot-1 PCIe Lane Width: x16 VRAM (Total): 32 GB Vendor: AMD (0x1002) Device ID: 0x73ab Revision ID: 0x0000 ROM Revision: 113-D4171X-436 VBIOS Version: 113-D417A1DXL-021 Option ROM Version: 113-D417A1DXL-021 EFI Driver Version: 01.01.270 Metal Support: Metal 3 GPU Number: 1 GPU Peer Group: 3247697833823197077 GPU Peer Index: 0 Infinity Fabric Link: Yes Displays: Pro Display XDR: Display Type: 2D backlit LCD Resolution: 6016 x 3384 Retina 6K Framebuffer Depth: 30-Bit Color (ARGB2101010) Display Serial Number: C02C708XML9V Display Firmware Version: 4.2.37 Mirror: Off Online: Yes Automatically Adjust Brightness: No AMD Radeon PRO W6800X Duo (Slot 1, GPU 2): Chipset Model: AMD Radeon PRO W6800X Duo Type: GPU Bus: PCIe Slot: Slot-1 PCIe Lane Width: x16 VRAM (Total): 32 GB Vendor: AMD (0x1002) Device ID: 0x73ab Revision ID: 0x0000 ROM Revision: 113-D4171X-436 VBIOS Version: 113-D417A1DXL-021 Option ROM Version: 113-D417A1DXL-021 EFI Driver Version: 01.01.270 Metal Support: Metal 3 GPU Number: 2 GPU Peer Group: 3247697833823197077 GPU Peer Index: 1 Infinity Fabric Link: Yes Displays: U13NA: Resolution: 2560 x 1600 UI Looks like: 1280 x 800 @ 60.00Hz Framebuffer Depth: 30-Bit Color (ARGB2101010) Display Serial Number: 1 Mirror: Off Online: Yes Rotation: 180 Connection Type: Thunderbolt/DisplayPort Pro Display XDR: Display Type: 2D backlit LCD Resolution: 6016 x 3384 Retina 6K Framebuffer Depth: 30-Bit Color (ARGB2101010) Display Serial Number: C02C40A8ML9W Display Firmware Version: 4.2.37 Mirror: Off Online: Yes Automatically Adjust Brightness: No Pro Display XDR: Display Type: 2D backlit LCD Resolution: 6016 x 3384 Retina 6K Framebuffer Depth: 30-Bit Color (ARGB2101010) Display Serial Number: C02C70AKML9V Display Firmware Version: 4.2.37 Main Display: Yes Mirror: Off Online: Yes Automatically Adjust Brightness: No Wisecoco: Resolution: 1100 x 3840 UI Looks like: 550 x 1920 @ 60.00Hz Framebuffer Depth: 30-Bit Color (ARGB2101010) Mirror: Off Online: Yes Rotation: 270 Adapter Type: DVI or HDMI Adapter Firmware Version: 2.19 $ system_profiler SPThunderboltDataType Thunderbolt/USB4: Thunderbolt Bus 3: Vendor Name: Apple Inc. Device Name: Mac Pro UID: 0x0000597E6872A903 Route String: 0 Firmware Version: 63.3 Domain UUID: 25C98C7C-4031-CF51-82D3-348175FF7A13 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Receptacle: 8 Link Controller Firmware Version: 1.43.0 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Receptacle: 7 Link Controller Firmware Version: 1.43.0 Thunderbolt Bus 2: Vendor Name: Apple Inc. Device Name: Mac Pro UID: 0x0000597E6872A902 Route String: 0 Firmware Version: 63.3 Domain UUID: C7A4163E-9331-C851-8352-08A5925090B2 Port: Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Receptacle: 6 Link Controller Firmware Version: 1.43.0 Port: Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Receptacle: 5 Link Controller Firmware Version: 1.43.0 Element Hub: Vendor Name: CalDigit, Inc. Device Name: Element Hub Mode: Thunderbolt 3 Device ID: 0x25 Vendor ID: 0x3D Device Revision: 0x1 UID: 0x8087A7369411D800 Route String: 1 Firmware Version: 36.1 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Port: Status: Device connected Link Status: 0x2 Speed: Up to 20 Gb/s x1 Current Link Width: 0x2 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Pro Display XDR: Vendor Name: Apple Inc. Device Name: Pro Display XDR Mode: Thunderbolt 3 Device ID: 0x801F Vendor ID: 0x1 Device Revision: 0x1 UID: 0x000169A4A8208C00 Route String: 501 Firmware Version: 55.2 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 20 Gb/s x1 Current Link Width: 0x2 Link Controller Firmware Version: 1.41.0 Thunderbolt 3 Option Card: Vendor Name: Universal Audio, Inc. Device Name: Thunderbolt 3 Option Card Mode: Thunderbolt 3 Device ID: 0x6 Vendor ID: 0x1176 Device Revision: 0x1 UID: 0x1176B7DD08FA5400 Route String: 3 Firmware Version: 29.3 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Link Controller Firmware Version: 0.33.0 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Link Controller Firmware Version: 0.33.0 Thunderbolt Bus 1: Vendor Name: Apple Inc. Device Name: Mac Pro UID: 0x0000597E6872A901 Route String: 0 Firmware Version: 63.3 Domain UUID: D74A703A-6C3D-3358-A24B-9476CC35005B Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Receptacle: 4 Link Controller Firmware Version: 1.43.0 Port: Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Receptacle: 3 Link Controller Firmware Version: 1.43.0 Element Hub: Vendor Name: CalDigit, Inc. Device Name: Element Hub Mode: Thunderbolt 3 Device ID: 0x25 Vendor ID: 0x3D Device Revision: 0x1 UID: 0x8087C3A1A8020F00 Route String: 3 Firmware Version: 36.1 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Port: Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Port: Status: Device connected Link Status: 0x2 Speed: Up to 10 Gb/s x1 Current Link Width: 0x1 Pro Display XDR: Vendor Name: Apple Inc. Device Name: Pro Display XDR Mode: Thunderbolt 3 Device ID: 0x801F Vendor ID: 0x1 Device Revision: 0x1 UID: 0x00015EE858B26200 Route String: 503 Firmware Version: 55.2 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Link Controller Firmware Version: 1.41.0 Apollo Twin: Vendor Name: Universal Audio, Inc. Device Name: Apollo Twin Mode: Thunderbolt Device ID: 0x2 Vendor ID: 0x1176 Device Revision: 0x1 UID: 0x1176000200077260 Route String: 703 Firmware Version: 7.1 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 10 Gb/s x1 Port Micro Firmware Version: 2.0.7 Cable Firmware Version: 1.1.0 / 0.0.0 Thunderbolt Bus 0: Vendor Name: Apple Inc. Device Name: Mac Pro UID: 0x0000597E6872A900 Route String: 0 Firmware Version: 63.3 Domain UUID: 8C2F59B9-31F2-9656-803B-9D5DC6311AA3 Port: Status: No device connected Link Status: 0x7 Speed: Up to 40 Gb/s x1 Current Link Width: 0x1 Receptacle: 2 Link Controller Firmware Version: 1.43.0 Port: Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Receptacle: 1 Link Controller Firmware Version: 1.43.0 Pro Display XDR: Vendor Name: Apple Inc. Device Name: Pro Display XDR Mode: Thunderbolt 3 Device ID: 0x801F Vendor ID: 0x1 Device Revision: 0x1 UID: 0x0001600540B16100 Route String: 3 Firmware Version: 55.2 Port (Upstream): Status: Device connected Link Status: 0x2 Speed: Up to 40 Gb/s x1 Current Link Width: 0x2 Link Controller Firmware Version: 1.41.0 ```
nikitabobko commented 2 weeks ago

Thanks, I appreciate the well written and clear issue. You setup made laugh 😂 The situation reminds me of https://xkcd.com/1172/

Jokes aside, as you correctly pointed, you are a minority. One of the UX principles that I rely on is "don't provide configuration option that makes users choose between trade-offs". AeroSpace should work in the best possible way by default. That's why AeroSpace automatically chooses the most appropriate corner and doesn't ask users to configure corners manually.

Providing a configuration option to choose between "global hiding" and "local monitor hiding" is choosing between trade-offs, which I won't do.

Ok, so what is the best possible way AeroSpace can automatically behave? I think the way it behaves right now is the best possible way, since it forces users to reconsider their monitor arrangement.

Offtopic. Well, there is a room for improvement - AeroSpace should show a notification / yellow dot in the status bar asking users to change their monitor configuration rather than forcing to read the guide, but it's an improvement for future versions.

Anticipating your next suggestion to use "global" approach when both corners are unavailable, IMO #149 is not an acceptable behavior. I still prefer to ask users to reconsider their monitor configuration, because the user will be happier in the long run.

Given the way AeroSpace implements workspaces, I think your monitor configuration is simply invalid, and I don't see a way to improve it.

Your concrete proposal to provide configuration option to choose between "global" and "local" hiding strategies is rejected => I close the issue. You're free to make other concrete proposals if you think that there is a way to support monitor configurations as yours.

nikitabobko commented 2 weeks ago

Having said that, if you really want to have what I consider "unacceptable" behavior, you have a workaround to run from sources with the following patch to return old behavior:

diff --git a/Sources/AppBundle/tree/MacWindow.swift b/Sources/AppBundle/tree/MacWindow.swift
index aaffca1c..f181ba55 100644
--- a/Sources/AppBundle/tree/MacWindow.swift
+++ b/Sources/AppBundle/tree/MacWindow.swift
@@ -116,21 +116,7 @@ final class MacWindow: Window, CustomStringConvertible {
             prevUnhiddenEmulationPositionRelativeToWorkspaceAssignedRect =
                 topLeftCorner - workspace.workspaceMonitor.rect.topLeftCorner
         }
-        let p: CGPoint
-        switch corner {
-            case .bottomLeftCorner:
-                guard let s = getSize() else { fallthrough }
-                // Zoom will jump off if you do one pixel offset https://github.com/nikitabobko/AeroSpace/issues/527
-                // todo this ad hoc won't be necessary once I implement optimization suggested by Zalim
-                let onePixelOffset = macApp.isZoom ? .zero : CGPoint(x: 1, y: -1)
-                p = nodeMonitor.visibleRect.bottomLeftCorner + onePixelOffset + CGPoint(x: -s.width, y: 0)
-            case .bottomRightCorner:
-                // Zoom will jump off if you do one pixel offset https://github.com/nikitabobko/AeroSpace/issues/527
-                // todo this ad hoc won't be necessary once I implement optimization suggested by Zalim
-                let onePixelOffset = macApp.isZoom ? .zero : CGPoint(x: 1, y: 1)
-                p = nodeMonitor.visibleRect.bottomRightCorner - onePixelOffset
-        }
-        _ = setTopLeftCorner(p)
+        _ = setTopLeftCorner(sortedMonitors.last!.rect.bottomRightCorner - CGPoint(x: 1, y: 1))
     }

     func unhideFromCorner() {

Yes, it comes with the cost of supporting your own fork and dealing with merge conflicts.

Please follow https://github.com/nikitabobko/AeroSpace/blob/main/dev-docs/development.md for the project setup. And you can use install-from-sources.sh in the repo root to install AeroSpace-SNAPSHOT as aerospace-dev cask.

ELLIOTTCABLE commented 2 weeks ago

The situation reminds me of xkcd.com/1172

That precise comic was on my mind while I wrote this, so I appreciate the vibes 😅

You're free to make other concrete proposals if you think that there is a way to support monitor configurations as yours.

Well, it's a last-ditch effort, but I do want to point out that other contributors' thoughts w.r.t. virtual displays tie in here. That is, there is a path forward for users like me that doesn't involve any runtime trade-offs; but it requires additional upfront setup, and requires such a configuration option.

So, basically, it's not just a configuration option that leads to unacceptable tradeoffs; more precisely put, it's a configuration-option that can be (mis-?)used by some users to introduce negative experiences for themselves, if they're willing to turn it on, but not willing to put in the additional work to set it up "correctly."

That said, I do see how that difference is borderline pedantic, because your actual presumable objection is the result of "some users turn on an option, and have a bad time," and that still applies whether or not some other users will turn on that option and have a better time, so I'm really not sure how to sell that.


I'll try and think on better alternatives, but I doubt there'll be any within the constraints of macOS. Ugh, it's a microcosm of the whole thing, innit - trying to be a poweruser and get things done, but also remain within the blesséd land where productivity is possible; it's always a knife's-edge ...