In the pilot episode, Ronny's mother, Marjorie (Laurie Metcalf), asks him if he's still gay — years after he came out to the family. That's not exactly what happened to Gallivan, but it's close.
"That's actually based on a sort of joking thing my brother said to me," he said. "Like, 'Oh, you're still gay?' And I said, 'Yes.' And he said, 'Oh, well, we never meet anybody [you're dating]. I didn't know if you were still pursuing it.'
"So I was like, 'Yeah, I'm giving it a go. I'm not great at it, but just going to stick with it.' "
Like Gallivan's father, Ronny's father, Arthur (Jack McGee), is a high-school basketball coach. And, like Gallivan's mother, Marjorie is a huge Kyra Sedgwick fan. Ronny and Marjorie are both obsessed with "The Good Wife," as are Gallivan and his mother.
Gallivan's mom is also a big fan of "The Big Bang Theory," so she's thrilled to see Metcalf playing her.
"She somehow missed 'Roseanne' altogether," he said. "But she's, like, 'So when you met Sheldon's mother, did she say. ...' "
"The McCarthys" is not entirely autobiographical. Gallivan's sisters, combined into the character of Jackie (Kelen Coleman), insisted that he make that clear.
" 'The McCarthys' is loosely inspired by my family, and they demanded that I tell you that," Gallivan said. "Especially my sisters, who called me today. 'You tell them we've never had a DUI. We've never carried a dead man's baby.' So now I've told you."
He told his family that sitcom characters need to be flawed to create the comedy.
"So I had to add flaws that aren't there in our family in real life," he said. "And sitcoms also require heartwarming moments, so I also had to add heartwarming moments that don't exist in our real life.
"They were like, 'OK, that seems fair.' "
Whether the Gallivans will be pleased with how they've been adapted for "The McCarthys" remains to be seen.
"They haven't seen the pilot yet, and they won't until Oct. 30," Gallivan said, "because I want to keep the relationship going until then."
Scott D. Pierce covers television for The Salt Lake Tribune. Email him at email@example.com; follow him on Twitter @ScottDPierce.