What is wrong with Safari's windowing behavior and state machine?

Can someone please explain to me what is the deal with Safari's window management behavior? I mean... macOS generally has pretty abysmal window management but Safari takes the cake for it's crazy behavior. I feel like for some reason, Safari has a global variable for storing window and tab state as well as a bunch of system resources... because that's genuinely the only way I can understand the behavior it exhibits.


But let's take a step back, what am I even talking about? Rather than explain, let's go through some steps in a scenario and you tell me if the behavior makes any sense.


1) Open 2 Safari windows

2) Resize the windows so they have different sizes

3) Open a new window


What size do you expect the window to take? I would expect it to take the size of the window you had in focus but no, it takes the size of the *last window modified* even if you click on the 1st window again and press Cmd-N. Ok fine. We can at least explain what's going on here... but let's take it one step further...


4) Resize a window and close it

5) Cmd-N on the other window


What do you expect to happen? On Chrome I think it would take the size of the active window. On Safari it takes the size of the window you closed (which was the one you last modified)... Ok. So clearly the state was written to by the closed window so clearly the state exists and persists outside the lifetime of the window.


But wait, there's more!


6) Press and hold the maximize button and tile your windows into the 4 corners.

7) Pull 1 window out so it writes to the window state var by resizing back to the original size

8) Cmd-W the other tabs (while still tiled in the corners) not in the one you pulled out

9) Create a new window


What do you expect to happen? Based on previous experiments, it should take on the size of the window we pulled out from the tile layout... right? Nope. It takes the size of the window you Cmd-W away not the last window that was modified (the one you pulled out)


But wait, maybe the corner tab just wrote to the state! Well yes, it did. But here's where it get really funky.


10) Try dragging the new window that snapped to the corner where the last tab you closed was.


What do you expect to happen? Well it's a new tab so nothing, you just move it around.... right? Nope, it tries to restore the size of the original tab that you pulled out from the tileset layout separately... because that one wrote to the state and then the corner window corrupted everything when you closed it... I guess.


Want further proof this is broke af? Here's another quick one


1) Open 2 windows

2) Resize 1 to be bigger than the other

3) Drag the bigger tab into the smaller window

4) Create a new tab in your windows with 2 tabs

5) Drag the new tab out of the smaller window


What size do you expect it to have? Surprise! It takes on the size of the big window despite the parent window being the smaller one. But 1 more for good luck!


1) Open 2 windows

2) Resize 1 window to be bigger and open a new tab in the bigger window

3) Close the smaller window

4) Close 1 of the tabs in the bigger window

5) Cmd-N a new window


What size do you expect it to have? Since I closed the big tab last, big tab size! Haha, yea no. It takes on the small size obviously because you closed the small WINDOW but a big TAB. Ok sure.


6) Jiggle the size of the big window a bit (modifying the state)

7) Cmd-N a new window


What size should it take? Obviously the size of the window we just jiggled and not the smaller window we Cmd-N'd after step 4... right? Haha, funny thing, the answer is no it takes on the size of the SMALLER WINDOW BECAUSE IT WAS THE LAST WINDOW CREATED. what? Literally the exact opposite of what it was just doing. I can't explain this one, sorry.


There are also other resources that are shared in this same way that causes a lot of frustration... media resources and handles are like this and leak whenever 1 tab of multiple crashes because the other tabs do not own their own resources so they cannot clean up when they crash. Similarly, history is like this but at least that one kinda makes sense... except when safari crashes it, the crashing tab can destroy your history and open tab session info for all tabs, meaning you will lose all your open tabs (even ones that have persisted across multiple sessions)

Mac Studio

Posted on May 31, 2025 01:29 AM

Reply

Similar questions

2 replies

Jun 1, 2025 09:12 AM in response to John Galt

"Windows are going away."


I'm not so sure I'm convinced about this one. Sure Apple is looking to consolidate the UX but iOS and macOS are two very different OS with different purposes and features. I don't see an iOS-like experience being anywhere near as productive as macOS with it's multiple display support, multiple input support, generic USB support, advanced networking support, multi-user support, shell access, etc.


It'll be years (if ever) before "windows are gone," so until then, Apple should fix Safari.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

What is wrong with Safari's windowing behavior and state machine?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.