Also, there's this new invention called "doors" that I wish companies would get on board with. I hear that "opening" one's "door" can be used as an invitation to chat. :)
They had a new building constructed, including a very coveted corner office. A student organization was absolutely delighted when they received that corner office, and thought it was a sign of growing appreciation for their work. Turns out, it was actually a way out of a political quagmire: professors had fought for that office so bitterly that it had gotten to a web of "ok, I will accept that you're not giving it to me, as long as X doesn't get it either". The student organization wasn't really hated by anybody enough to be part of this web, so they got it just as a way to avoid pissing anyone off too much.
Must be very new since our office had none bar for the meeting rooms.
This reminds me the time I was working at the office. We had an open floor plan, and so no doors (except the CEO).
It was sometimes nice to talk to people, but there were times when I was deeply in code, and someone asked a small random question from me. It was clearly because he/she wanted just to talk. This would have been better to ask through Slack as I could then continue my work and answer later.
So what I usually did was a) stayed home for deep work hours or b) put on my headset and listened to music to indicate that my "door" was closed.
And yes, with the CTO the physical door was an indication: if it was open, we went in and discussed something, and he was always happy to do so. When it was closed, we didn't interrupt him, and when we did, you could feel that he was feeling indeed interrupted.