My freshman year roommate acquired a boyfriend pretty early on in the school year, who then proceeded to be in our room all. the. time. I think sometimes even when my roommate wasn't there (though I've rather blocked a lot of it out). He lived down the hall from us, and on a personal level, he grated on my very last nerve. I also found him rather creepy, as he was in his early 20s and started dating my not-yet-18 roommate within a few weeks of moving in.
Midway through the year, my roommate decided she was ready to commence a more intimate relationship with said boyfriend, so a lot of that time in our room started being time when I wasn't welcome. I could pretty much guarantee that if I left for a couple of hours at a time, at any time, I'd come back to a locked door and a note on the whiteboard we kept outside it to knock first. Which meant that I either did in fact knock and then wait outside my own room while they scrambled into clothing (can we say awkward!), or took the hint and just didn't attempt to get into my own room.
I, rather unfortunately, responded to this annoyance by complaining a whole lot about being locked out of my room to everyone else I knew on that floor, which was probably pretty awkward of me.
This was also about the time when the boyfriend's roommate got fed up with stuff like the above happening, and banned my roommate from his room. I was really mad that I hadn't thought of doing that first (and wouldn't have had the spine to stick with it if I had), because it meant that the boyfriend spent even more time in our room. He also started spending the night. My roommate's bed was lofted perpendicularly over mine, and though I never had any desire to obtain conclusive proof, I'm fairly certain they weren't bothered by engaging in certain activities directly over my head when they thought I was asleep.
I tried to respond in a more mature way to this new frustration, so I suggested that we implement a rule that all non-roommates had to vacate the room when one of us decided it was time to go to sleep. That included friends and study groups and what have you for both of us as well as the boyfriend, and I still think it was a perfectly reasonable and fair rule since it was sort of a blanket one. There were plenty of common areas where people could hang out in our dorm, one of which was literally 3 feet from our door.
But, since none of those common areas were conducive to intimate activities, my roommate apparently decided the rule didn't really apply. I say apparently because she never actually talked to me about it, she just decided that she'd have her boyfriend sneak into our room after she thought I was asleep. Which I know about because I don't always fall asleep right away, and because my bed was right next to the door.
We didn't normally keep our door locked (as was pretty common in our dorm, though probably not terribly intelligent), so my response was to just "accidentally" lock the door when I went to bed. It wasn't a great response, because it still didn't result in any actual discussions about how to resolve this issue, nor did it stop the behavior. But I guess at least it forced the boyfriend to knock and my roommate to get out of bed to let him in.
I was far from a perfect roommate (we were both freshmen living on our own for the first time, after all), but it still kind of infuriates me over a decade later how cavalier my roommate was about my personal space and my privacy, as though they were somehow less important than her desire to spend time (intimate and otherwise) with her boyfriend. I really wish I'd been able to articulate that better at the time, and had known better how to be politely assertive instead of becoming incredibly passive-aggressive.